Not super-thrilled with EC2

| Comments (2) | Software
I've got a reasonably large computation job—bigger than I can conveniently do on my own hardware—I need to do, and so naturally I thought EC2. For those of you who don't know, the basic idea behind EC2 is that you have Amazon Machine Images (AMIs), which represent the state of a machine which is off (e.g., the disk drive state). You can activate as many instances as you want, booting off the same AMI, which gives you a bunch of nearly identical machines (except for the IP address, etc.) which you can then log into and use for whatever you want. All the management is via this Web services interface which you drive with client-side Java apps. So, for instance ec2-run-instances XXX brings up a single instance of image XXX.

After about 5 hours screwing around with it, I've figured out how to do what I want, but I have to say, they don't make it super-convenient.

  • Nothing has a mnemonic name. So, for instance, all the images are names ami-XXXXXXXX where the Xs are hex digits. Running instances are similar. Now, I can totally understand why it's convenient to use numeric identifiers, but since they make you download their toolchain, you'd think they could at least let you assign symbolic names of your choosing to the objects.
  • The tools are orthogonal but uh, fine grained. So, to bring up a new instance and log into it, you do (1) start the instance with ec2-run-instances (2) run ec2-get-console-output to see if it's booted and to get the SSH public key [repeat as necessary] (3) run ec2-describe-instances to get the domain name for the machine so you can log in (4) ssh in.
  • The default images are fairly minimal: no Emacs, no compiler, no debugger, etc. Now, they have yum, so you can install this stuff easily, but this brings us to...
  • The images don't have any persistent state. So, if you install Emacs, and shutdown the instance, it's back to the initial state when you start it again. And since you pay by the operating hour even if the machine is idle, you don't want to leave the machine running all the time. Amazon does provide a storage service (actually, two, S3 and EBS), but you still need to do some work on a machine-by-machine basis to make it connect automatically.
  • Amazon does let you take a running machine and make a new image out of it, but the process is pretty slow, so what ends up happening is you get the machine in the state you think you want it, pickle the image, and then next time you boot it you realize you forgot something. I repeated this a few times before I got an image I liked.

This probably all works OK as a replacement for your own data center where you would need to absorb all the installation cost anyway, but if what you need is a temporary pile of computrons for a single compute job, EC2 isn't that great a match. It'll get the job done but the overhead is awful high.

2 Comments

I've had similar issues with using EC2 to compare fuzz testing tools. I ended up writing a perl script to launch EC2 instances, poll the instances to see if they had come up, grab the DNS name if so, and finally ssh in and run a setup script with the appropriate parameters. Took a little hacking to get right, but the script has saved me a lot of headache since.

The script uses the Net::Amazon::EC2 CPAN module. Warning: installing this via CPAN took me forever due to tons of dependencies.

You can see the script here:
http://catchconv.cvs.sourceforge.net/viewvc/catchconv/valgrind-catchconv/catchconv/tests/ec2-command.pl?view=markup

It's pretty specialized to my application but maybe it will get the idea across. If you prefer something other than Perl, there are libraries for other languages as well.

That first sentence would read better with a slight change:

I've got a reasonably large computation job I need to do, bigger than I can conveniently do on my own hardware, and so naturally I thought EC2.

Leave a comment