0% found this document useful (0 votes)
19 views21 pages

Cloud Computing - Manual

The document provides step-by-step instructions for completing several cloud computing labs using Amazon Web Services (AWS): 1. Launching virtual Windows and Linux machines using EC2 and connecting to them remotely. 2. Hosting a basic webpage by installing HTTP server on a Linux EC2 instance. 3. Creating multiple EC2 instances and configuring a load balancer in AWS to distribute traffic between the instances. 4. Setting up a virtual private cloud (VPC) with subnets and routing tables to allow access to instances launched within the VPC.

Uploaded by

mohammed ishtiaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views21 pages

Cloud Computing - Manual

The document provides step-by-step instructions for completing several cloud computing labs using Amazon Web Services (AWS): 1. Launching virtual Windows and Linux machines using EC2 and connecting to them remotely. 2. Hosting a basic webpage by installing HTTP server on a Linux EC2 instance. 3. Creating multiple EC2 instances and configuring a load balancer in AWS to distribute traffic between the instances. 4. Setting up a virtual private cloud (VPC) with subnets and routing tables to allow access to instances launched within the VPC.

Uploaded by

mohammed ishtiaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

CLOUD COMPUTING – LAB MANUAL

01. Launching virtual Windows machine using EC2 in AWS.

➢ Sign in to the AWS console.


➢ Search for EC2 in the search bar.
➢ Click on Launch instance.
➢ Give a name to your instance.
➢ Select Windows machine.
➢ Create a New Key Pair , while creating a new key pair an .pem file will
automatically downloads.
➢ Leave the default settings as it is.
➢ Click on Launch Instance.
➢ Wait till the instance state to be running.
➢ Select the instance that you’ve created and click on connect.
➢ Click on RDP client and click on download remote desktop file a .rdp file
will be download.
➢ Click on get password.
➢ Click in upload private key file & select the downloaded .pem file & click
on decrypt password.
➢ Copy the provided password.
➢ Open the downloaded .rdp file , click on connect and paste the password
and click on Yes.
“Now you’ve successfully launched a virtual windows machine”
➢ After finishing your given task Delete/Terminate the instance.

D.A.C.G GOVT. POLYTECHNIC, CKM 1


CLOUD COMPUTING – LAB MANUAL

02. Launching virtual Linux machine using EC2 in AWS.

➢ Before Launching an instance go to browser and search putty.org and


download putty.exe(the SSH & telnet client) & puttygen.exe(RSA &
DSA key generation utility) according to system requirements.
➢ Sign in to the AWS console.
➢ Search for EC2 in the search bar.
➢ Click on Launch instance.
➢ Give a name to your instance.
➢ Select Amazon Linux Machine.
➢ Create a new key pair.
➢ Leave the default settings.
➢ Click on launch instance.
➢ Select the instance that you’ve created, Click on connect → in SSH client
copy the Example EC2 username.
➢ Open puttygen.exe - click on load → select the downloaded key pair file
– click on open → click on save private key → click on yes → give a
name to the file and save it.
➢ Open putty.exe → paste the username → In left side menu click on SSH
→ Click on Auth → Click on Credentials → Click on browse in private
key for authentication → Select the ppk file that you’ve saved → Click
open
“Now you’ve successfully launched a virtual windows machine.”
➢ After finishing your given task Delete/Terminate the instance.

D.A.C.G GOVT. POLYTECHNIC, CKM 2


CLOUD COMPUTING – LAB MANUAL

03. Webhosting in virtual Linux machine using EC2 in AWS.

➢ Before Launching an instance go to browser and search putty.org and


download putty.exe(the SSH & telnet client) & puttygen.exe(RSA &
DSA key generation utility) according to system requirements.
➢ Sign in to the AWS console.
➢ Search for EC2 in the search bar.
➢ Click on Launch instance.
➢ Give a name to your instance.
➢ Select Amazon Linux Machine.
➢ Create a new key pair.
➢ Leave the default settings.
➢ Click on launch instance.
➢ Select the instance that you’ve created, Click on connect – in SSH client
copy the Example EC2 username.
➢ Open puttygen.exe → click on load → select the downloaded key pair
file → click on open → click on save private key → click on yes →
give a name to the file and save it.
➢ Open putty.exe → paste the username → In left side click on SSH →
Click on Auth → Click on Credentials → Click on browse in private key
for authentication → Select the ppk file that you’ve saved → Click open
➢ In the Linux command window type the commands.
• sudo su → press Enter.
• yum update -y → press Enter.
• yum install httpd on → press Enter.
• cd /var/www/html → press Enter.
• vi index.html → press Enter → press i → type My Sample
Webpage → press (Esc , : , wq , Enter ) to save the file.
• service httpd start → press Enter.
D.A.C.G GOVT. POLYTECHNIC, CKM 3
CLOUD COMPUTING – LAB MANUAL

• chkconfig httpd on → press Enter.


➢ Go back to the aws console go to EC2 and select your instance & copy the
IPV4 public Address and paste it in the New Tab. “If you’ve followed the
steps perfectly the sample webpage will be hosts”
“Now you’ve successfully hosted a webpage using virtual linux machine”
➢ After finishing your given task Delete/Terminate the instance.

D.A.C.G GOVT. POLYTECHNIC, CKM 4


CLOUD COMPUTING – LAB MANUAL

04. Webhosting using EC2 in AWS.

➢ Sign in to the AWS console.


➢ Search for EC2 in the search bar.
➢ Click on Launch instance.
➢ Give a name to your instance.
➢ Select Amazon Linux Machine.
➢ Create a new key pair.
➢ Create new security group → add new security rule Type = HTTP, Source
= Anywhere.
➢ Scroll down and click on Advance details.
➢ In the user data type this bootstrap script…

➢ Click on Launch Instance.


➢ Select the created instance and copy the IPV4 public address and paste it
in the New Tab . “If you’ve followed the steps perfectly the sample
webpage will be hosted”
“Now you’ve successfully hosted a webpage using EC2”
➢ After finishing your given task Delete/Terminate the instance.

D.A.C.G GOVT. POLYTECHNIC, CKM 5


CLOUD COMPUTING – LAB MANUAL

05. Create in AWS and configure Load Balancer in AWS.

➢ Sign in to the AWS console.


➢ Search for EC2 in the search bar.
➢ Create 3 instances. Follow the Steps…
➢ Click on Launch instance.
➢ Give a name to your instance example (Web1).
➢ Select Amazon Linux Machine.
➢ Create a new key pair example (lb-keypair).
➢ Create new security group → add new security rule Type = HTTP,
Source = Anywhere.
➢ Scroll down and click on Advance details.
➢ In the user data type this bootstrap script…

➢ Click on Launch Instance.


➢ Now create 2nd instance with different name (example Web2) , same key
pair , same security group and different user data as…..exapmle

D.A.C.G GOVT. POLYTECHNIC, CKM 6


CLOUD COMPUTING – LAB MANUAL

➢ Click on Launch Instance.


➢ Now create 3rd instance with different name (example Web3) , same key
pair , same security group and different user data as…..exapmle

➢ Click on Launch Instance.


➢ Now go to Load Balancer and click on create laodbalancer.
➢ Click on Classic Load Balancer.
➢ Name your Loadbalancer then click Next.
➢ Select the existing Security Group that you’ve created.

D.A.C.G GOVT. POLYTECHNIC, CKM 7


CLOUD COMPUTING – LAB MANUAL

➢ Configure health check – advance details


Response = 2 , Interval = 5 , Unhealthy = 2 , healthy = 2 Click on Next
➢ Add the 3 instances that you’ve created previously.
➢ Click on Create Load Balancer.
➢ After the Load balancer is created, Select the load balancer and copy the
DNS name.
➢ Paste the DNS name in new tab and press enter.
“If you’ve followed the steps perfectly the sample webpage will be hosted,
refresh the page it has to show different data’s”
“Now you’ve successfully configured the Load Balancer”
➢ After finishing your given task Delete/Terminate the instances and the
Load Balancer.

D.A.C.G GOVT. POLYTECHNIC, CKM 8


CLOUD COMPUTING – LAB MANUAL

06. Create & configure VPC.

➢ Sign in to the AWS console.


➢ Search for VPC in search bar of console.
➢ Click on Create VPC.
➢ Name your VPC → IPV4 = 10.0.0.0/16 → Click on Create VPC.
➢ Under Subnets → Create New Subnet → Select your created VPC →
Create 3 subnets → Name your subnet → select region → IPV4 =
10.0.1.0/24 (For 1st Subnet) → Add New Subnet → Name your subnet
→ select region → IPV4 = 10.0.2.0/24 (For 1st Subnet) → Add New
Subnet → Name your Subnet → select region → IPV4 = 10.0.3.0/24
→ Create Subnet.
➢ Under Internet Gateways → Click on Create Internet Gateway → Name
your Internet Gateway → Click on Create Internet Gateway.
➢ In the Internet Gateway list → Select the Internet Gateway You’ve created
→ Actions → Attach VPC → Select the VPC you’ve created → Click
on Attach VPC.
➢ Route Tables → Create Route Table → Name your Route table →
Select your VPC → Create Route Table.
➢ In the Route Table list select your Rote table → Under Routes → Edit
Routes → Add route → IPV4 = 0.0.0.0/0 → target = Internet Gateway
(Select your Internet Gateway) → Save Changes.
➢ In the Route Table list select your Route Table → Under Subnet
associations → Edit Subnet associations → select all 3 subnets you’ve
created → Click on Save Subnet associations.
➢ Search for EC2 in the search bar of console.
➢ Click on Launch instance → Give a name to your instance → Select
Amazon Linux Machine → Create a new key pair → Create new security
group → add new security rule Type = HTTP, Source = Anywhere →

D.A.C.G GOVT. POLYTECHNIC, CKM 9


CLOUD COMPUTING – LAB MANUAL

Scroll down and click on Advance details → In the user data type this
bootstrap script…

➢ Click on Launch Instance.


➢ Select the created instance and copy the IPV4 public address and paste it
in the New Tab .
“If you’ve followed the steps perfectly the sample webpage will be
hosted”.
➢ After finishing your task Delete/Terminate the instance, VPC , Route Table
& Internet Gateway.

D.A.C.G GOVT. POLYTECHNIC, CKM 10


CLOUD COMPUTING – LAB MANUAL

07. How to configure an Amazon S3 bucket to host a simple HTML


webpage containing “Welcome To My Sample Webpage”.

➢ Sign in to the AWS console.


➢ Search for S3 in the search bar.
➢ Click on Create bucket.
➢ Give name to your bucket.
➢ Leave the default settings and click on Create Bucket.

➢ In the Buckets list, choose the name of the bucket that you want to enable
static website hosting for → Choose Properties → Under Static website
hosting, choose Edit → Choose Use this bucket to host a website →
Under Static website hosting, choose Enable → In Index document, enter
the file name of the index document, typically index.html → Click on
Save Changes.
➢ Choose Permissions → Under Block public access (bucket settings),
choose Edit → Clear Block all public access, and choose Save changes
→ Under Buckets, choose the name of your bucket →
Choose Permissions → Under Bucket Policy, choose Edit → To grant
public read access for your website, copy the following bucket policy.

D.A.C.G GOVT. POLYTECHNIC, CKM 11


CLOUD COMPUTING – LAB MANUAL

➢ Click Save Changes.


➢ Create an index.html file and save it locally in your Desktop/PC.

➢ In the bucket list choose the bucket you’ve created → Under Objects →
Click on Upload → Select the index.html file that you’ve created →
Click on upload.
➢ Choose Properties → At the bottom of the page, under Static website
hosting, choose your Bucket website endpoint.
Your index document opens in a separate browser window.
➢ After finishing your task delete your S3 Bucket.

D.A.C.G GOVT. POLYTECHNIC, CKM 12


CLOUD COMPUTING – LAB MANUAL

08. Create and configure S3 versioning.

➢ Sign in to the AWS console.


➢ Search for S3 in the search bar.
➢ Click on Create bucket.
➢ Give a Bucket Name → Under Object Ownership → Enable ACLs
Enabled → Clear all Block Public Access → Click the Check box for
Aknowledgement → Enable Bucket Versioning → Click on Create
Bucket.
➢ In the Bucket list choose the bucket that you’ve created → Under
Permissions → ACL → Edit → Everyone (Public Access) → Click
the check box of List → Click the check box (I Understand) → Click
Save Changes.
➢ Under Objects Click on Upload → Click on Add files (Add the sample
text file) → Under Permission → Under predefinedACLs → Grant
Public-Read Access → Click on the check box (I Understand) → Click
on Upload.
➢ In the files and folders Choose the file you’ve uploaded → Copy the
Object URL and paste it in the New Tab (Your object will be hosted).

➢ After finishing your task delete your S3 Bucket.

D.A.C.G GOVT. POLYTECHNIC, CKM 13


CLOUD COMPUTING – LAB MANUAL

09. Create EC2 instance using CLI.

➢ Sign in to the AWS console.


➢ Search for IAM in the search bar of console.
➢ Under users → Add user → Name your User → Select Acces key →
Next → Attach existing policies → Add EC2 full access → Next →
Click on Create User.
➢ Copy the Access Key ID (Save Locally at your PC in text file) → Copy
the Secret Acces Key (Save Locally at your PC as text file).
➢ Copy the region where you want to create EC2 instance and save it the
same text file.
➢ Next go to any browser → Search for “AWS CLI download for Windows”
→ open the first link → scroll down → Under Windows → Click on
the provided link to download the CLI’s .msi file.
➢ After downloading the CLI’s .msi file install it on your PC.
➢ Open command prompt type the following command..,
• aws configure → (press Enter).
- paste the access key id → (press Enter).
- paste the secret access key id → (press Enter).
- paste the region name → (press Enter).
- output format = json/text → (press Enter).
• Type this command to create EC2 Instance →
aws ec2 run-instances --image-id (your ami id) --count (number of
instances you want) --instance-type t2.micro --key-name (your key
pair name) --security-group-ids (your security group id) --subnet-id
(your subnet id)
➔ edit this commands image id, count, instance type, key name,
security group id and subnet id.

D.A.C.G GOVT. POLYTECHNIC, CKM 14


CLOUD COMPUTING – LAB MANUAL

• To Terminate instance →
aws ec2 terminate-instances --instance-ids (your instance id)
➔ Type your instance id in

➢ If you’ve followed the steps perfectly, In your AWS account a new instance
will be created.

➢ After finishing your task delete the instance that you’ve created using CLI.

D.A.C.G GOVT. POLYTECHNIC, CKM 15


CLOUD COMPUTING – LAB MANUAL

10. Create S3 bucket using CLI and perform upload and delete
objects.

➢ Sign in to the AWS console.


➢ Search for IAM in the search bar of console.
➢ Under users → Add user → Name your User → Select Acces key →
Next → Attach existing policies → Add EC2 full access → Next →
Click on Create User.
➢ Copy the Access Key ID (Save Locally at your PC in text file) → Copy
the Secret Acces Key (Save Locally at your PC as text file).
➢ Copy the region where you want to create S3 Bucket and save it the same
text file.
➢ Next go to any browser → Search for “AWS CLI download for Windows”
→ open the first link → scroll down → Under Windows → Click on
the provided link to download the CLI’s .msi file.
➢ After downloading the CLI’s .msi file install it on your PC.
➢ Open command prompt type the following command..,
• aws configure → (press Enter).
• paste the access key id → (press Enter).
• paste the secret access key id → (press Enter).
• paste the region name.
• Output format = json/text → (press Enter).
• To create Bucket →

• To delete Bucket →

D.A.C.G GOVT. POLYTECHNIC, CKM 16


CLOUD COMPUTING – LAB MANUAL

➢ If you’ve followed the steps perfectly, In your AWS account a new S3


Bucket will be created.
➢ After finishing your task delete the S3 Bucket that you’ve created using
CLI.

D.A.C.G GOVT. POLYTECHNIC, CKM 17


CLOUD COMPUTING – LAB MANUAL

11. Create and configure Autoscaling.

➢ Sign in to the AWS console.


➢ Search for EC2 in the search bar.
➢ Click on Launch Instance.
➢ Name your instance → Create Key Pair → Under Network settings Click
on Edit → Create Security group → Name your Security group → Click
on Add Group Rule → Type = HTTP → Source Type = Anywhere →
Click on Launch Instance.
➢ Load Balancer → Create Load Balancer → Under Classic Load Balancer
→ Create → Name your Load Balancer → Next → Add your existing
Security Group → Next → Configure Health Check → Next → Add
your existing EC2 instance → Review and Create → Click on Create.
➢ Search SNS in search bar click on it → Click on Create Topic → Name
your Topic → Click on Create Topic.
Create Subscription → Protocol = EMAIL → Endpoint = Your e-mail
id → Click on Create Subscription.
➢ Under Autoscaling → Launch Configuration → Name Your Launch
Configuration → Choose AMI = ami-08e0ca9924195beba → Instance
type= t2.micro → Select existing security group → select existing Key
Pair → Click on Launch Configuration.
➢ Autoscaling → Create → Name your AutoScaling → Click on Switch
to Launch Configuration → Next → VPC → Under AZ and Subnets →
select ap-south-1a → Add Tag → Click on Create.
➢ Search for Cloud Watch in search bar → Click on Alarms → Create
Alarm → Select Metric → EC2 → By Autoscaling → choose CPU
Utilization → Select Metric → threshold = static → choose Greater →
than = greater than the utilization of cpu → Next → In alarm → select

D.A.C.G GOVT. POLYTECHNIC, CKM 18


CLOUD COMPUTING – LAB MANUAL

existing SNS → Next → Give alarm name → Next → Click on Create


Alarm. (Create an another Alarm with a lower threshold type)
➢ Under Autoscaling → In the Autoscaling lists select that which you’ve
created → under Automatic Scaling → Create Dynamic Scaling policy
→ Type = Simple Scaling → Policy Name → Alarm → Take Action
Add/Remove → Number of Instance → Click on Create.
➢ After completing your given task Delete/Terminate everything that you’ve
performed/Created.

D.A.C.G GOVT. POLYTECHNIC, CKM 19


CLOUD COMPUTING – LAB MANUAL

12. How to attach and detach an amazon EBS volume to an


instance.

➢ Sign in to the AWS console.


➢ Search for EC2 in search bar.
➢ Click on Launch Instance.
➢ Name your Instance → Select Security Group → Under Configure
storage → Click on Add new volume → 15 GiB → Click on Launch
Instance.
➢ Under Elastic Block Store → Under Volumes → Select the volume that
you’ve created → Actions → copy snapshot → select the destination
region where you want to create snapshot (for example select (sidney) ap-
southeast-2) → Click on Copy snapshot.
➢ Change your region into sidney in the console → copied snapshot will
appears → select the snapshot → Actions → Create volume from
snapshot → Leave the default settings → Click on Create Volume.
➢ Launch an sample EC2 instance.
➢ Under Elastic Block Store → Under Volumes → select the volume that
is created from snapshot → Actions → Attach Volume → Select the
instance that you’ve created → Click on Attach Volume.
➢ To check it → Go to your instance → Choose it → Under storage →
Check whether your volume is attached or not.
➢ To detach volume → Under Elastic Block Store → Under Volumes →
Select the Volume → Actions → Detach Volume → Detach.
➢ After completing your given task Delete/Terminate everything that you’ve
performed/Created.

D.A.C.G GOVT. POLYTECHNIC, CKM 20


CLOUD COMPUTING – LAB MANUAL

13. Deploying an sample application using Elastic Beanstalk.

➢ Sign in to AWS console.


➢ Search for Elastic Beanstalk in search bar.
➢ Click on Create Application.
➢ Name your application.
➢ Select PHP in platform.
➢ Application code = Sample application.
➢ Click on Create Application.
“It takes several minutes to create the environment”.
➢ After that open any browser and open this link in search bar
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/tutorials.html
under this link you can download sample application zip files for Elastic
Beanstalk , download the zip file which is related to your platform while
creating the Environment, If you are using php platform then download the
php.zip file.
➢ After downloading it open the AWS console – Elastic Beanstalk - Under
the Environments select the application that you’ve created.
➢ Click on Upload and Deploy.
➢ Choose the zip file of the sample application that you’ve downloaded.
➢ Leave the default settings and Click on Deploy.
➢ After uploading the file Click on the URL provided by the environment.
➢ If you’ve followed the steps perfectly the sample application will be
Deployed”.

➢ After finishing your given task delete your Elastic Beanstalk Environment.

D.A.C.G GOVT. POLYTECHNIC, CKM 21

You might also like