0% found this document useful (0 votes)
24 views52 pages

CC Lab Manual

The document outlines a series of experiments related to creating virtual machines using VirtualBox and AWS EC2. It provides step-by-step instructions for setting up Ubuntu and Windows XP virtual machines, as well as creating a Virtual Private Cloud (VPC) and launching an EC2 instance on AWS. Additionally, it includes guidance on configuring network settings and developing a simple web page for an online bookstore.

Uploaded by

pics2104
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)
24 views52 pages

CC Lab Manual

The document outlines a series of experiments related to creating virtual machines using VirtualBox and AWS EC2. It provides step-by-step instructions for setting up Ubuntu and Windows XP virtual machines, as well as creating a Virtual Private Cloud (VPC) and launching an EC2 instance on AWS. Additionally, it includes guidance on configuring network settings and developing a simple web page for an online bookstore.

Uploaded by

pics2104
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/ 52

SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.

RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

CLOUD COMPUTING LAB - I

Create a Virtual Machine on Virtual Box with Ubuntu 14LTs files, 2GB RAM and 200GB Hard Disk
configuration through Infrastructure as a Service (IaaS).

Step 1: Download VirtualBox

Go to the official VirtualBox website (https://www.virtualbox.org) and download the appropriate


version for your operating system. Install VirtualBox on your computer.

Step 2: Download Ubuntu 14.04 LTS ISO

Go to the official Ubuntu website (https://releases.ubuntu.com/14.04/) and download the


Ubuntu 14.04 LTS ISO file.

Step 3: Create a New Virtual Machine

Open VirtualBox and click on "New" to create a new virtual machine. Enter a name for your VM
(e.g., "Ubuntu 14 LTS") and choose "Linux" as the type and "Ubuntu (64-bit)" as the version.

Step 4: Allocate Memory

Choose the amount of RAM you want to allocate to the virtual machine. For Ubuntu 14.04, it is
recommended to allocate at least 1-2 GB of RAM. Click "Next."
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 5: Create a Virtual Hard Disk

Select "Create a virtual hard disk now" and click "Create." Choose "VDI (VirtualBox Disk Image)"
as the hard disk file type and click "Next."
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 6: Choose Hard Disk Storage

Select "Dynamically allocated" as the storage option and choose the size for the virtual hard disk.
A minimum of 10 GB is recommended for a basic Ubuntu installation. Click "Create."

Step 7: Configure VM Settings

Select the newly created VM from the VirtualBox Manager and click on "Settings." In the settings
window, navigate to the "Storage" tab, and under "Controller: IDE," click on the icon to add the
Ubuntu ISO file you downloaded earlier. This will be used as a bootable disk for the VM.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 8: Start the VM

Click "OK" to close the settings window. Now, select your VM again and click on "Start." The VM
will boot from the Ubuntu ISO file.

Step 9: Install Ubuntu

In the VirtualBox VM window, you will see the Ubuntu installer. Select your language and click
"Install Ubuntu." Follow the installation wizard, selecting your time zone, keyboard layout, and
user details as prompted.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 10: Complete Installation

After the installation is complete, the VM will prompt you to remove the installation medium (the
Ubuntu ISO). Click "Continue" to do so, and the VM will restart.

OUTPUT :

RESULT :
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

CLOUD COMPUTING LAB - II

Create a Virtual Machine on Virtual PC with Windows, 2GB RAM and 200GB Hard Disk configuration
through Infrastructure as a Service (IaaS).

Step 1: Download VirtualBox

Go to the official VirtualBox website (https://www.virtualbox.org/) and download the VirtualBox


installer for your operating system (Windows, macOS, or Linux).

Step 2: Install VirtualBox

Run the VirtualBox installer and follow the on-screen instructions to install the software on your
computer.

Step 3: Download Windows XP ISO

You will need a Windows XP installation ISO file. If you have a physical Windows XP installation
disc, you can create an ISO image from it using software like ISORIVER.

Step 4: Create a New Virtual Machine

Open VirtualBox, click on "New" to create a new virtual machine. Enter a name for the VM (e.g.,
"Windows XP") and select "Microsoft Windows" as the operating system, and "Windows XP (64-
bit)" as the version. Click "Next."
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 5: Allocate Memory (RAM)

Choose the amount of RAM you want to allocate to the virtual machine. For Windows XP, 1 GB
(1024 MB) should be sufficient. Click "Next."

Step 6: Create a Virtual Hard Disk

Select "Create a virtual hard disk now" and click "Create." Choose "VDI (VirtualBox Disk Image)"
as the hard disk file type and click "Next." Select "Dynamically allocated" for the storage option
and specify the size (e.g., 20 GB) for the virtual hard disk. Click "Create."
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 7: Configure Virtual Machine Settings

In the VirtualBox main window, select your newly created VM and click "Settings." Go to the
"Storage" tab and under "Controller: IDE," click on the CD icon and choose "Choose Virtual
Optical Disk File." Browse and select the Windows XP ISO file you downloaded earlier. Click "OK"
to close the settings.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 8: Install Windows XP

Start the VM by clicking the "Start" button in VirtualBox. The Windows XP installation process
should begin. Follow the on-screen instructions to install Windows XP. You will need to enter your
product key during the installation.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 9: Install VirtualBox Guest Additions (Optional)

After Windows XP is installed, you may want to install VirtualBox Guest Additions to improve
integration between the host and virtual machine. In the VirtualBox menu, go to "Devices" and
select "Insert Guest Additions CD image." Follow the on-screen instructions to install the Guest
Additions.

Step 10: Configure Windows XP

Once the installation is complete, you can customize your Windows XP virtual machine settings and
configurations to suit your needs.

OUTPUT :

RESULT :
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

3. Create Virtual Private Cloud (VPC) with subnets, route table and Internet gateway using AWS Management
Console. Create a virtual machine instance with 2GB RAM and 200 GB hard disk configuration on Amazon
Web Services (AWS) cloud through Elastic Compute Cloud (EC2) service and develop a home web page for
online bookstore information.

Step 1: Create a Virtual Private Cloud (VPC)

 Name tag: Give VPC a name, e.g., "JNETWORK."


 IPv4 CIDR block: Define the IP address range for “ JNETWORK “, e.g., "10.0.0.0/16." (65535 Hosts)

 Click on Create VPC (JNETWORK) & After Launch VPC-ID will be generated
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 2: Create Two Subnets (Private)


 VPC: Select the VPC which created earlier (JNETWORK)

 Name tag: "Subnet 1"


 IPv4 CIDR block: Define the IP address range for the subnet, e.g., "10.0.1.0/24." (256 Hosts)
 Name tag: "Subnet 2"
 IPv4 CIDR block: Define the IP address range for the subnet, e.g., "10.0.1.0/24." (256 Hosts)
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 3: Launch an EC2 Instance

1. Go to the EC2(SUBNET1 & SUBNET2) dashboard & Click on "Launch Instance" to create a new EC2
instance.

2. Choose an Amazon Machine Image (AMI) for instance, e.g., “ Amazon Linux 2”.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

3. Select an instance type with 2GB RAM and 200GB storage, like “ t2.micro or t3.micro” .

4. Configure instance details, including selecting the VPC (JNETWORK) which created earlier and
choosing the public subnet 1 or subnet2.

5. Configure security groups to allow HTTP (port 80) , SSH (port 22) & HTTPS (port 443) traffic.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

6. Add Storage (8gb) – Hard Disk to EC2

7. Review and launch the instance. existing key pair(password.ppk) for SSH access.Launch the instance.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 4 : Connect to EC2 (SUBNET 1) & EC2 (SUBNET2) instance

SSH into EC2 instance using the key pair (password.ppk) –


1. EC2(SUBNET 1) - Failed to Connect
2. EC2(SUBNET 2) - Failed to Connect

Note:- Both Subnets 1,2 are designed & deployed as private subnets, This is the reason EC2 instance failed to
connect.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 5: Create an Internet Gateway

1. Go to VPC dashboard.
2. Click the "Create Internet Gateway" button.
3. Give it a name, e.g., "MyInternetGateway-IGW," and click "Create Internet Gateway."

4. Select the newly created Internet Gateway, click "Actions," and then click "Attach to VPC." Choose
VPC (JNETWORK) & click "Attach."
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 6: Create a Route Table & Associate Private Subnets 1 & Subnet2
1. In the VPC dashboard, click on "Route Tables"

2. Give it a name, e.g., "RT-PublicRouteTable," and select VPC (JNETWORK) & Create.

3. Select the route table just created, click the "Routes" tab, and then click "Edit routes."
4. Add a route with destination "0.0.0.0/0" and target as the Internet Gateway (MyInternetGateway-
IGW) created earlier & Save the changes.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

5. Click on Subnet Associations & Add “ Subnet 1 & Subnet2” which created earlier & Save the changes.

Step 7 : Connect to EC2 (SUBNET 1) & EC2 (SUBNET2) instance

SSH into EC2 instance using the key pair (password.ppk)

1. EC2(SUBNET 1) - Connect is Successful


2. EC2(SUBNET 2) - Connect is Successful

Note:- Both Subnets 1,2 are associated to “IGW & RT” with internet flow to both private subnets (SUBNET1 &
SUBNET2) are now available to Internet (Public), So the connectivity of EC2 instance are successful
now.

RESULT :-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

4. Create a virtual machine instance with 2GB RAM and 200 GB hard disk configuration on Amazon Web
Services (AWS) cloud through Elastic Compute Cloud (EC2) service and develop a home web page for online
bookstore information.
Steps: Launch an EC2 Instance
1. Go to the EC2 dashboard & Click on "Launch Instance" to create a new EC2 instance.

2. Choose an Amazon Machine Image (AMI) for instance, e.g., “ Amazon Linux 2”

3. Select an instance type with 2GB RAM and 200GB storage, like “ t2.micro or t3.micro” .
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

4. Configure instance details, including selecting the VPC (JNETWORK) which created earlier and
choosing the public subnet 1 or subnet2.

5. Configure security groups to allow HTTP (port 80) , SSH (port 22) & HTTPS (port 443) traffic.

6. Add Storage (8gb) – Hard Disk to EC2


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

7. Review and launch the instance. Existing key pair (password.ppk) for SSH access. Launch the instance.

8. Connect to EC2 instance

Note:- SSH into EC2 instance using the key pair (password.ppk) specified during instance launch
Using Putty or any other way of connectivity.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

9. Run Linux commands to install web server & run sample webpage
sudo yum update –y - Update the package repository
sudo yum install httpd –y - Install a web server, e.g., Apache.
systemctl start httpd - Start a web server, e.g., Apache.
systemctl status httpd - Check status (Active) about web server, e.g., Apache.
chkconfig httpd on - Change configuration settings to run web server always, e.g., Apache.
CD/var/www/html/ - Access to “root” web directories
echo “Online Book Store” > index.html – Write sample webpage program to run & save as index.html
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

10. Browser the web server with Public IP or DNS to check website is working & live

RESULT :-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

5.Develop a catalogue web page for online bookstore and create a Simple Storage Service (S3) bucket on
Amazon Web Services (AWS) cloud and upload catalogue web page into S3 bucket.

Step 1:

1.Create the Book Catalog Web Page:

<!DOCTYPE html>
<head>
<title> BOOK CATALOGUE </title>
</head>
<body>
<h2>ONLINE BOOK STORE </h2>
<table>
<tr>
<th>SNO</th>
<th>BOOK</th>
<th>AUTHOR</th>
</tr>
<tr>
<td>1</td>
<td>CLOUD COMPUTING</td>
<td>RK NARAYAN</td>
</tr>
<tr>
<td>2</td>
<td>JAVA</td>
<td>DR.Nageswar Rao</td>
</tr>
</table>
</body>
</html>

2. Save the HTML File:


Save this HTML file with a .html extension, for example, index.html.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

Step 2: Create an AWS S3 Bucket:

1. Sign in to your AWS Management Console.

2. Open the Amazon S3 console.

3. Click the "Create bucket" button. & Choose a globally unique bucket name and select the region for
your bucket.

4. Choose Object Ownership as Enables

5. Choose all Blocked Public Access settings for the bucket & Set back to enable all listed
permissions & Acknowledge that permission are open to host website files in public .
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

6. Click "Create bucket."

7. Now Access the newly created Bucket & upload Website in Bucket
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

8. Upload the Book Catalogue Webpage ( index.html)


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

9. Access Bucket Properties & Enable public Webhosting.

10. After Enable “ Static Webhosting “ do mention index.html (first page ) & error.html page
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THE EXPERIMENT


Roll Number : Page No :

11. Select the uploaded “index.html” & Make Public using ACL .

12. Browse the Object URL in CHROME Browser for Book Catalogue Hosted website .

RESULT :-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

6. Create Lambda function & verify the following a) S3 bucket file upload & configure trigger

b) SNS (lambda Destination configure ) | c) Cloudwatch the logstream working.

Procedure

1. Create a new S3 bucket

2. Configure the bucket for static website hosting: In the bucket properties, navigate to the "Static website
hosting" section and select "Use this bucket to host a website." Then, you need to specify the following:

 Index document: This is the default page for your website, typically something like "index.html."

 Error document: You can specify a custom error page, like "error.html," or use a default like
"404.html."

3. Set up bucket permissions

4. Upload your website files: Now, you can upload your website files to the S3 bucket. Make sure to place
your HTML, CSS, JavaScript, and other assets in the appropriate directories within the bucket.

5. Make your files public: For each file you want to make public, select the file in the S3 bucket, click on it, and
in the object properties, set the permissions to allow public read access.

6. Access your website: Once your website files are uploaded and permissions are set, you can access your
website using the S3 bucket's website endpoint URL. This URL will be in the format:

Example DNS:- http://your-bucket-name.s3-website-your-region.amazonaws.com.

7. Create a new SNS topic “ SEND_EMAIL”

8. Configure the topic:

 Name: “ SEND_EMAIL”

 Access Policy (optional): “ Admistrative Access”

 Add subscriptions: Subscriptions define where the messages sent to the topic will be delivered.
Email:[email protected]
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

 Confirm the subscription (for certain types): For some types of subscriptions (e.g., email or SMS),
confirm the subscription by clicking a confirmation link sent to the subscribed email address or

phone number.

9. Create a new Lambda function: To create a new Lambda function, click the "Create function" button.

Configure the function: provide information about your Lambda function

Function name: SEND NOTIFICATION

Runtime: Select the runtime environment for your function (e.g., Python.).

Execution role: create a new (AGENT ROLE)

Basic settings: Configure memory, timeout( max 15min), and other settings for function. & attach Policy
(Administrative acess)

Function code: LAMBDA WITH S3 & SNS - CODE SNIPPET()


import json
import boto3

topic_arn = " edit as per new topic ARN"


def send_sns(message, subject):
try:
client = boto3.client("sns")
result = client.publish(TopicArn=topic_arn, Message=message, Subject=subject)
if result['ResponseMetadata']['HTTPStatusCode'] == 200:
print(result)
print("Notification send successfully..!!!")
return True
except Exception as e:
print("Error occured while publish notifications and error is : ", e)
return True

def lambda_handler(event, context):


print("event collected is {}".format(event))
for record in event['Records'] :
s3_bucket = record['s3']['bucket']['name']
print("Bucket name is {}".format(s3_bucket))
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

s3_key = record['s3']['object']['key']
print("Bucket key name is {}".format(s3_key))
from_path = "s3://{}/{}".format(s3_bucket, s3_key)
print("from path {}".format(from_path))
message = "The file is uploaded at S3 bucket path {}".format(from_path)
subject = "Processes completion Notification"
SNSResult = send_sns(message, subject)
if SNSResult :
print("Notification Sent..")
return SNSResult
else:
return False
10. ADD TRIGGER (S3) & DESTINATION (SNS)

11. verify uploading files in s3 bucket

12. Monitor your topic: the activity of SNS topic, including message deliveries, failures, and more. Can be
monitor in CloudWatch for entire events related to the topic.

RESULT :-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

7. Create Dynamo DB & Add data records & Verify search & scan operations using AWS

1. Create a new DynamoDB table: create a new DynamoDB table with name “EMPLOYEE”

2. Configure the table: You will need to provide information about your DynamoDB table, including the
following:

 Table name: EMPLOYEE

 Primary key: Define the primary key for your table. A primary key consists of one or two attributes:
a partition key and an optional sort key. This key is used to uniquely identify items in the table.

3. Create the table: After configuring all the necessary settings, click the "Create" button to create your
DynamoDB table.

4. Access and interact with your table: Once your DynamoDB table is created, user can start adding and
retrieving data.
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

Note:- You can use the AWS SDKs, AWS CLI, or AWS Management Console to interact with the table and
perform database operations.

5. Output of search in table:


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

RESULT:-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

8. Create Server Oriented Instance with 2GB Ram & 200GB HDD & Configure MariaDB Relational Database
System to test run DDL & DML mysql commands.

Procedure:

1. Create a Server Instance: Create a new virtual server Ec2 instance with the following specifications: Name:
dbserver-1

 2GB of RAM

 200GB HDD

2. Select an Operating System (AMI ): Choose a Linux distribution (e.g., Ubuntu, CentOS) as the operating
system suitable for DB server.

3. Select an Instance type : Choose t2.micro (Free-tier) 1VCPU system .

4. Configure Key pair : Choose PEM | PPK keys credentials suitable for VM server login.

5. Configure Network & Firewall : Choose VPC Network & Subnet(S1) & Public IP & Essential ports

SSH (22) | HTTP (80) | HTTPS(443) | MYSQL(1433) | MYSQL/AURORA DB (3306)

6. Launch VM & Connect to Your Server: Login to Instance (Ec2) server using SSH (Putty) .

7. Run List of Linux commands

 sudo apt update


 sudo apt install mysql-server –y
 sudo systemctl status mysql
 sudo mysql
 alter user 'root'@'localhost' identified with mysql_native_password by 'admin123';
 flush privileges;
 create database mbu;
 show databases;
 use mbu;
 show tables;
 create table table1 (id int, name varchar(45));
 show tables;
 insert into student values(1, 'nikhil'), (2, 'teja'), (3, 'jeevan'), (4, 'ram');
 select * from student;
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

Note:- use “clear” stmt whenever it is required .


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

Result :-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

9. Create an Lambda function to implement automation task for Ec2 Instance Start or Stop Service & monitor

service working functionality using AWS Cloudwatch .

Procedure:

1. Create a Server Instance: Create a new virtual server Ec2 instance with the following specifications: Name:

dbserver-1

 2GB of RAM

 200GB HDD

2. Select an Operating System (AMI ): Choose a Linux distribution (e.g., Amazon Linux ,Ubuntu,

CentOS,Windows) as the operating system suitable for DB server.

3. Select an Instance type : Choose t2.micro (Free-tier) 1VCPU system .

4. Configure Key pair : Choose PEM | PPK keys credentials suitable for VM server login.

5. Configure Network & Firewall : Choose VPC Network & Subnet(S1) & Public IP & Essential ports

SSH (22) | HTTP (80) | HTTPS(443) .

6. Launch VM & Set Tag & value : “ Tag : ENV” | “Value:Test”

7. Create Lambda function with a function name (Ec2_startstop) & set author from scratch.

8. Configure the Function Runtime: Select the runtime for your function. Common runtimes include Python

3.11v. make sure the runtime that matches your code.


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

import json
import boto3

def lambda_handler(event, context):


# TODO implement
ec2_connection=boto3.resource(service_name="ec2",region_name="ap-southeast-1")
filter_ec2={"Name":"tag:Env","Values":["Test"]}
for each in ec2_connection.instances.filter(Filters=[filter_ec2]):
print(each.id)
each.stop()

return {
'statusCode': 200,
'body': json.dumps('Ec2 Instance Succesfully stoped')
}

Note:- change Ec2 Tag values & Region values as per working .

9. Execution role: Create a new role with basic Lambda permissions(Ec2FullAcess). This role defines Lambda

function can access & execute automation script based on Ec2 service.

Note:- Attach Ec2FullAcess policy to Role which was created in IAM Service.

10. Configure an Lambda Time slot for max execution time (15:00 Min).

11. Create an Test Event & Deploy code to run lambda function.

12. Check the status of working of Ec2 Instance, As resultant Ec2 which have Tag value as (ENV : Test) are

shutting down immedetly as lambda code is deployed & did test run.

13. Create an cloudwatch Service & fetch to Log Stream to acces the automation work log records .
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

Note:- After Deploy code then Run the test Server so that Ec2 will automatically stopped by Lambda

Result:-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

10. Implement ELB- Elastic Load Balancer under any two regions compute service & Test
traffic load factor in live working condition.
Procedure:
1. Create a VPC with two subnets & configure Internet Gateway & Route Table
 South subnet1 ( 1a-zone)
 North subnet2 (1b-zone)

2. Launch Ec2 with essentials in South & North Subnets as specified zones.
SOUTH VM NORTHVM

Ec2 Essentials :
Ec2 Name | AMI(Linux2) | Instance type (t2.micro) | Keypair | Firewall Ports (22,80,443) | EBS (8GB)
Run WEBSERVER with LINUX (Auto script) in each EC2 Instance
#!/bin/bash
dnf install -y httpd
systemctl enable httpd
systemctl start httpd
cd /var/www/html/
echo "South Server-1" > index.html (or) echo "North Server-1" > index.html
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

3. Create Load Balancer (ELB) with existing Sou6th & North Ec2

4. ELB – Name need to be specified (Ex:- FLipkart) & choose Public (Internet Facing)

5. Select VPC & Zones


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

6. Select Security Groups

7. Set Health check (2sec/5 cycles )

8. ADD Instances

9. Run Global ELB DNS in browser to verify load


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

10. Load Distribution output


DNS link (A Record)

http://flipkart-424524021.ap-southeast-
1.elb.amazonaws.com/

Note:- As trafiic go high load will be distributed across two zones (South & North)
If any server go crash other server will pick same website

Result:-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

11. Create an Auto scaling service policy to scale up & scale down web servers, when traffic is
high or server crash conditions.

Procedure:

1. Create Launch Template with Ec2 Essentials


Ec2 Name | AMI(Linux2) | Instance type (t2.micro) | Keypair | Firewall Ports (22,80,443) |
EBS(8GB)
Run WEBSERVER with LINUX (Auto script) in each EC2 Instance
#!/bin/bash
dnf install -y httpd
systemctl enable httpd
systemctl start httpd
cd /var/www/html/
echo "South Server-1" > index.html (or) echo "North Server-1" > index.html

2. Create Auto Scaling Group Policy


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

3. Select VPC & Zones

4. Attach Load Balancer (Reference 10 experiment)


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

5. Configure Group Policy like how many Ec2 are required

6. Scaling policy for CUP BURST TIMEOUT


IF (CPU >=50% + 1 Ec2)

7. Create all resources inline to Auto Scaling Policy


SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET

NAME OF THEEXPERIMENT
Roll Number : Page No :

8. Inline to Policy Below Ec2 are automatically launching

Activity Report For Those Newly Launched Ec2 Vms

RESULT :-

You might also like