Notes from building EC2 Images
Apple released a point release of Leopard this week which means I need to actually reboot my machine. This also means that I need to go through all my open windows and capture the stuff I wanted to remember.
We recently decided to roll out own EC2 images instead of someone else’s in order to have exactly what we want in our instances and nothing else. EC2 on Rails and similar things are handy, but do I want mysql or ferret on an apache loadbalancer machine? No, I do not.
Here, in some sense and order are things to remember when building your own EC2 image collection
- Useful article to get yourself going, but give yourself more than 750M to work with. Depending on how you wire up your instance this could bite you sooner, or later, but it will.
- Even a bare instance will need to have Ruby and Java installed
- Building images using ec2-bundle-vol is much handier than with FINDME
- Make a base image and then base subsequent image of each other type
- Keep track of the packages you install in the child images
- When you rev the base, rev the children
- Don’t forget to use –generate-fstab with ec2-bundle-vol
- Install the AWS AMI and API tools and symlink to them for easy updating
- To get your debian instance to boot you need to modify image.rb before making the image ```
- exec( ‘for i in console null zero ; do /sbin/MAKEDEV -d ‘ + dev_dir + ‘ -x $i ; done’ )
- exec(“cd #{dev_dir} && /sbin/MAKEDEV console && /sbin/MAKEDEV std && /sbin/MAKEDEV generic”) ```
- Think about your port needs and build layers of security groups
- Install the kernel modules; eventually you will need them.
- Borrow liberally from other people’s build scripts: Eric Hammond‘s is pretty good