Marco Serafini


COMPSCI 677 - Spring 20

Course homepage

Homework 3

This is as individual assignment. It is due on March 30th, 11.59 pm

This is a hands-on homework, and The main goal of this homework is to become faimilar with the cloud computing by using Amazon’s Elastic Compute Cloud (EC2) platform.

The exercise involves a series of steps. Please follow the instructions carefully to execute these steps. Each step provides familiarity with a certain functionality provided by EC2.

You can do this homework in two ways: blindly type the commands we have listed below and trivially complete all the steps of the homework, or use this homework to dig deeper into various features of EC2 and become familiar with cloud computing. The latter is not required but it will give you extra points.

You will need security credentials (certificates and keys) to carry out the assignment.

Please remember that Amazon bills for actual cloud usage – in your case, you will use a free student account with a certain usage limit, so be very careful with the resources you use. If you are unclear on any aspect, ask us for clarifications.

Step 0: Obtain EC2 credentials

Step 1: Install AWS CLI tools

    "Regions": [
            "Endpoint": "",
            "RegionName": "eu-north-1",
            "OptInStatus": "opt-in-not-required"
            "Endpoint": "",
            "RegionName": "ap-south-1",
            "OptInStatus": "opt-in-not-required"

Step 2: Create an Instance and record its approximate starting time

In this step, you will start up a new Linux server on the EC2 cloud. A server is refered to as an EC2 instance. To start a server, you need to specify a machine image (think of it as a boot disk with a virtual machine). Machine images are called AMI (amazon machine image) in EC2 terminology.

One can create an EC2 instance by specifying an ami-id. But before you create an instance you need to know what kind of ami to use. This is how you would do it:

Step 3: ssh into the newly created instance

Step 4: Install an application

You can install software on ec2 instances just like on any other linux machine:

sudo yum install -y perl emacs

Step 5: Create a new Image from running instance. Record the time of each operation

Now we can take our customized server and create a new machine image using its disk state. This will allow us to create a new future instance with these customized applications preinstalled.

If successful, this returns a new AMI, note down this ami-id.

Step 6: Create an instance of this new image and terminate all your instances. Record time of each operation

Step 7: Compute the cost of this entire operation

Use Amazon’s pricing policy to compute the cost of all operations you performed in this assignment. Note which instances you used and for how much time. Then search how much they cost per unit of time (On Demand pricing) and estimate how much you have spent in total. Factor in storage costs: unless your instance has local storage, its filesystem will be stored by an enternal storage system (EBS) that incurs a cost even if the instance is off. Then consider other costs such as out of network data transfers, S3 operations, etc.

Step 8: Cleaning Up

Be sure to terminate only your instances; NOTE that Amazon gives each student a certain amount of credits and if you do not terminate your cloud servers, they will continue to incur usage changes and use up your entire usage limit.

What to hand in

Please turn in a short (1-2 page) report with your observations and output from the key steps in this assignment. You will also required to provide an estimate (approximate estimates are OK) on how much your EC2 operations will cost the instructor. Use Amazon’s pricing policy and monitoring data to compute your estimates.

In your report, you should clearly mention which EC2 api commands you tried, and All the AMI and instance IDs that you created.