Cloud Computing Lab Manual (7th Sem)
Cloud Computing Lab Manual (7th Sem)
Lab File
For
Cloud Computing (KCS-751A)
B. Tech (4th Year)
CSE-IoT
Session -2024-2025 (Odd Semester)
1|Page
Cloud Computing Lab File (KCS751A)
Vision of Institute
To be an outstanding institution in the country imparting technical education, providing need-
based, value-based and career-based programs and producing self-reliant, self- sufficient
technocrats capable of meeting new challenges.
Mission of Institute
The mission of the institute is to educate young aspirants in various technical fields to fulfill
global requirement of human resources by providing sustainable quality education, training and
invigorating environment besides molding them into skilled competent and socially responsible
citizens who will lead the building of a powerful nation.
Vision of Department
To become a globally recognized department where talented frontier of the Internet
of things (IoT) are nurtured to meet the need of industry, society, and economy to
serve the nation and society.
Mission of Department
• To provide resources of excellence and fresh mind into highly competent
IoT application development, and enhanced their knowledge and skills
through covering technologies and multi-disciplinary engineering practices.
• To equip students and provide the state- of- the art facilities to develop
industry Ready IoT system.
• To promote industries collaborations to have the best careers.
2|Page
Cloud Computing Lab File (KCS751A)
Safety Rules of Laboratory
(Lab Name: Cloud Computing Lab- KCS751A)
1. Computing lab should be maintained clean, organized, and properly
lighted.
2. Keep your workspace clean and free of clutter. Dust can affect computers
adversely.
Ensure that the machines are cleaned on a regular basis.
3. Everyone must understand and follow safety procedures
4. Follow the basic safety guidelines to prevent cuts, burns, electrical shock,
and damage to Eye sight.
5. Do not spill water or any other liquid on the machine. It can cause short
circuit fire as well as damage the machine.
6. Do not touch areas in printers that are hot or that use high voltage.
Remember that some components retain a high voltage even after the
printer is turned off.
7. Avoid contact with energized electrical circuits.
8. Disconnect the power source before servicing or repairing electrical
equipment.
9. If it is not unsafe to do so, work with only one hand, keeping the other hand
at your side or in your pocket, away from all conductive material. This
precaution reduces the likelihood of accidents that result in current passing
through the chest cavity.
10. If water or a chemical is spilled onto equipment, shut off power at the main
switch or circuit breaker and unplug the equipment.
11. If an individual meets a live electrical conductor, do not touch the
equipment, cord or person. Disconnect the power source from the circuit
breaker or pull out the plug using a leather belt.
3|Page
Cloud Computing Lab File (KCS751A)
Do and Don’ts in Laboratory
(Lab Name: Cloud Computing Lab- KCS751A)
Do's
1. Always sit at your assigned computer unless a teacher moves you.
2. Turn off the machine when you are no longer using it.
3. Always save your project.
4. Always maintain lab file of all your programs.
5. Do the connections neatly and firmly tightened.
6. Do only the experiment assigned to you.
7. Do the experiment carefully following the correct procedure.
8. Write the Objective of Program, Apparatus used, and Program, flow
chart with output/ Result by using the pencil in the left side of page
Don'ts
1. Don't run or play in the laboratory.
2. Don't eat, drink or smoke in laboratories.
3. Don't keep unwanted materials in the worktable.
4. Don't touch live conductor or wire with bare hands.
5. Don't clutter floor and tables with books, bags or cases.
6. Don't touch the screen- ever. Touching the screen with your fingers or
objects like pencils can
Damage the monitor.
7. Don't change the computer settings.
4|Page
Cloud Computing Lab File (KCS751A)
Index
S. No. Experiment Name Performed Grade Faculty Sign
Date with date
1 Install Virtual box/VMware Workstation with different
flavours of Linux or windows OS on top of windows7
or 8.
2 Install a C compiler in the virtual machine created using
virtual box and execute Simple Programs.
3 Install Google App Engine. Create hello world app and
other simple web applications using
Python/java.
4 Use GAE launcher to launch the web applications.
Faculty Signature
5|Page
Cloud Computing Lab File (KCS751A)
Program No. : 1 DATE:
Objective:
To Install Virtual box / VMware Workstation with different flavours of Linux or windows OS on
top of windows7 or 8.
PROCEDURE:
6|Page
Cloud Computing Lab File (KCS751A)
Fig 2. Custom Setup
3. Click the next button
7|Page
Cloud Computing Lab File (KCS751A)
Fig 4. Virtual Box Application
4. Steps to import Open nebula sandbox:
1. Open Virtual box
2. File import Appliance
3. Browse OpenNebula-Sandbox-5.0.ova file
4. Then go to setting, select USB and choose USB 1.1
5. Then Start the Open Nebula
6. Login using username: root, password:opennebula
8|Page
Cloud Computing Lab File (KCS751A)
Fig 6. Steps to create Virtual Machine
5. Steps to create Virtual Machine through open nebula
1. Open Browser, type localhost:9869
2. Login using username: oneadmin, password: opennebula
3. Click on instances, select VMs then follow the steps to create Virtual Machine
a. Expand the + symbol
b. Select user oneadmin
c. Then enter the VM name, no.of instance, CPU.
d. Then click on create button.
e. Repeat the steps the C, D for creating more than one VMs.
9|Page
Cloud Computing Lab File (KCS751A)
Fig 8. Create Virtual Machine.
6. APPLICATIONS:
There are various applications of cloud computing in today’s network world. Many search engines
and Social websites are using the concept of cloud computing like www.amazon.com,
hotmail.com, facebook.com, linkedln.com etc. the advantages of cloud computing in context to
scalability is like reduced Risk, low cost Testing, ability to segment the customer base and auto-
scaling based on application load.
RESULT:
Thus the procedure to run the virtual machine of different configuration.
10 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
11 | P a g e
Cloud Computing Lab File (KCS751A)
4. What are the two types of virtual machines?
12 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 2 DATE:
Install a C compiler in the virtual machine created using virtual box and execute
Simple Programs
Objective:
To Install a C compiler in the virtual machine created using virtual box and execute Simple
Programs.
PROCEDURE:
1. Steps to import .ova file:
1. Open Virtual box
2. File import Appliance
3. Browse ubuntu_gt6.ova file
4. Then go to setting, select USB and choose USB 1.1
5. Then Start the ubuntu_gt6
6. Login using username: dinesh, password:99425.
APPLICATIONS:
Simply running all programs in grid environment.
13 | P a g e
Cloud Computing Lab File (KCS751A)
Codes: (To be written by the student)
14 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
3. What is %d in C?
15 | P a g e
Cloud Computing Lab File (KCS751A)
4. Write a Program to print prime numbers from 1 to 100.
16 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 3 DATE:
Install Google App Engine. Create hello world app and other simple web
applications using python/java.
Objective:
Google App Engine. Create hello world app and other simple web applications using
python/java.
Procedure:
1. Install Google Plugin for Eclipse
Read this guide – how to install Google Plugin for Eclipse. If you install the Google App
Engine Java SDK together with “Google Plugin for Eclipse“, then go to step 2, otherwise,
Get the Google App Engine Java SDK and extract it.
2. Create New Web Application Project
In Eclipse toolbar, click on the Google icon, and select “New Web Application Project…”
3. Hello World
Review the generated project directory.
17 | P a g e
Cloud Computing Lab File (KCS751A)
Fig 10. Standard Java web project structure
File: appengine-web.xml
18 | P a g e
Cloud Computing Lab File (KCS751A)
Result:
19 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
20 | P a g e
Cloud Computing Lab File (KCS751A)
3. What are different app environments?
21 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 4 DATE:
Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is
Not Present in CloudSim.
Objective:
To simulate a cloud scenario using CloudSim and run a scheduling algorithm that is not
present in CloudSim.
Steps:
CloudSim is written in Java. The knowledge you need to use CloudSim is basic Java Programming
and some basics about cloud computing. Knowledge of programming IDEs such as Eclipse or
NetBeans is also helpful. It is a library and, hence, CloudSim Does not have to be installed.
Normally, you can unpack the downloaded package in any directory, add it to the Java class path
and it is ready to be used. Please verify Whether Java is available on your system.
To use CloudSim in Eclipse:
1. Download CloudSim installable files
From https://code.google.com/p/cloudsim/downloads/list and unzip
2. Open Eclipse
3. Create a new Java Project: File -> New
4. Import an unpacked CloudSim project into the new Java Project
The first step is to initialize the CloudSim package by initializing the CloudSim library, As follows
CloudSim.init (num_user, calendar, trace flag)
5. Data centers are the resource providers in CloudSim; hence, creation of data centers is a second
step. To create Datacenter, you need the Datacenter Characteristics object that stores the properties
of a data center such as architecture, OS, list of machines, allocation policy that covers the time or
spaceshared, the time zone and its price: Datacenter datacenter9883 = new Datacenter (name,
characteristics, new VmAllocationPolicySimple(hostList), s
6. The third step is to create a broker:
DatacenterBroker broker = createBroker ();
7.The fourth step is to create one virtual machine unique ID of the VM, user ID ID of the VM’s
owner, mips, number Of amount of CPUs, amount of RAM, amount of bandwidth, amount of
storage, virtual machine monitor, and cloudlet Scheduler policy for cloudlets: Vm vm = new
Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared())
22 | P a g e
Cloud Computing Lab File (KCS751A)
Broker is starting... Entities started.
: Broker: Cloud Resource List received with 1 resource(s) 0.0: Broker: Trying to Create VM #0 in
Datacenter_0
: Broker: VM #0 has been created in Datacenter #2, Host #0 0.1: Broker: Sending cloudlet 0 to
VM #0
400.1 : Broker: Cloudlet 0 received
: Broker: All Cloudlets executed. Finishing 400.1: Broker: Destroying VM #0
Broker is shutting down... Simulation: No more future events
CloudInformationService: Notify all CloudSim entities for shutting down. Datacenter_0 is
shutting down...
Broker is shutting down Simulation completed.
Simulation completed.
Result:
The simulation was successfully executed.
23 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
1. What is the dataset for task scheduling in Cloud using CloudSim?
24 | P a g e
Cloud Computing Lab File (KCS751A)
3. What is the data set in CLoudsim?
25 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 5 DATE:
Objective:
To Use GAE launcher to launch the web applications.
Steps:
MakingyourFirstApplication
Now you need to create simple application. We could use the “+”option to have the launcher make
us an application– but instead we will do it by hand to get a better sense of what is going on.
Make a folder for your Google App Engine applications. I am going to make the Folder on my
Desktop called “apps” – the path to this folder is
C:\Documents and Settings\csev\Desktop\apps
And then make a sub-• folder in within apps called “ae-•01-•trivial” – the path to this folder would
be:
Note: Please do not copy and paste these lines into your text editor– you might
end up with strange characters – simply type them into your editor. Then create a file in the ae-
•01-•trivial folder called index.py with three lines in it:
Print 'Content-Type: text/plain ‘print ' '
Print 'Hello there Chuck'
Then start the Google App Engine Launcher program that can be found under Applications. Use
the File -•> Add Existing Application command and navigate into the apps directory and select
the ae-•01-
Trivial folder. Once you have added the application, select it so that you
Can control the application using the launcher.
26 | P a g e
Cloud Computing Lab File (KCS751A)
Once you have selected your application and press Run. After a few moments your application
will start and the launcher will show a little green icon next to your application. Then press Browse
to open a browser pointing at your application which is running at http://localhost:8080/
Paste http://localhost:8080 into your browser and you should see your application as follows:
Result:
27 | P a g e
Cloud Computing Lab File (KCS751A)
1. How many applications can I create with Google App Engine?
28 | P a g e
Cloud Computing Lab File (KCS751A)
3. How do I add a custom domain to Google App Engine?
29 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 6 DATE:
Find a procedure to transfer the files from one virtual machine to another virtual
machine.
Objective:
You can copy few (or more) lines with copy & paste mechanism.
For this you need to share clipboard between host OS and guest OS, installing Guest Addition on
both the virtual machines (probably setting bidirectional and restarting them). You copy from guest
OS in the clipboard that is shared with the host OS.
Then you paste from the host OS to the second guest OS.
PROCEDURE:
Steps:
1. Open Browser, type localhost:9869
2. Login using username: oneadmin, password: opennebula
3. Then follow the steps to migrate VMs
a. Click on infrastructure
b. Select clusters and enter the cluster name
c. Then select host tab, and select all host
d. Then select Vnets tab, and select all vnet
e. Then select datastores tab, and select all datastores
f. And then choose host under infrastructure tab
g. Click on + symbol to add new host, name the host then click on create.
4. On instances, select VMs to migrate then follow the stpes
a. Click on 8th icon, the drop down list display
b. Select migrate on that, the popup window display
c. On that select the target host to migrate then click on migrate.
30 | P a g e
Cloud Computing Lab File (KCS751A)
APPLICATIONS:
Easily migrate your virtual machine from one pc to another.
Result:
Thus the file transfer between VM was successfully completed…..
31 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
1. Which command can be used to transfer file from one server to another?
32 | P a g e
Cloud Computing Lab File (KCS751A)
3. How do I copy a VM to another VM?
33 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 7 DATE:
Find a procedure to launch virtual machine using trystack (Online Openstack Demo
Version)
Objective:
OpenStack is primarily used for deploying an infrastructure as a service (IaaS) solution
like Amazon Web Service (AWS). In other words, you can make your own AWS by using
OpenStack. If you want to try out OpenStack, TryStack is the easiest and free way to do it.
Steps:
In order to try OpenStack in TryStack, you must register yourself by joining TryStack Facebook
Group. The acceptance of group needs a couple days because it’s approved manually. After you
have been accepted in the TryStack Group, you can log in TryStack.
TryStack.org Homepage
I assume that you already join to the Facebook Group and login to the dashboard. After you log
in to the TryStack, you will see the Compute Dashboard like:
34 | P a g e
Cloud Computing Lab File (KCS751A)
Fig 15. OpenStack Compute Dashboard
35 | P a g e
Cloud Computing Lab File (KCS751A)
Fig 16. Network topology
36 | P a g e
Cloud Computing Lab File (KCS751A)
that running as the gateway to the internet.
Floating IP address is public IP address. It makes your instance is accessible from the internet.
When you launch your instance, the instance will have a private network IP, but no public IP. In
OpenStack, the public Ips is collected in a pool and managed by admin (in our case is TryStack).
You need to request a public (floating) IP address to be assigned to your instance.
1. Go to Compute > Instance.
2. In one of your instances, click More > Associate Floating IP.
3. In IP Address, click Plus [+].
4. Select Pool to external and then click Allocate IP.
5. Click Associate.
6. Now you will get a public IP, e.g. 8.21.28.120, for your instance.
OpenStack has a feature like a firewall. It can whitelist/blacklist your in/out connection. It is called
Security Group.
1. Go to Compute > Access & Security and then open Security Groups tab.
2. In default row, click Manage Rules.
3. Click Add Rule, choose ALL ICMP rule to enable ping into your instance, and then click
Add.
4. Click Add Rule, choose HTTP rule to open HTTP port (port 80), and then click Add.
5. Click Add Rule, choose SSH rule to open SSH port (port 22), and then click Add.
6. You can open other ports by creating new rules.
Result:
37 | P a g e
Cloud Computing Lab File (KCS751A)
Thus the openstack demo worked successfully.
38 | P a g e
Cloud Computing Lab File (KCS751A)
3. How do I connect to a virtual machine online?
39 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 8 DATE:
Install Hadoop single node cluster and run simple applications like word count.
Objective:
To Install Hadoop single node cluster and run simple applications like word count.
Steps:
Install Hadoop
Step 1: Click here to download the Java 8 Package. Save this file in your home directory.
Step 2: Extract the Java Tar File.
Command: tar -xvf jdk-8u101-linux-i586.tar.gz
Step 3: Download the Hadoop 2.7.3 Package.
Command: wget https://archive.apache.org/dist/hadoop/core/hadoop-2.7.3/hadoop- 2.7.3.tar.gz
Step 4: Extract the Hadoop tar File.
Command: tar -xvf hadoop-2.7.3.tar.gz
Step 5: Add the Hadoop and Java paths in the bash file (.bashrc). Open. bashrc file. Now, add
Hadoop and Java Path as shown below.
Command: vi .bashrc
Then, save the bash file and close it.
For applying all these changes to the current Terminal, execute the source command.
Command: source .bashrc
To make sure that Java and Hadoop have been properly installed on your system and can be
accessed through the Terminal, execute the java -version and hadoop version commands.
Step 6: Edit the Hadoop Configuration files.
Command: cd hadoop-2.7.3/etc/hadoop/ Command: ls
All the Hadoop configuration files are located in hadoop-2.7.3/etc/hadoop directory as you can see
in the snapshot below:
Step 7: Edit the mapred-site.xml file and edit the property mentioned below
Inside configuration tag:
40 | P a g e
Cloud Computing Lab File (KCS751A)
Mapred-site.xml contains configuration settings of Map Reduce application like number of JVM
that can run in parallel, the size of the mapper and the reducer process, CPU cores available for a
process, etc.
In some cases, mapred-site.xml file is not available. So, we have to create the mapred- site.xml
file using mapred-site.xml template.
Command: vi yarn-site.xml
Result:
Thus the Hadoop one cluster was installed and simple applications executed successfully.
41 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
42 | P a g e
Cloud Computing Lab File (KCS751A)
3. How to add a node in Hadoop cluster?
43 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 9 DATE:
44 | P a g e
Cloud Computing Lab File (KCS751A)
Output: (To be written by the student as shown on the computer screen)
45 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
1. Write a Program in C++ to Find LCM of Two Numbers using Simple Method.
46 | P a g e
Cloud Computing Lab File (KCS751A)
3. Write a Program in C++ to Find Largest Among Three Numbers.
4. Write a C++ program to add two numbers and accept them from the keyboard.
47 | P a g e
Cloud Computing Lab File (KCS751A)
Program No. : 10 DATE:
Installation and Configuration of virtualization using KVM.
Objectives:
From this experiment, the student will be able to,
• Understand the concepts of virtualization.
• Understand KVM architecture and its configuration.
Procedure:
Step 1: #sudo grep -c "svm\|vmx" /proc/cpuinfo
Step 2: #sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager
Step 3: #sudoadduserrait
After running this command, log out and log back in as rait
Step 4: #sudoadduserraitlibvirtd
After running this command, log out and log back in as rait
Step 5: Open Virtual Machine Manager Application and Create Virtual Machine
#virt-manager as shown below
Step 6: Create a new virtual machine as shown below
Step 7: Install windows operating system on virtual machine
Step 8: Installation of windows on virtual machine
Step 9: Installation of windows 7 on virtual machine
Step 10: Initialization of windows
Result:
48 | P a g e
Cloud Computing Lab File (KCS751A)
Questions and Answers
49 | P a g e
Cloud Computing Lab File (KCS751A)
3. How to connect KVM to PC?
50 | P a g e
Cloud Computing Lab File (KCS751A)