I needed a disk that is around 1 TB for testing on Windows 2008, and noticed that EC2 Extra Large Instance (API name m1.xlarge) satisfies that requirement. But after launching it via AWS Management Console and remote into the server, I noticed I only got 30 GB, far less than the 1690 GB that was promised. The ensuing search convinced me that I needed to use Amazon EC2 API Tools, which is a set of command line tools available for download. I’ve done that before but had to search again because it is a while ago. This time I got a bit smarter, I took some notes!
1. Download and setup the command line tools:
a. $PATH needs to have path to ec2 command line bin
b. Recreated my X.509 Certificate and private key pair. This is done via AWS Management Console -> Account (link in the middle of the top line) -> Security Credentials
c. Setup the certificate and private key pair environmental variables
d. Configure and setup $JAVA_HOME sine the tools need Java
2. Browse through AWS Management Console and copy down the AMI ID you are interested in
a. 3 things to filter: Image source and type, Operating System, ad-hoc string filtering. In my case, I did “All Images”, “Windows”, and “2008”. I am interested in ami-d9e40db0
b. Inside the AWS Management Console web interface, once the AMI is selected, a bottom pane will display some metadata. For disk size, pay attention to Block Devices. In my case, it says “Block Devices: /dev/sda1=snap-289c2740:30:true”. I’d like that 30 to be 1690, the size of “Extra Large Instance”. For that, you will have to do it via the command line.
Alternatively, we can get that infor via command line:
3. So I did:
ec2-run-instances ami-d9e40db0 --b "/dev/sda1=snap-289c2740:1690:true" -g ec2windows -k HaidongKey
and got the message below:
Client.InvalidParameterValue: The requested instance type's architecture (i386) does not match the architecture in the manifest for ami-d9e40db0 (x86_64)
Thanks to web search, it turns out I needed to specify the type m1.xlarge:
haidong@haidong-laptop ~ $ ec2-run-instances ami-d9e40db0 --b "/dev/sda1=snap-289c2740:1290:true" -g ec2windows -t m1.xlarge -k HaidongKey RESERVATION r-87856fed 436613090425 ec2windows INSTANCE i-30ae415d ami-d9e40db0 pending 0 m1.xlarge 2010-10-09T04:36:37+0000 us-east-1a windows monitoring-disabled ebs hvm
But I was not out of the woods yet. See below:
haidong@haidong-laptop ~ $ ec2-describe-instances RESERVATION r-87856fed 436613090425 ec2windows INSTANCE i-30ae415d ami-d9e40db0 terminated 0 m1.xlarge 2010-10-09T04:36:37+0000 us-east-1a windows monitoring-disabled ebs hvm
I tried various ways before I decided to ask on Amazon’s cloud computing forum, and got it answered in an hour or so. It turns out for the EBS volume the maximum is 1024.
So I tried this:
ec2-run-instances ami-d9e40db0 --b "/dev/sda1=snap-289c2740:1000:true" -g ec2windows -t m1.xlarge -k HaidongKey
And it worked:
haidong@haidong-laptop ~ $ ec2-describe-instances RESERVATION r-fd639397 436613090425 ec2windows INSTANCE i-bc23d2d1 ami-d9e40db0 ec2-184-72-199-184.compute-1.amazonaws.com ip-10-122-87-151.ec2.internal running HaidongKey 0 m1.xlarge 2010-10-12T01:40:31+0000 us-east-1a windows monitoring-disabled 184.108.40.206 10.122.87.151 ebs hvm BLOCKDEVICE /dev/sda1 vol-4a8d8923 2010-10-12T01:40:36.000Z
It takes a few minutes to get Administrator’s password. Unlike the message provided at AWA Management Console web interface, you get the message below before it is ready:
haidong@haidong-laptop ~ $ ec2-get-password i-bc23d2d1 -k HaidongKey_unix.pem No <password> element was found for this instance.
After I got the password:
haidong@haidong-laptop ~ $ ec2-get-password i-bc23d2d1 -k HaidongKey_unix.pem E)yX=nTX!D
and logged in, the disk still shows as 30 G. Got to go to disk manager in Windows to mount it.
Hope this helps somebody. I certainly will know what I need to do next time.