To get started using Amazon’s EC2 and S3 (simple storage service) service, check out two excellent blogs by Thorsten Franz and Martin English that cover the SAP system installation and EC2 configuration in great detail.
New Storage – Elastic Block Storage (EBS)
Amazon started with S3 but added EBS some time ago. See Chris Kernaghan’s blog about EBS based images for a more detailed description. EBS based AMIs, for example, have 30GB of root storage vs. 10GB under the old system. Futhermore, EBS based volumes attached to an instance remain available (even after terminating your instance), keeping any changes you made thus allowing you to reattach the volume the next time the image is started.
Doing some research, I read that you can change the size of the boot disk that an AMI starts up with. I found this intriguing since that would allow me to make the C:\ drive large enough to contain a standard CE 7.2 installation without needing a separate D:\ volume. I realize that for larger systems separate volumes for the DB and swap files are recommended but this was a small workshop instance so simplicity trumped performance and flexibility. A single drive would also make AMI and snapshot management easier. Furthermore, by having a single drive based AMI I will not have to worry about what availability zone (US-EAST has zones ‘a’ through ‘d’ ) my ‘D:\’ volume is in – both the AMI instance and volume must be in the same availability zone.
Eager to try this, I searched for a quite a while in the AWS GUI console for this functionality. No luck. It turns out I would have to install and use the command line tools to do this – thus started phase two of my EC2 experience.
Setting up the command line tools
First step was to download the API command line tools and getting the proper JDK (1.6) installed. I stored all my files in the the ‘C:\aws’ folder. Next, create a batch file (i.e. aws_env.bat) to setup the environment. You will also need the private key and certificate you received when you signed up for Amazon AWS service. Here’s my batch file:
REM Paths to the primary key and certificate from Amazon
After you have created the batch file and executed it you can perform a quick ‘smoke test’ to ensure your environment is configured properly by executing the command ec2-describe-regions. Your output should look something like this.
Starting an AMI
In order to start AMIs and retrieve the initial Administrator password you have to create a keypair. This is easily done using the ec2-add-keypair command. Notice that the name of the keypair does not have a dot extension. Copy the text, including the ‘Begin…’ and ‘End…’ lines into a text file named the same as your keypair. If you followed the DOS environment setup above, put that file into the ‘cert’ directory.
Next, after having browsed the available AMIs using the graphical AWS console, start the AMI of your choice and increase the boot disk size to 100GB. Don’t forget to specify the keypair you created earlier. Side note: If you don’t specify the keypair your instance will still start but you will be unable to retrieve the administrator password, don’t ask me how i I know. Take note of the instance ID that the command returns, you will need that ID for subsequent commands when referring to your instance. Note: The AMI i used for this example is Windows Server 2008 64bit based machine image.
C:\aws\ec2>ec2-run-instances ami-45c22e2c -b “/dev/sda1=:100” -k mykeypair_test
Periodically, get the output from the console to see when the system is ready using the ec2-get-console-output command with your instance ID as the parameter.
Next, get the Administrator password by issuing the ec2-get-password command, specifying the keypair you used to start the instance.
C:\aws\ec2>ec2-get-password i-1ff36074 -k c:\aws\ec2\cert\mykeypair_test
At this point, you are ready to logon on to your instance using remote desktop to perform the last step before you can use your new instance.
Although we specified a 100GB startup disk, only the default 30GB are initialized. No problem, simply right click on the disk and select ‘Extend Volume’ and shortly afterwards your ‘Disk 0’ should look like this.
IE lock-down. Amazon has IE locked down so tight it’s basically useless. First thing to do is download Firefox, mostly for the S3Fox Organizer plugin. This is easier said then done. First, we need to change some IE preferences (Tools->Options->Security), click on ‘Custom Level’. Under the ‘Downloads’ section, enable ‘Automatic prompting for file downloads’ as well as ‘File downloads’. This will allow you to download items, namely the Firefox installer.
When starting an AMI instance you can use a ‘spot request’ (think of it as demand based pricing) or the normal way. Spot pricing is usually significantly cheaper but has the drawback that you cannot ‘pause’ your running instance. The capability to suspend a running instance, stopping the billing clock but preserving all the work you have done, is another benefit of the EBS base images.
If you are just the least bit curious and interested in test driving AWS I encourage you to sign up. Charges are very reasonable and it’s great fun learning something new that is quickly changing the IT landscape.