My go at deploying to the cloud, EC2. It’s not *that* easy

I don’t have much server background, and probably its a lot easier to set up your servers with amazon EC2 than setting them up yourself or at other hosting solutions. I don’t care, it really annoys me that everybody claims how easy it is, showing you how to launch an instance in a minute. Yes, thats really easy, but you quit too abruptly. Nobody wants to set up an instance, then terminate it and lose everything you did on that instance. I say, never press terminate, you will lose every change from the last ami save. You are warned, be prepared or waste a lot of time.

Read on for links an tips for the whole cycle of launching, changing, saving and registering AMI. Everybody deploying to EC2 really have to do all this as a part of setting everything up, being prepared to launch more instances of the same kind.

If you launch an instance without knowing how to save and register AMIs, save yourself a lot of time (and a few pennies), by not doing a lot of work you might lose. If you do a lot of work, don’t press terminate, it’s not the same as a shutdown of your computer. You have to look at it as an ISO image of files, if you read it, work with the content, you’ll have to create a new ISO image to burn on your CD to keep the changes. At page 26 in the ElasticFox it says “Bundling a Linux/UNIX instance requires the use of the AMI tools”. OK, as you probably understand, I’m burn.

I am now successfully using both ec2-api-command-line-tools, elasticfox and amazons web console.

Ok, so what is the minimum need to get a small server running ubuntu and a mysql database?

  • EC2 for your server and database
  • S3 for storing your AMIs and register them
  • EBS is optional, but you should set one up as a safety-net, replicating your data.
  • both the ec2 and ami command line tools.

My links, tips and references.

The ec2 api command line tool:

ElasticFox

  • Amazon ElasticFox pdf tutorial
  • If you’re using the alestic ubuntu images below, remember to change “SSH user” to ‘ubuntu’, from the Tools menu in ElasticFox (icon top-right)

EBS to replicate your data

Finding ubuntu EC2 AMIs:

SAVING AMIs

First, make sure you have a bucket in S3 for storing the your new ami. I use S3 Firefox Organizer

mirror=http://us.ec2.archive.ubuntu.com/ubuntu/
printf "%s\n%s\n" "deb ${mirror} karmic multiverse" \
"deb-src ${mirror} karmic main" |
sudo tee /etc/apt/sources.list.d/multiverse.list
sudo apt-get update && sudo apt-get install ec2-ami-tools

I struggled a lot with sudo, but found the solution mentioned above, at here at google groups

Now you should be all set to launch a new instance based on that new AMI of yours! Break a leg!

About Ole Morten Amundsen

Developer, programmer, entrepreneur. Java, .Net, ruby, rails, agile, lean. Opinionated enthusiast!
This entry was posted in agile and tagged , , , , , , , , . Bookmark the permalink.

7 Responses to My go at deploying to the cloud, EC2. It’s not *that* easy

  1. Pingback: My go at deploying to the cloud, EC2. It’s not *that* easy › ec2base

  2. Hi Ole,

    Just to let you know that we are indexing your AMIs in our site. You can claim the images and update the information about them and about yourself.

    http://thecloudmarket.com/owner/958157752565–ole-morten-amundsen

    Hope you find it useful!

  3. ascerieerut says:

    Great blogpost, great looking blog, added it to my favs!

  4. Michael L says:

    Hi Ole,

    I really like your image. Is there a way to use it in US-East Region?

    thanks,
    Michael L

  5. Ole Morten says:

    Actually, I’m experiencing the ubuntu karmic koala as really slow. It’s the most fun to try the newest, but not always the best, why do I never learn that? I’ll create a performance test for my app and then redo the performance test when I’ve come around to switching to jaunty or a LTS version. I’ll post the results on my blog, of course.

    I’m sorry for avoiding to answer your question.

  6. Michael L says:

    Think 8.04 is better?
    I’m putting together RabbitMQ, Cassandra 0.6 and RoR for a project.

    What about Karmik Koala is slow? Network latency? IO?

    Also, what do think about booting AMI from EBS? Amazon just opened it up. I feel a lot safer doing that, plus I read that EBS has much more predictable latency than S3.

  7. Ole Morten says:

    I haven’t got around to do it yet (functionality over performance, we’re in pilot), but yes, I would guess 8.04 is better! A friend of mine installed karmic koala on his laptop and it was really slow (the kinda slow where you wait for the cursor to follow your keystrokes). It improved drastically when reinstalling 9.04.

    About EBS. That’s the way I work with my VMWare virtual machines. It’s great! I think the S3 was pretty good too, though.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s