The article explains a step by step procedure for converting an Instance-Store based AMI to EBS based AMI. This article being a step by step procdeure, you can't find much explantion for the commands used. Once you have read this article you will find this as an easy task. 😉
Following are some of my reasons for converting current ami's to ebs based ami.
- Low boot time
- Higher I/O performance
- Start/Stop instance
- upto one TB of disk space
Lets start by launching the instance-store ami. You can perform the below 3 steps using amazon web interface.
Launch an Instance-store ami.
Create a EBS volume. (50 GB)
Mount the EBS volume to your instance as /dev/sdf
Login to the new instance
Shutdown all running process and clean up files and pacakges not required for you.
Create a file system in new volume
Mount the vloume to directory
mount /dev/sdf /mnt
Using rsync copy the files from / to /mnt
rsync -avHx / /mnt/
Now sync /dev
rsync -avHx /dev /mnt
Sync once again to flush all the pending write operations.
Unmount the volume
Now, create a snapshot of the EBS volume using amazon interface or your favourite ec2 client.
Register the snapshot as an AMI using ec2-register command. You will require ec2 api tools. (Refer step16 of create custom ami post for downloading and installing api tools)
ec2-register -K key.pem -C cert.pem -n <name> -d "Description" -s <snapshot id> -a i386 –root-device-name /dev/sda1
Now you have learnt how to convert an instance to ebs based ami. It won't take more than 10 minutes to convert the instance.