So I had to create an Amazon EC2 instance quickly and ideally it had to be as plain a CentOS instance as possible. Now the first thought that I had was to find a way of creating one from scratch somehow, i.e. use the EC2 tools to bootstrap an S3-based AMI image but whenever I booted this it kept giving me kernel initrd errors and didn’t work.
In the end I just gave up on bootstrapping my own instance from scratch and simply used one of the pre-existing Rightscale CentOS 5.4 images as a starting point. I started it up, removed almost everything from it, including the rightscale rpm. Then I snapshotted it, and converted the snapshot to an AMI using ec2-register.
Now I finally had somewhere to start from. I started up my new instance, and thanks to the instructions on this webpage I proceeded to create a blank EBS volume. I created a filesystem on it and mounted it under /mnt/ebs. Now I could rsync the running instance across. I created the /dev files, unmounted and shut down.
I now had an EBS volume from which I could create a snapshot. I then registered this snapshot again and I finally ended up with an appropriate AMI to use. Job done. Thanks once again to the webkist blog for the detailed instructions.
If I do figure out how to properly bootstrap my own EBS-based AMI image I’ll be sure to post the details here.