Deploying into ‘The Cloud’, sounds fancy doesn’t it?Amazon’s EC2 service has some great tools out there to manage your bits and bytes, so let me take you through the basics of getting a server up and running on EC2.
First lets get some of the concepts out of the way. An EC2 instance is basically a virtual machine that is running somewhere on Amazon’s hardware (that hardware is basically ‘The Cloud’ here). An instance can run any of the amazon supported operating systems, and is based off an AMI (Amazon Machine Image). Think of an AMI as a clone of a configured system, including all its disk resources and installed software, and you will not be far off.
Amazon has a comprehensive list of template AMI’s that you can use, or you can roll your own AMI (more on that in another blog post). Each instance you start will have an OS partition and a data partition by default, but keep in mind that if you terminate an instance everything that came with it (including the data partition) will be gone. That leads to the next topic, S3 storage.
S3 is how Amazon allows you to persist data (keep it around longer than a single running server instance, or run backups to it directly, there are a whole host of S3 associated 3rd party tools that I will not get into here). In our use case here, we will be using S3 to store any persistent drive volumes we want. You can create a volume of any size up to 1TB, and you can have up to 5 attached to a given instance.
Volumes are stored in an S3 Bucket (think: folder) associated to your account. Each volume is a block level device, which means you can treat it as a hard drive (for example, you can attach 5 volumes and use software RAID 5 to get a very large protected drive). Volumes are very nice, as you can attach and detach them from any of your running instances as-needed, you can snapshot a volume (with all its associated data), and you can even create a new volume based on a snapshot (this allows you to create a larger volume with all your data already in place). This part was really impressive to me, as it really makes hardware concerns something that you don’t have to worry about.
So now you know the lingo, you are ready to sign up for an EC2 account. This step requires a credit card, but don’t fret, even after hours of testing and a few false starts I still had enough change in my pocket to pay for all the charges I had racked up. You can sign up at Amazon’s EC2 page You will need to take note of your username and password obviously, but for the management tools you will also need a few other pieces. Under ‘Your Account’, go to ‘Access Identifiers’. You will need to save your Access key ID,and your secret access key (click the show button to display it). Save those somewhere on your system that is pretty secure, those are the keys to your EC2 castle.
Now lets get some of those admin tools I spoke of. First off, the simplest ones to use are based on Firefox as plugins. If you are not using firefox yet, go get it, then grab these tools:
Elasticfox – This will be your primary management tool for your EC2 instances.

S3 Organizer – This tool allows you to manage all of your storage buckets. This is important if you want any of your data to stay around longer than a running EC2 instance.

When you first fire up Elasticfox, it will ask you for your account name (username you signed up with), access key, and your secret access key. Add those, and you are ready to go. First thing you should do is create a Key Pair. Go to the key pairs tab, click the green key icon, and take the default key pair name. This key pair will allow you to retrieve passwords that are automatically setup on your instances (a rather important part), so don’t skip this step. Save this key to your system in a place you can locate it easily. Now we are ready to get an instance running!
Go to the ‘Images’ tab, this is where the Amazon pre-built system images and the community contributed images live. Look for a windows platform instance owned by Amazon, the manifest should look something like: /Server2003r2-i386-Win-v1.{something}.manifest.xml (currently 1.05, ami ID ami-1929ce70). Right click on that ami, choose ‘Launch instance(s) of this AMI’, choose the key pair you just created, then choose an availability zone (you will need this in a minute here).There are obviously many other options here, but they are not currently needed for this deployment. Click ‘Launch’ then sit back a minute while Amazon allocates resources and fires up your first virtual machine instance (watch the instances tab to monitor progress).
After the instance is running, some automated Amazon scripts get run on there to set its host name and IP, and assign an administrator password. If you right click your instance, and choose show console output, you can see when the password gets assigned (the console will be blank until the initial scripts get run).
Once you see something about the password in the console, close the console, right click on the instance, and choose ‘Get Administrator Password’. You may be asked to locate your certificate file you saved earlier when creating a key pair, then you will see the password in a javascript popup. Write that down, then give your instance another right click, and choose ‘Copy public DNS name to clipboard’. Open your favorite RDP client, paste in the address, and click connect.
You may need to first open the Amazon firewall to allow RDP connections from your address, to do this go to the ‘Security Groups’ tab (you will only have a default group right now), and on the right side choose the green checkmark, choose ‘RDP; choose ‘host’, then click the button to get your host address. Click add, and you should be able to RDP in using the administrator password that you wrote down a minute ago.Congratulations, you now have a running EC2 instance that you can manage!
More to come in later posts on working with persistent volumes, backup strategy, creating your own AMI, and pitfalls and possibilities of running in the cloud.