Many of the blogs and documentation on AWS, says its not possible to create an instance store backed image from running instance, which is booted from EBS backed store.
However before I ran into that conclusion, I did some trial and error to create some image, which eventually led me very close to make it possible. Hence I completed it, came up with following steps.
- Boot EBS backed image.
- e2lable /dev/xvde root
- modify /etc/fstab and /boot/grub/grub.conf to change the boot device to LABLE=root and root=LABLE=root respectively.
- I performed this step, as I could not figure out the exact name of the boot device with different pvgrub image and finally settled for labeled root partition.
- Create bundle using ec2-bundle-vol command.
- After the bundle is created open the manifest file and delete the device_mapping and product_codes stanza completely.
- upload bundle and register it.
This works for me for now and haven't run into any issue so far with the image created with this procedure.