Cloud Computing Lab_Manual Final
Cloud Computing Lab_Manual Final
Laboratory Manual
LP-II [CLOUD COMPUTING]
TE-Information Technology
SEMESTER-II
A.Y. 2024-2025
INDEX
Title
Install Google App Engine. Create hello world app and other simple web
applications using Python/Java.
Requirements
Theory
root_directory
| templates
| | index.html
| static
| main.py
| app.yaml
2. The templates directory can be used to store the web templates of the
web application (HTML files).
3. The static directory can be used to store the web static files which
contain the styling and the business logic data for the web application
(CSS and JS files).
4. The main.py is used to define the routes, rendering logic, data
acquisition logic.
5. It provides the WSGI abstraction to the application.
6. The app.yaml file provides the runtime environment, URLs for routes and
launch configuration of the application in the form of key value pairs.
Steps
Contents of app.yaml
runtime : python2
api_version : 1
threadsafe : true
handlers
- url : /
script : main.app
4. The logic of the application, i.e. the Web server interaction code of the
application must be placed in the main.py file.
5. A simple code displaying the hello world on a web page is as follows
class MainPage(webapp2.RequestHandler) :
def get(self):
self.response.write(“Hello World”)
app = webapp2.WSGIApplication(
[(“/”, MainPage)],
debug=True
)
6. Finally, after saving the above code, the application can be run on the
localhost server using the following command. (The command must be
run on the Google Cloud Shell or the terminal in case of Ubuntu).
Command:
python <path_to_sdk>/bin/devappserver.py
<path_to_application_directory>
Sample Output
1. The application, if no errors are found, is launched on the port 8080 of the
localhost server.
2. The cloud console is visible on port 8000 of the localhost server.
3. The URL of localhost:8080 can be typed in the address bar of the browser to
view the application
4. Screenshots:
a) Application launch at port 8080
Title
Requirements
Theory
2. The templates directory can be used to store the web templates of the
web application (HTML files).
3. The static directory can be used to store the web static files which
contain the styling and the business logic data for the web application
(CSS and JS files).
4. The main.py is used to define the routes, rendering logic, data
acquisition logic.
5. It provides the WSGI abstraction to the application.
6. The app.yaml file provides the runtime environment, URLs for routes and
launch configuration of the application in the form of key value pairs.
Steps
Contents of app.yaml
runtime : python2
api_version : 1
threadsafe : true
handlers
url : /
script : main.app
5. The logic of the application, i.e. the Web server interaction code of the
application must be placed in the main.py file.
6. The following python code sends request for information to the API and
interprets response from the API (here, World Time API is used).
Command:
python <path_to_sdk>/bin/devappserver.py
<path_to_application_directory>
Sample Output
A) The application, if no errors are found, is launched on the port 8080 of the
localhost server.
B) The cloud console is visible on port 8000 of the localhost server.
C) The URL of localhost:8080 can be typed in the address bar of the browser to
view the application
D) Screenshots:
Title
Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is
not present in CloudSim.
Requirements
Theory
A) CloudSim
B) Benefits of CloudSim
C) Architecture
1. CloudSim has a layered architecture which separates the User Code and
the simulation environment.
2. It can be depicted as follows
D) CloudSim Components
E) SJF algorithm
1. SJF stands for Shortest Job First
2. Shortest Job first has the advantage of having a minimum average
waiting time among all scheduling algorithms.
3. It is a Greedy Algorithm.
4. It may cause starvation if shorter processes keep coming. This problem
can be solved using the concept of ageing.
5. It is practically infeasible as Operating System may not know burst time
and therefore may not sort them. While it is not possible to predict
execution time, several methods can be used to estimate the execution
time for a job, such as a weighted average of previous execution times.
SJF can be used in specialized environments where accurate estimates
of running time are available.
Steps
6. Select the Configure Build Path section from the extended dropdown
7. Select the Libraries section and click on Add External JARs field on the pop
up
8. Navigate to the jars directory of the CloudSim archive and include the 2 jars
in the project.
9. Create a new package in the src directory of the project.
10. Copy the code files for the constants, Data Center Creator, Data Center
Broker, Matrix Generator and the SJF scheduler files from the
https://github.com/suyash-more/Cloud-Computing-
Projects/tree/master/Scheduling-Algorithm-in-CloudSim/src link.
11. Make sure that the package name provided in each file is the same as the
previously created package.
B) Execution of code
Title:
Find a procedure to transfer the files from one virtual machine to another virtual machine
Requirements:
2 Virtual machines installed, for this case we have Ubuntu 21 and Kali Linux.
Steps:
1. Create a Nat network in which 2 virtual machine can communicate.
• Now select the network option and create a new NAT network
• After creating a NAT network, now go to virtual machine setting by right clicking
on the preferred machine.
• Now go to Network and change the attached option to “NAT network” and select
the network we created earlier.
• Now repeat the same process for another machine.
• Now create a file in Home folder using any text editor. Here we have used
“Test_file.txt” and will transfer from Kali Linux (Right Machine) to Ubuntu (left
Machine).
• Now we can check i/p address of Ubuntu where we want to transfer the file using
“ ifconfig ” command. Here Ubuntu has i/p address 10.0.2.4.
• Transfer the file using command- scp Test_file.txt [email protected]:
Where Test_file.txt is our file
raghav is username of Ubuntu
10.0.2.4 is ip address of Ubuntu (left machine)
• Now enter the password for Ubuntu(left machine) admin, after enter the
password, the file will be sent from Kali Linux(Right machine) to Ubuntu(Left
machine)
Assignment 5
Problem Statement:
Find a procedure to launch virtual machine.
Theory:
Virtual Machine:
Requirement:
Account on
Detailed Steps:-
1. https://www.awseducate.com/registration/s/
entering email id
3.
4.
5.
1. At the top of these instructions, choose Start Lab to launch your lab.
2. Wait until you see the message Lab status: ready, then close the Start Lab panel by
choosing the X.
3. At the top of these instructions, choose AWS .
This opens the AWS Management Console in a new browser tab. The system will
automatically log you in.
6.
• A template for the root volume for the instance (for example, an operating system or
an application server with applications)
• Launch permissions that control which AWS accounts can use the AMI to launch
instances
• A block device mapping that specifies the volumes to attach to the instance when it is
launched
The Quick Start list contains the most commonly used AMIs. You can also create your own AMI
or select an AMI from the AWS Marketplace, an online store where you can sell or buy
software that runs on AWS.
1. At the top of the list, choose Select next to Amazon Linux 2 AMI.
Step 2: Choose an instance type
Amazon EC2 provides a wide selection of instance types optimized to fit different use cases.
Instance types comprise varying combinations of CPU, memory, storage, and networking
capacity and give you the flexibility to choose the appropriate mix of resources for your
applications. Each instance type includes one or more instance sizes so that you can scale your
resources to the requirements of your target workload.
Select a t2.micro instance This instance type has 1 virtual CPU and 1 GiB of memory.
The Network indicates which virtual private cloud (VPC) you want to launch the instance into.
You can have multiple networks, including different ones for development, testing, and
production.
The Lab VPC was created using an AWS CloudFormation template during the setup
process of your lab. This VPC includes two public subnets in two different Availability
Zones.
When you no longer require an EC2 instance, you can terminate it, which means that
the instance stops, and Amazon EC2 releases the instance's resources. You cannot
restart a terminated instance. If you want to prevent your users from accidentally
terminating the instance, you can enable termination protection for the instance, which
prevents users from terminating instances.
You launch the EC2 instance using a default 8 GiB disk volume. This is your root volume (also
known as a boot volume).
1. Choose Next: Add Tags
Make sure the punctuation for the tags matches exactly as above.
Note: Notice the "Rules with source of 0.0.0.0/0 allow all IP addresses to access your instance.
We recommend setting security group rules to allow access from known IP addresses only."
While this is true and common best practice, this has been simplified for the sake of this lab.
Step 6: Configure a security group
A security group acts as a virtual firewall that controls the traffic for one or more instances.
When you launch an instance, you associate one or more security groups with the instance.
You add rules to each security group that allow traffic to or from its associated instances. You
can modify the rules for a security group at any time; the new rules are automatically applied
to all instances that are associated with the security group.
In this lab, you do not log in to your instance using SSH. Removing SSH access improves
the security of the instance.
2. To delete the existing SSH rule, choose the next to the existing SSH rule.
3. Choose Review and Launch
1. Choose Launch
A Select an existing key pair or create a new key pair window will appear.
Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. To
log in to your instance, you must create a key pair, specify the name of the key pair
when you launch the instance, and provide the private key when you connect to the
instance.
In this lab, you do not log in to your instance, so you do not require a key pair.
2. Choose the Choose an existing key pair dropdown list, and select Proceed without a
key pair.
3. Select the next to the text I acknowledge that ....
4. Choose Launch Instances
The instance appears in a Pending state, which means it is being launched. It then
changes to Running, which indicates that the instance has started booting. There will be
a short time before you can access the instance.
The instance receives a public DNS name that you can use to contact the instance from
the Internet.
Select the box next to your Web Server. The Details tab displays detailed information
about your instance.
To view more information in the Details tab, drag the window divider upward.
Review the information displayed in the Details, Security and Networking tabs.
Title
Objectives
Theory
Platform as a service (PaaS)
It is a cloud computing model where a third-party provider delivers hardware and
software tools to users over the internet. Usually, these tools are needed for
application development. A PaaS provider hosts the hardware and software on its
own infrastructure.
Detailed Steps:-
1. https://www.awseducate.com/registration/s/
entering email id
3.
4.
5.
2. Wait until you see the message Lab status: ready, then close the Start Lab panel by
choosing the X.
This opens the AWS Management Console in a new browser tab. The system will
automatically log you in.
6.
• A template for the root volume for the instance (for example, an operating system or an
application server with applications)
• Launch permissions that control which AWS accounts can use the AMI to launch
instances
• A block device mapping that specifies the volumes to attach to the instance when it is
launched
The Quick Start list contains the most commonly used AMIs. You can also create your own AMI
or select an AMI from the AWS Marketplace, an online store where you can sell or buy software
that runs on AWS.
1. At the top of the list, choose Select next to Amazon Linux 2 AMI.
Step 2: Choose an instance type
Amazon EC2 provides a wide selection of instance types optimized to fit different use cases.
Instance types comprise varying combinations of CPU, memory, storage, and networking
capacity and give you the flexibility to choose the appropriate mix of resources for your
applications. Each instance type includes one or more instance sizes so that you can scale your
resources to the requirements of your target workload.
Select a t2.micro instance This instance type has 1 virtual CPU and 1 GiB of memory.
The Network indicates which virtual private cloud (VPC) you want to launch the instance into.
You can have multiple networks, including different ones for development, testing, and
production.
The Lab VPC was created using an AWS CloudFormation template during the setup
process of your lab. This VPC includes two public subnets in two different Availability
Zones.
When you no longer require an EC2 instance, you can terminate it, which means that
the instance stops, and Amazon EC2 releases the instance's resources. You cannot
restart a terminated instance. If you want to prevent your users from accidentally
terminating the instance, you can enable termination protection for the instance, which
prevents users from terminating instances.
3. Scroll down, and then expand Advanced Details.
When you launch an instance in Amazon EC2, you have the option of passing user data
to the instance that can be used to perform common automated configuration tasks and
even run scripts after the instance starts.
4. Copy the following web application home page sample code into user data filed.
5. Also code other pages for your web application.
#!/bin/bash
yum -y install httpd
systemctl enable httpd
systemctl start httpd
echo '<html><h1>Hello From Your Web Server!</h1></html>' > /var/www/html/index.html
You launch the EC2 instance using a default 8 GiB disk volume. This is your root volume (also
known as a boot volume).
Note: Notice the "Rules with source of 0.0.0.0/0 allow all IP addresses to access your instance.
We recommend setting security group rules to allow access from known IP addresses only."
While this is true and common best practice, this has been simplified for the sake of this lab.
Step 6: Configure a security group
A security group acts as a virtual firewall that controls the traffic for one or more instances.
When you launch an instance, you associate one or more security groups with the instance. You
add rules to each security group that allow traffic to or from its associated instances. You can
modify the rules for a security group at any time; the new rules are automatically applied to all
instances that are associated with the security group.
In this lab, you do not log in to your instance using SSH. Removing SSH access improves
the security of the instance.
2. To delete the existing SSH rule, choose the next to the existing SSH rule.
3. Choose Review and Launch
Step 7: Review instance launch
The Review page displays the configuration for the instance that you are about to launch.
1. Choose Launch
A Select an existing key pair or create a new key pair window will appear.
Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. To
log in to your instance, you must create a key pair, specify the name of the key pair
when you launch the instance, and provide the private key when you connect to the
instance.
In this lab, you do not log in to your instance, so you do not require a key pair.
2. Choose the Choose an existing key pair dropdown list, and select Proceed without a
key pair.
3. Select the next to the text I acknowledge that ....
4. Choose Launch Instances
The instance appears in a Pending state, which means it is being launched. It then
changes to Running, which indicates that the instance has started booting. There will be
a short time before you can access the instance.
The instance receives a public DNS name that you can use to contact the instance from
the Internet.
Select the box next to your Web Server. The Details tab displays detailed information
about your instance.
To view more information in the Details tab, drag the window divider upward.
Review the information displayed in the Details, Security and Networking tabs.
With instance status monitoring, you can quickly determine whether Amazon EC2 has
detected any problems that might prevent your instances from running applications.
Amazon EC2 performs automated checks on every running EC2 instance to identify
hardware and software issues.
Notice that both the System reachability and Instance reachability checks have passed.
This tab displays Amazon CloudWatch metrics for your instance. Currently, there are not
many metrics to display because the instance was recently launched.
3. At the top of the page, choose the Actions dropdown menu. Select Monitor and
troubleshoot Get system log.
The system log displays the console output of the instance, which is a valuable tool for
problem diagnosis. It is especially useful for troubleshooting kernel problems and
service configuration issues that could cause an instance to terminate or become
unreachable before its SSH daemon can be started. If you do not see a system log, wait
a few minutes and then try again.
1. Scroll through the output, and note that the HTTP package was installed from the user
data that you added when you created the instance.
2. Choose Cancel to return to the Amazon EC2 dashboard.
3. With your web server selected, choose the Actions dropdown menu, and select Monitor
and troubleshoot Get instance screenshot.
This option shows you what your EC2 instance console would look like if a screen were
attached to it. Notice it is essentially a command line interface.
If you are unable to reach your instance via SSH or RDP, you can capture a screenshot of
your instance and view it as an image. This option provides visibility about the status of
the instance and allows for quicker troubleshooting.
1. Select box next to the EC2 web server you created, and then choose the Details tab.
2. Copy the Public IPv4 address of your instance to your clipboard.
3. In your web browser, open a new tab, paste the IP address you just copied, and then
press Enter.
Question: Are you able to access your web server? Why not?
You are not currently able to access your web server because the security group is not
permitting inbound traffic on port 80, which is used for HTTP web requests. This is a
demonstration of how to use a security group as a firewall to restrict the network traffic
that is allowed in and out of an instance.
To correct this issue, you now update the security group to permit web traffic on port
80.
4. Keep the browser tab open, but return to the EC2 Management Console tab.
5. In the left navigation pane, choose Security Groups.
6. Select the check box next to the Web Server security group.
7. Choose the Inbound rules tab.
8. Choose Edit inbound rules and then choose Add rule and configure the following:
o Type: Choose HTTP.
o Source: Choose Anywhere.
9. Choose Save rules
10. Return to the web server tab that you previously opened, and choose to refresh the
page.
You should see the message Hello From Your Web Server!
Assignment 7
Title
Design and develop custom Application (Mini Project) using Salesforce Cloud.
Requirements
1. Salesforce
2. Browser
Theory
A) Salesforce:
B) Salesforce Architecture:
1. Multi-tenant:
Salesforce stores data in a single database schema. There can be a single
instance of a software server with multiple tenants. Speaking about a multi-
tenant architecture, there is a single shared application service to several
clients. This makes it cost-effective. On the contrary, in a single-tenant, the
development and maintenance cost must be entirely owned by one client.
Hence the multi-tenant architecture is a boon.
2. Metadata:
Salesforce uses a metadata-driven development model. This allows
developers to only focus on building the application. This metadata-driven
platform makes customization and scaling up easy.
3. API:
Salesforce provides a powerful source of APIs. This helps in developing and
customizing the Salesforce1 Mobile App. Every feature of the Salesforce
design has been planned and implemented precisely.
C) Salesforce Cloud Services:
Steps
b. In the modal that appears, enter app details and add logo and color for branding:
c. Add App options like Navigation and Supported Form Factors:
d. Add required Utility Items for your application:
Title
Design an Assignment to retrieve, verify, and store user credentials using Firebase
Authentication, the Google App Engine standard environment, and Google Cloud
Data store.
Requirements
Theory
A) Firebase:
4. Developers relying on this platform get access to services that they would
have to develop themselves, and it enables them to lay focus on delivering
robust application experiences.
5. Some of the Google Firebase platform’s standout features include databases,
authentication, push messages, analytics, file storage, and much more.
6. Since the services are cloud-hosted, developers can smoothly perform on-
demand scaling without any hassle. Firebase is currently among the top app
development platforms relied upon by developers across the globe.
1. Authentication:
It supports authentication using passwords, phone numbers, Google,
Facebook, Twitter, and more. The Firebase Authentication (SDK) can be
used to manually integrate one or more sign-in methods into an app.
2. Realtime database:
Data is synced across all clients in real-time and remains available even
when an app goes offline.
3. File Storage:
Firebase Storage provides a simple way to save binary files — most often
images, but it could be anything — to Google Cloud Storage directly from
the client. Firebase Storage has it’s own system of security rules to protect
your GCloud bucket from the masses, while granting detailed write
privileges to your authenticated clients.
4. Hosting:
Firebase Hosting provides fast hosting for a web app; content is cached
into content delivery networks worldwide.
5. Test lab:
The application is tested on virtual and physical devices located in
Google’s data centers.
6. Notifications:
Notifications can be sent with firebase with no additional coding. Users
can get started with firebase for free; more details can be found on
the official website.
C) Firebase Uses:
Steps
1. Initial Setup:
a. Install and configure Google App Engine:
b. Signup and Login to Google Cloud platform:
c. Login to Firebase:
2. Creation of project in Google Cloud:
a. Open the GAE SDK shell and type the command ‘gcloud init’. Then select
appropriate configuration an account:
b. From the list that appears select the appropriate project that we created in
Google Cloud:
4. Adding Firebase to the project:
b. In the next window, add the project name that we created in Google Cloud:
c. Confirm Firebase billing plan:
d. The next window shows some instructions. Read those and click Continue:
e. Enable Google Analytics for the project:
a. From the console, go to your project and click ‘</>’ to add your app:
b. Add a nickname for your app and click Register app:
c. You will receive further configuration details then click Continue to console:
d. You will see the app on the console, click on it to view all its details.
6. Authentication in Firebase:
c. Perform appropriate configuration for that platform. You can also add
domains:
d. Then you can see the added sign-in methods and the domains:
e. Also, when the users login to your application, their details will be visible at
the Users tab:
b. The login page has to options to login. You can login through anyone of them
as follows:
(i) Google Account: Choose appropriate Google account to login:
(ii) Mail: Use a valid mail address to login. The user is then prompted to
c. Then the user can add a note and then save it. Further user can sign out by
clicking respective button: