Cloud Computing Labs: Infrastructure Exploration: Using AWS EC2 and S3

Due: April 6 (11:59pm)

The primary purpose of this assignment is to get familiar with the most popular Infrastructure-as-a-Service: Amazon Web Services. This assignment requires a lot of activities on the command line and some coding work.

Part 1: Accessing EC2 and S3 from the command line

Review the lecture about using AWS. Create your own AWS account. Note that a credit card will be used for creating the account. If you have registered AWS for the first time, you will get the free tier use of AWS for one year, which includes 750 hours of linux micro instance per month and 5GB S3 storage. Check AWS Free Tier benefits. If you have created the AWS account for more than one year, please contact me.

Now, answer the following questions:

Question 1.1 Have you successfully started an instance with command line? After the instance becomes stable, copy the output of the command "ec2-describe-instances instance_id" to the report.

Question 1.2 Use the boto APIs to implement a python function start_instances(num_instances), where the parameter num_instances is the number of instances you will be creating. This function will create a number of micro instances with the AMI ami-bba18dd2. It should wait until the state of the instances become "running", and then return the list of instances. Paste your code here.

Question 1.3 Write a python script that uses the boto APIs to find out all the files in the bucket "wsu2014", print out the contents in the files, and copy the files to your own bucket. Keep your bucket undeleted until we finish grading! Paste your code here.

Question 1.4 How much time did you spend on this task? Do you think it takes too much time?

Question 1.5 How useful is this task to your understanding of EC2 and S3?

Part 2: Instance Monitoring Program

In this task, you will implement a tool with Python to monitor the status of the instances you created. You will use the start_instances function to create 2 instances. The instances are passed to the monitoring tool. This monitoring tool will constantly (e.g., every 5 seconds) print out the CPU usage of each instance. Note that you can execute commands remotely via ssh, like

ssh -i ~/.ec2/id_rsa-gsg-keypair "top -bn1 | grep Cpu"
The output of the remote command execution will be displayed to you. In python code, you can execute the command line by calling the function os.popen (check Python references to find out the detail) and the command output can be captured. The command "top -bn1 | grep Cpu" will get the the line of the command "top" output that contains Cpu information. You will need to parse the line to find the Cpu usage (the percentage). You can also use some third party ssh python library such as Paramiko library for ssh-related operations.

After you implement this small tool, please answer the following questions:

Question 2.1 Paste your short script here.

Question 2.2 How much time did you spend on this task? Do you think it takes too much time?

Question 2.3 How useful is this task to your understanding of EC2 and boto programming?

Final Survey Questions

Question 3.1 Your level of interest in this lab exercise (high, average, low);

Question 3.2 How challenging is this lab exercise? (high, average, low);

Question 3.3 How valuable is this lab as a part of the course (high, average, low);

Question 3.4 Are the supporting materials and lectures helpful for you to finish the project? (very helpful, somewhat helpful, not helpful);

Question 3.5 How much time in total did you spend in completing the lab exercise;

Quertion 3.6 Do you feel confident on applying the skills learned in the lab to solve other problems with AWS EC2 and S3?


Turn in the report that answers all the questions to the Pilot project submission before April 6 11:59pm. Also print out a hardcopy and turn in on April 7 in the class.

Make sure that you have terminated all instances after finishing your work! This can be easily done with the AWS web console.

This page, first created: March 26 2014; last updated: March 26 2014