Manav Gupta

Thoughts on Cloud Computing, Service Managment and more

Amazon EC2 and Elasticfox

leave a comment »

I signed up to Amazon Elastic Compute Cloud, and had one of the best experiences of signing up to use a free service of all time. Sign-up is painless especially for customers with an existing Amazon account (doesn’t matter whether it is on .com, .uk or .ca).

The sign-up process then confirms a credit card (again, Amazon had more than 1 credit card for me in their records), billing address, and then asks for a telephone number for verification. The verification service then provides you an authentication number and calls the telephone number you supplied, asking you to enter the verification code when it calls. Fantastic!

Once the account is created, Amazon asks you to verify your selection, and sends a verification email. And not just one. My inbox was cluttered immediately:

Amazon EC2 - emails on signup

You can manage your account online by visiting: Here’s the starting account summary:

Amazon EC2 Account Activity Summary - On Startup


Once your account is setup, what better way to manage your account than a plugin for Firefox? Enter Elasticfox, downloadable from Amazon. Download the plugin, and use the Firefox menu to fire it up. The first time the plugin is invoked, it asks for:

  1. Account Name – Text descriptor to identify your Amazon Account
  2. Access Key – Your Amazon Access Key. You include it in each request, so it’s not a secret.
  3. Secret Key – Each Access Key ID has a Secret Access Key associated with it. This key is just a long string of characters (and not a file) that you use to calculate the digital signature that you include in the request. Your Secret Access Key is a secret, and only you and AWS should have it. Don’t e-mail it to anyone, include it any AWS requests, or post it on the AWS Discussion Forums. No authorized person from AWS will ever ask for your Secret Access Key.

For more information on EC2 Access Keys, follow this link.

Once you’ve added your access keys to Elasticfox, you need an Amazon EC2 key pair to launch *nix/Windows instance.The key pair ensures that only you have access to the instance. Click on “KeyPairs” to create a new key pair. Note, you may have to restart Firefox since the plugin doesn’t seem to establish connection to EC2 sometimes:

Create Key Pairs to access Amazon EC2 instances in Elasticfox

Once the keypair has been created, Elasticfox asks you save the .pem file. Select a secure location and remember it; for this will be used later. You can also see all the keys you have generated on your EC2 console.

At this point, Elasticfox will have established a connection and will update the available images under the “Images” tab:

List of available Amazon EC2 instances in Elasticfox

Next, it’s time to setup a Security Group, which is similar to setting up firewall rules to restrict access to specific ports on your EC2 instances. Create a test group by navigating to the “Security Groups” tab in Elasticfox:

Creating a Security Group in Elasticfox

In the above case, we have created a Security Group called “Test Group” with SSH and RDP enabled. Once the group is created, notice the “source CIDR” shows your host address / netmask. So all hosts on your subnet will be able to SSH (with correct credentials.

With that done, time now to select an AMI so that we are within the free AWS Tier. Selecting exactly which AMI to choose from the long list was more difficult that I imagined. Defty Googling resulted in a few options:

Using an Ubuntu image and resizing it down to 10 GB (the free AWS tier) as suggested here

Using test builds for Ubuntu 10.04 or 10.10 from here and here

Since I wasn’t keen on messing with 10.04, I chose to go with Ubuntu 10.10, and found the official page for that AMI.  Here are the key details:

Details of Ubuntu 10.10 AMI

Armed with that info, I boldly decided to search for that AMI on the list of images in Elasticfox. And lo!

Ubuntu 10.10 image in Elasticfox Images search

While official page clearly states this AMI is designed to run on t1.micro, m1.small and c1.medium instance sizes, however; Elasticfox wouldn’t show me an option to run the AMI as a micro instance:

Elasticfox: No option to run Ubuntu instance as t1.micro

Thinking the AWS Console might allow for micro instance, when I login to the console, I see the same thing, after selecting the AMI:

Step 1 - Select the desired AMI

Step 2 - Select Instance type for our AMI

This is where I realised I was using the wrong AMI. ami-­1a837773 is instance-backed, but to launch a micro instance we need to select AMI which is EBS backed. Going back to the page where Ubuntu 10.10 server instances are listed, I found the correct AMI ID is: ami-508c7839

However, even with an EBS-backed AMI, Elasticfox doesn’t show me an option to launch a micro instance, which AWS console allows me to do. I happily selected instance type “t1.micro” and accepted default options for Kernel and RAM disk ID. I added a couple of tags to remind me of this instance, selected the key/value pair I had created earlier, and added this instance to the Security Group I had created. AWS is now ready to launch this instance:

AWS - Ready to launch instance

Now then, once the instance is launched and running, Elasticfox will show us its status as “running”. Right click and select “Connect to Instance”. You may get the following error message:

Please login as the ubuntu user rather than root user.

Go to “Tools” in Elasticfox, and change the SSH user to “ubuntu”:

Elasticfox: Change SSH user from "root" to "ubuntu"

You will then get a terminal window (if you are running Elaticfox on Linux. If not, then change the “SSH command” to point to PuTTy on Windows). You’re now up and running!

Written by Manav Gupta

December 27, 2010 at 2:55 am

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: