Move EC2 AMIs between regions

03 03 2010

Today I spent some time figuring out how to move EBS-backed AMIs between different EC2 regions. To save you the effort, here’s a quick summary:


  • create a volume from the snapshot backing the AMI

  • attach this volume to a running instance and mount it

  • create a new volume in the target region

  • attach to a running instance, format and mount

  • in the source region, connect to your instance

  • rsync (over ssh, so no messing with security groups) the mounted volume to the target volume

  • once the rsync is done, create a snapshot in the target region

  • register this snapsho as new AMI with ec2-register

Not rocket science, but definitely not as good as just being able to share your own AMIs between regions…


Plot EC2 instance usage with Clojure and Incanter

26 02 2010

Have you ever wondered which instance types you use most when dealing with Amazon’s EC2? I have, so I came up with a short Clojure/Incanter program to plot a nice chart like this:

EC2 usage plotted by #incanter (@liebke) on Twitpic
(full size image)

Here’s the code, if you have any feedback please leave a comment, this was the first time I used Incanter.


Simple AWS scripting with boto

28 12 2009

boto is a very nice Python interface to the Amazon Web Services which I can heartily recommend for your cloud scripting needs. Here’s a quick example program I whipped up around 2 weeks ago (be gentle, I’m not a Python guy and this is just a throwaway quickie), which will list all your AMIs (excluding public ones), used S3 buckets plus a list of currently running instances with some information like instance type, start time etc. The nice part is that you can connect to any instance via SSH directly from this lsit which I find more convenient than copy/pasting the public DNS name from the AWS console: