In this article I’m going to give you a simple, step-by-step overview of how to create a Windows 2008 server image in Amazon’s Elastic Cloud Compute (EC2) infrastructure. Now I must admit I’d rather have found a good tutorial on The Internets or even in a book. Feel free to send me any I missed. My experience is they are either dated or about Linux and so on…
First, briefly why does one care about EC2? Well maybe you are buying into the whole cloud computing story which lets you cheaply out-source your computer hardware for amazingly cheap prices (staring around $0.20 / hour for a dedicated machine). That’s a great reason and Microsoft and Google have interesting plays there too.
Personally I just want a simpler way to create virtual machines. We’ll have full admin access over remote desktop to our system to install whatever we want. I’m putting Visual Studio 2010 Beta on mine to play around with that software without ’polluting’ my real system.
Here we go. If you don’t delay I suspect this would take you about 20 minutes from start to login! Subsequent virtual machines are much faster to create and launch because the can be based on pre-configured images.
1. Create an Account
Register for an Amazon Web Services account at http://aws.amazon.com/.
2. Enable EC2 Features
Enable Elastic Compute Cloud for your AWS account at http://aws.amazon.com/ec2/.
3. Launch a New Instance
Use the AWS Management Console to launch and manage your virtual images: http://aws.amazon.com/ec2/home. As the console says, choose “Launch Instance” under the “Getting Started” section. You will be presented with a list of pre-configured images. We’ll start with a stock Amazon Windows 2008 server image.
4. Choose a Base Image
Now you’ll be presented with a list of pre-configured virtual disk images. This time we’ll setup a 64-bit Windows 2008 Server (Data Center Edition). Just choose “select” out of the list below:
5. Use the Request Instances Wizard
Use the Request Instances Wizard to configure the newly created instance which includes configuring the security, choosing an encryption key, opening ports in the firewall, and kicking off the new instance. Below you’ll see the encryption key step – be sure to download the key pair as you’ll need it for retrieving the administrator password.
Here’s what you can expect for the review screen of the Request Instances Wizard. Press launch and you’re almost there.
7. Launching… (AKA Wait 5 Minutes)
After you launch you’re instance you’ll get a confirmation screen to
show you it’s being prepared and allow you to configure durable storage
and IP addresses (both entirely optional).
8. Back to the Management Console
Now if you choose “View your instances…” you’ll see that your instance is being prepared – it has a yellow pending status. This screen doesn’t always refresh on its own so use the refresh button in the upper right of the console (rather than your browser’s refresh button).
After a few minutes your instance with the yellow icon will turn green and be in the running state. Note that at first this really means booting up so you can’t get to it right away. Give it another minute or two…
10. Login Part 1: Getting the Credentials
Now you’ll want to login. Of course, the system was created with an administrator account which has a strong password. You’ll need to retrieve that password using the “Instance Actions -> Get Windows Admin Password” option.
11. Login Part 2: A Little Hasty
You’re probably excited to get this thing running and if you try right away you’ll get another message telling you to be patient and try again in a few minutes. Just keep trying.
12. Login Part 3: Using Private Key
Eventual the new system is up and running and you can get the password. The first step here is to pass in your encryption key from the wizard step before.
13. Login Part 4: Administrator Account and Password
Pass in the encryption keys and you’ll see the username and password (don’t get excited, I already changed the password!).
14. Login Part 5: Finding the Machine Address
When your instance starts, it’ll be given an Internet visible DNS name that you can use to connect via Remote Desktop. You’ll find it in several places. One of them is highlighted below. Note that this address changes as you start and stop your instance.
Now just fire up Remote Desktop, use the Administrator account and password from step 13 to log in. Now you have full access to your Windows 2008 machine. You can do with it what you will, install software, start serving web pages, etc.
16. A Word of Caution
If your intent is to run a web server, then let it run. But if you are just using this for your own purposes and don’t need it when you’re not logged in to the machine, be sure to return to the Management Console and stop the instance. You can alternatively do that by choosing “Shutdown” instead of logging out of your Remote Desktop instance.
I hope you found this walk-through helpful. I just learned most of this myself so I figured I’d blog it and everyone can learn from it.