Centos 5.6 EBS AMI


Recently, I have tried a slightly different approach in building an EBS Centos 5.6 AMI using Fedora8 Instance Store. In my older post, Custom Centos5.5 was build as an Instance Store. The major changes from my older post is as follows:

  • Attached an EBS volume of 50 GB and installed centos in it.
  • Created an EBS snapshot
  • Registered the EBS snapshot

This is just focused on the commands which I have used. Please refer older posts to know more. It will take around 30mins to complete the image.

  • Launched Fedora 8 32bit provided by amazon. ( ami-48aa4921 )
  • Create a 50 GB EBS volume and attach to the Fedora 8 as /dev/sdb
  • Format the partition as ext3 -> mkfs.ext3 /dev/sdb
  • Rename /etc/yum.conf and /etc/yum.repos.d in Fedora. This is required to avoid conflicts.
  • mkdir /mnt/centos5
  • mount /dev/sdb /mnt/centos5

Follow the older post from Step5 to Step16. Make sure you update repository path for centos 5.6 in yum.conf.

After Step16, follow the below procedure.

  •   Download AWS certificate and private key and store it in /mnt as cert.pem and key.pem
  •   Create a snapshot of the EBS volume using AWS console
  •   Register the snapshot
    • ec2-register -K key.pem -C cert.pem -n <name> -d "Description" -s <snapshot id> -a i386 –root-device-name /dev/sda1

When you launch the AMI, select the kernel ID :-  aki-407d9529 , the instance will start even if this is id is not selected. But, the chances for the instance to crash is very high.