Lecture 2: IaaS Cloud and Amazon EC2 Sambit Sahu, IBM Research
2
Recap from Lecture 1
Different Cloud Offerings: A Layered Perspective
3
§ Higher the stack, less control but more automation for user
§ Lower the stack, more control but more responsibility for user
4
User launches request instanceàa list of prebuilt stack is provided
§ AWS shows a list of available pre-built base software stack (called Virtual Appliances) user may request to add to the machine
5
User can choose the resource size (CPU, mem choices)
§ Instance request wizard guides through resource choices 6
User specifies security/access configurations
7
AWS provisions an instance and returns user credentials
8
This week: IaaS Cloud and Amazon EC2
§ API and CLI based access
– http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
§ AWS access using Java SDK and CLI
§ Learn how to use EC2 and S3 as example services
§ Breaking down the steps – how AWS provided on-demand resource § Create a web server and deploy your web application using AWS
§ How to use on-demand infrastructure for regular applications?
9
AWS CLI
CLI Setup
§ Allows you to interact with AWS Services/APIs using command line
§ Install AWS CLI on your machine
– Mac OS example: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
Examples
§ Create an AWS instance using CLI:
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-tutorial.html
§ S3 for backup: https://aws.amazon.com/getting-started/tutorials/backup-to-s3-cli/
10
Deploy Web App
§ https://docs.aws.amazon.com/gettingstarted/latest/deploy/awsgsg-deploy.pdf
§ Services you will use – Elastic Bean Stalk
– DynamoDB – SNS
– IAM
– Node app
11
Amazon EC2 Programming
§ Amazon EC2 SDK for java on Eclipse
§ https://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/setup-install.html – http://aws.amazon.com/eclipse/
– A simple tutorial http://media.amazonwebservices.com/videos/eclipse-java-sdk-
video.html
§ AWS Python SDK: Boto3
– https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html
12
Reference Material
§ Installing AWS SDK on Eclipse http://d36cz9buwru1tt.cloudfront.net/videos/eclipse-java-sdk-video.html
§ Amazon Elastic Compute Cloud (EC2) Getting Started Guide § Amazon Elastic Compute Cloud (EC2) User Guide
§ Programming Amazon EC2
13
Deconstructing Amazon EC2 request machine API
§ User goes to Amazon EC2 portal and specifies desired parameters for a machine – Resource: CPU, mem, disk
– Stack: OS and possibly with additional software
§ Amazon AWS Cloud manager (resource pool manager) provisions the user request – Finds appropriate physical resource
– Dispatches the request to virtualization manager on the identified resource
– Cloud Manager invokes EC2 API to provisions the request
§ Virtualization manager on physical server
– Copies the pre-built software stack (virtual appliance)
– Provisions a guest VM and configures parameters (IP address, access rules,…) at run/boot time
§ Cloud manager returns login credentials to user
2. Cloud manager processes request
3. Identifies physical server where to instantiate
4. Virtualization mgr on the server launches a VM, copies virtual appliance and boots the VM with appropriate run-time configuration
Physical Resource Pool
1. User requests a machine with a desired Software stack, access rules
6. User is provided instance details
5. Login credentials for user
para
14
Papers for Next Week
§ Reading List:
– Google File System (GSF):
https://static.googleusercontent.com/media/research.google.com/en//archive/gfs- sosp2003.pdf
§ Reference Materials
– AWS in Action Chapter 3-6
15