Posted by calvinaustin
on August 24, 2010 at 5:32 PM PDT
How can you validate your amazon AMI image without needing to upload it to the AWS service to find out that it doesn't even boot? It took me 3 upload attempts to fix my image and installing a bare metal hypervisor wasn't an option on my desktop. After a little bit of research I pulled together a very simple script
I was uploading my Amazon image for the 3rd time. First time it didn't boot, second attempt I couldn't log in via ssh, third attempt , success! Admittedly the bundling didn't take too long for a 10GB file, and even the upload on our work network (this was an S3 image) wasn't that long but 'm sure I wasted a good few hours.
I did my obligatory google and came across a few ideas. First install Xen, hmm that conflicted with my vmware install. Next try eucalyptus, seems like a big hammer for a small nail, tried on another machine and the eucalyptus kernel failed to boot and I had to uninstall to get my machine back. Next I found a few great resources about building your image and some conversion techniques including how to download an AMI image .
By building on these articles I was able to get my AMI image to load in a lightweight emulator qemu/kvm that was a simple package install on my fedora 11 machine. I've added this script, ec2localboot.sh to the home page of our new amazon cost monitor and calculator. I have a few things to add (it relies on an up-rev copy of qemu so I haven't got to backport it to older OS's yet) but I hope its simple enough to use as is. Feel free to modify for your own use.
 http://www.philchen.com/2009/02/14/how-to-create-an-amazon-elastic-compute-cloud -ec2-machine-image-ami