Ccs335 Cloud Computing Lab Manual
Ccs335 Cloud Computing Lab Manual
MASTER RECORD
Prepared by Approved by
Mr. M. Ramnath, AP/AD Dr. M. Kaliappan, HoD/AD
Mr. P. Vetrivel, AP/AD
VISION AND MISSION
To accomplish its unique vision, the Institute has a far-reaching mission that aims:
To offer higher education in Engineering and Technology with highest level of quality,
Professionalism and ethical standards
To equip the students with up-to-date knowledge in cutting-edge technologies, wisdom,
creativity and passion for innovation, and life-long learning skills
To constantly motivate and involve the students and faculty members in the education
process for continuously improving their performance to achieve excellence.
2
Program Educational Objectives (PEOs)
PEO 1. Apply Artificial Intelligence and Data Science techniques with industrial standards and
pioneering research to solve social and environment-related problems for making a sustainable
ecosystems.
PEO 2. Excel with professional skills, fundamental knowledge, and advanced futuristic
technologies to become Data Scientists, Data Analyst Managers, Data Science leaders AI
Research Scientists, or Entrepreneurs.
Program Outcomes (POs)
3
Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
Individual and team work: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give and
receive clear instructions.
Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.
Life-long learning: Recognize the need for, and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.
Program Specific Outcomes (PSOs)
After successful completion of the degree, the students will be able to:
PSO 2: To create, and apply the techniques of AI and Data Science to forecast
future events in the domain of Healthcare, Education, and Agriculture,
Manufacturing, Automation, Robotics, Transport, etc
4
INSTRUCTIONS TO STUDENTS
Students should wear Uniforms and Coats neatly during the lab session
Students should maintain silence during lab hours; roaming around the lab during lab
session is not permitted
Programs should be written in the manual and well prepared for the current exercise
before coming to the session
Experiments should be completed within the Specified Lab Session
Before Every Session, Last Session lab exercise & record should be completed and get it
verified by the faculty
In the Record Note, Flow Chart and Outputs should be written on the left side, while
Aim, Algorithm & Result should be written on the right side.
Programs (Printed) should be placed on the right side
Marks for each lab exercise is awarded as follows :
Performance 25 Marks
Viva 10 Marks
Record 15 Marks
Total 50 Marks
5
CONTENTS Page No.
Syllabus 7
CO – Mapping 10
Ex.
Name of the Lab Exercises
No.
Install Virtualbox/VMware/ Equivalent open source cloud Workstation with
1.
different flavours of Linux or Windows OS on top of windows 8 and above.
Install a C compiler in the virtual machine created using a virtual box and
2.
execute
flavours
Simple
of Linux
Programs
or Windows OS on top of windows 8 and above.
Programs
Install Google App Engine. Create a hello world app and other simple web
3. 3.applications
Install Google Apppython/java.
using Engine. Create a hello world app and other simple web
applications
using
Use thepython/java.
GAE launcher to launch the web applications.
4. 4. Use the GAE launcher to launch the web applications.
5. Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is
Simulate a cloud scenario using CloudSim and run a scheduling algorithm that
not
5. is not present in CloudSim.
present in CloudSim.
6. Find a procedure to transfer the files from one virtual machine to another virtual
Find a procedure to transfer the files from one virtual machine to another virtual
6. machine.
machine.
7. Install Hadoop single node cluster and run simple applications like wordcount.
7. 8.Install
Creating and Executing
Hadoop Your
single node Firstand
cluster Container Using
run simple Docker. like wordcount.
applications
9. Run a Container from Docker Hub
Creating and Executing Your First Container Using Docker.
8.
6
CCS335 CLOUD COMPUTING LABORATORY LTPC 2023
COURSE OBJECTIVES:
LIST OF EXPERIMENTS:
Note: The lab instructor is expected to design problems based on the topics listed. The
COURSE OUTCOMES:
TOTAL: 30 PERIODS
TEXT BOOKS
1. Kai Hwang, Geoffrey C Fox, Jack G Dongarra, “Distributed and Cloud Computing, From
Parallel Processing to the Internet of Things”, Morgan Kaufmann Publishers, 2012.
7
2. James Turnbull, “The Docker Book”, O’Reilly Publishers, 2014.
3. Krutz, R. L., Vines, R. D, “Cloud security. A Comprehensive Guide to Secure Cloud
Computing”, Wiley Publishing, 2010.
REFERENCES
1. James E. Smith, Ravi Nair, “Virtual Machines: Versatile Platforms for Systems and
Processes”, Elsevier/Morgan Kaufmann, 2005.
2. Tim Mather, Subra Kumaraswamy, and Shahed Latif, “Cloud Security and Privacy: an
enterprise perspective on risks and compliance”, O’Reilly Media, Inc., 2009.
8
RAMCO INSTITUTE OF TECHNOLOGY
Semester :V
Course Objectives:
CO4: Develop and deploy services on the cloud and set up a cloud environment.
9
CO - MAPPING
10
Ex.No:1a Install Virtualbox/VMware Workstation with different flavors of linux or
Aim:
To Install Virtualbox/VMware Workstation with different flavors of linux or windows OS on top
of windows7 or 8.
Procedure:
browser. This is the website from which you'll download the VirtualBox setup file.
STEP:2 Click download virtual box. It's a blue button in the middle of the page. Doing so will open
STEP 3: Click windows host. You'll see this link below the "VirtualBox 5.2.8 platform packages"
heading. The VirtualBox EXE file will begin downloading onto your computer.
STEP:4 Open the VirtualBox EXE file. Go to the location to which the EXE file downloaded and double-
click the file. Doing so will open the VirtualBox installation window.
Navigate through the installation prompts. Do the following:
Click Next on the first three pages.
Click Yes when prompted.
Click Install
Click Yes when prompted.
Click install when prompted. Doing so will allow VirtualBox to begin installing on your computer.
Click finish when prompted. It's in the lower-right side of the window. Doing so will close
the installation window and open VirtualBox.
RESULT:
Date:
Aim:
To create a virtual machine using Virtualbox/VMware Workstation on top of windows7 or 8.
Procedure:
Step 2: Type a name for the new virtual machine. Since I am planning to install Ubuntu 14.04, I'll enter
'ubuntu1404'. Note that VirtualBox automatically changes 'Type' to Linux and 'Version' to 'Ubuntu (64 bit)'.
These two options are exactly what we
need.
Step 3: The memory size depends on your host machine memory size. In my case, I have 12GB physical
RAM. I like to allocate as much as possible for Ubuntu but leave some for my Windows host machine. I
pick 8192 MB for my Ubuntu. Note that VirtualBox will create a swap partition with the same amount
space as base memeory you have entered here. So later when you are selecting the size of the virtual hard
drive, make sure it is large enough since the hard drive will be splitted into root (/)and swap partitions. The
root partition contains by default all your system files, program settings and documents.
Step 4:Accept the default 'Create a virtual hard drive now' and click 'Create' button
Step 5:Continue to accept the default 'VDI' drive file type and click 'Next' button.
Step 6:Change the storage type from the default 'Dynamically allocated' to 'Fixed size' to increase
performance.
Step 7:For the virtual hard drive space, the default value is 8GB which is too little for RNA-Seq analysis.
I'll pick 100GB since I have plenty of space in my hard disk. You want to choose a good size for your
RNA-Seq analysis. If you realize the drive space is not large enough, you'll need to go over these steps
again to create another virtual machine.
Click 'Create' button and VirtualBox will generate Ubuntu virtual machine.
.
Make sure 'Erase disk and install Ubuntu' option is selected and click 'Install Now'
.
Ubuntu will ask you a few questions. If the default is good, click 'Continue'
b.
In 'Who are you?' dialog, enter your preferred name, username and password. Note that this user will
have root/sudo privilege. Click 'Continue' button
.
Enter the password you have chosen and press
‘Enter'.
RESULT:
Thus the installation of a virtual machine using Virtualbox/VMware Workstation on top of windows7 or 8
is done successfully.
Ex.No:2 Install a C compiler in the virtual machine created using virtual box and
Aim:
To find the procedure to install a C Compiler in the Virtual Machine and execute a C program.
INSTALLATION OF C COMPILER
Steps:
1. To install the C Compiler in the guest os, install the following package.
a. 1.Sudo apt install gcc
b. 2.Sudo apt install build-essential
c. Cd Desktop
2. open the text editor using the command touch hello.c
3. In Desktop hello. c text editor is created. Then Write a sample program in text editor and save the
program
gcc hello.c
./a.out
Result:
Aim:
To Install Google App Engine and Create hello world app and other simple web applications using
python/java.
PROCEDURE:
STEP:1
1. Download Python 3.5.8
2. Download GoogleCloudSDK
This will allow you to fork apps onto your local machine, make changes (edit and develop the app),
and deploy your app back to the cloud.
Steps:
1.Choose standard environment
2.Click Quick Start
3.click –>Download and install SDK
4.GOOGLE cloud installer .exe file downloaded in your PC.
5.Click that exe file.
6.Installation started
Note: install python and google cloud SDK IN desktop
7.Create a folder in desktop and open a notepad and type the following code and save that file in index.py
extension
index.py
print 'content-Type:text/plain';
print'';
print'hai welcome to the college';
handlers:
- url: /
script: hello.py
Thus the Google App Engine is installed successfully and a web application to display hello world using
python is developed and deployed in the GAE
Ex.No:4 Use GAE launcher to launch the web applications
Date:
AIM:
To Use GAE launcher to launch the web applications
PROCEDURE:
STEP:1 Create a new Cloud Console project or retrieve the project ID of an existing project to
use
STEP:7 This guide uses the following structure for the project:
The app.yaml file is a configuration file that tells App Engine how to map URLs to your static files.
In the following steps, you will add handlers that will load www/index.html when someone visits
your website, and all static files will be stored in and called from the www directory.
Create the app.yaml file in your application's root directory:
Create a directory that has the same name as your project ID. You can find your project ID in
the Console.
In directory that you just created, create a file named app.yaml.
Edit the app.yaml file and add the following code to the file:
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: www/index.html
upload: www/index.html
- url: /(.*)
static_files: www/\1
upload: www/(.*)
More reference information about the app.yaml file can be found in the app.yaml reference documentation.
Create an HTML file that will be served when someone navigates to the root page of your website.
Store this file in your www directory.
<html>
<head>
<title>Hello, world!</title>
<link rel="stylesheet" type="text/css" href="/css/style.css">
</head>
<body>
<h1>Hello, world!</h1>
<p>
This is a simple static HTML file that will be served from Google App
Engine.
</p>
</body>
</html>
Optional flags:
Include the --project flag to specify an alternate Cloud Console project ID to what you initialized as
the default in the gcloud tool. Example: --project [YOUR_PROJECT_ID]
Include the -v flag to specify a version ID, otherwise one is generated for you. Example: -v
[YOUR_VERSION_ID]
To learn more about deploying your app from the command line, see Deploying a Python 2 App.
RESULT:
AIM:
To Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is not present
in CloudSim
PROCEDURE:
Step 1: Link to download Eclipse and download Eclipse for Windows 64bit into your Local
machine
https://www.eclipse.org/downloads/packages/release/kepler/sr1/eclipse-ide-
java-developers
Windows x86_64
Step 2: Download cloudsim-3.0.3 from git hub repository in your local machine
https://github.com/Cloudslab/cloudsim/releases/tag/cloudsim-3.0.3
Cloudsim-3
Step 3: Download commons-maths3-3.6.1 from git hub repository in your local machine
https://commons.apache.org/proper/commons-math/download_math.cgi
Commons- maths3-3.6.1-bin.zip
Step 4: Downloaded Eclipse, cloudsim-code-master and Apache Commons Math 3.6.1 in
your local machine and extract cloudsim-3.0.3 and Apache Commons Math 3.6.1
Downloaded Files
Step 5: First of all, navigate to the folder where you have unzipped the eclipse folder and
open Eclipse.exe
Step 6: Now within Eclipse window navigate the menu: File -> New -> Project, to open the
new project wizard
Step 7: A ‗New Project‗ wizard should open. There are a number of options displayed and
you have to find & select the ‗Java Project‗ option, once done click ‘Next‗
Step 8: Now a detailed new project window will open, here you will provide the project name
and the path of CloudSim project source code, which will be done as follows:
Step 9: Unselect the ‘Use default location’ option and then click on ‘Browse’ to open the path
where you have unzipped the Cloudsim project and finally click Next to set project settings.
Step 10: Make sure you navigate the path till you can see the bin, docs, examples etc folder
inthe navigation plane.
Step 11: Once done finally, click ‘Next‘ to go to the next step i.e. setting up of project
settings
Step 12: Now open ‘Libraries’ tab and if you do not find commons-math3-3.x.jar (here ‘x’
means the minor version release of the library which could be 2 or greater) in the list then
simply click on ‘Add External Jar’ (commons-math3-3.x.jar will be included in the project
from this step)
Step 13: Once you have clicked on ‗Add External JAR’s‗ Open the path where you have
unzipped the commons-math binaries and select ‗Commons-math3-3.x.jar‘ and click on open.
Step 14: Ensure external jar that you opened in the previous step is displayed in the list and
then click on ‗Finish‘ (your system may take 2-3 minutes to configure the project)
Step 15: Once the project is configured you can open the ‗Project Explorer‗and start exploring
the Cloudsim project. Also for the first time eclipse automatically start building the workspace
for newly configured Cloudsim project, which may take some time depending on the
configuration of the computer system.
Following is the final screen which you will see after Cloudsim is configured.
Step 16: Now just to check you within the Project Explorer, you should navigate to the
examples folder, then expand the package org.cloudbus.cloudsim.examples and doubleclick
to open the CloudsimExample1.java
.
Step 17: Now navigate to the Eclipse menu Run ->Run‗ or directly use a keyboard
shortcut ‘Ctrl + F11’ to execute the CloudsimExample1.java.
Step 18: If it is successfully executed it should be displaying the following type to
output inthe console window of the Eclipse IDE.
Result:
Step 1: Link to download Eclipse and download Eclipse for Windows 64bit into your
Localmachine
https://www.eclipse.org/downloads/packages/release/kepler/sr1/eclips
e-ide-java-developers
Windows x86_64
https://github.com/shiro873/Cloudsim-Code
Step 3: Download commons-maths3-3.6.1 from git hub repository in your local
machinehttps://commons.apache.org/proper/commons-
math/download_math.cgi
Commons-maths3-
3.6.1-bin.zip
Downloaded Files
Step 5: First of all, navigate to the folder where you have unzipped the eclipse
folder andopen Eclipse.exe
Step 6: Now within Eclipse window navigate the menu: File -> New -> Project, to
open thenew project wizard
Step 7: A New Project wizard should open. There are a number of options displayed
andyou have to find & select the Java Project option, once done click ‘Next’
Step 8: Now a detailed new project window will open, here you will provide the project
nameand the path of CloudSim-master-code project source code, which will be done as
follows:
Step 10: Make sure you navigate the path till you can see the bin, docs, examplesetc
folder inthe navigation plane.
Step 11: Once done finally, click Next‘ to go to the next step i.e. setting up of project
settings
Step 12: Once the project is configured you can open the Project Explorer and start
exploring the Cloudsim project. Also for the first time eclipse automatically start
building the workspace for newly configured Cloudsim project, which may take some
time depending on the configuration of the computer system.
Following is the final screen which you will see after Cloudsim is configured.
Step 13: Now just to check you within the Project Explorer, you should navigate to the
src folder, then expand the package default package and double click to open the
RoundRobin.java.
Step 14: Now navigate to the Eclipse menu ‗Run ->Run or directly use a keyboard
shortcut ‘Ctrl + F11’ to execute the ‘RoundRobin.java‘. If it is successfully executed it
should be displaying the following type to output in the console window of the Eclipse
IDE.
Result:
Thus the scheduling algorithm is executed in cloudsim is simulated using EclipseEnvironment successfully .
Ex.No:6 Find a procedure to transfer the files from one virtual machine to another
Date: virtual machine.
AIM:
To Find a procedure to transfer the files from one virtual machine to another virtual machine.
PROCEDURE
There are three ways to transfer the files from one virtual machine to another virtual machine
If you're using VirtualBox, with your virtual machine running, select Devices > Drag and Drop. Here,
you can choose from Host to Guest, Guest to Host, and Bidirectional. There's also the default option,
Disabled. For the best results, use Bidirectional.
To be able to access USB devices from within VirtualBox, you'll need to enable USB access.
For this, the VirtualBox Extension Pack is required
from www.virtualbox.org/wiki/Downloads.
Once you've done that, insert the USB device you wish to use. Next, open VirtualBox and
click File > Preferences, then Extensions and click +. Browse to the downloaded Extension
Pack, click Open, then when prompted, Install. Follow the prompts to complete the process.
You can then check to confirm USB is enabled in Settings > USB
RESULT:
Thus the procedure to transfer the files from one virtual machine to another virtual machine is
executed successfully.
Ex.No:8 Install Hadoop single node cluster and run simple applications like wordcount.
Date:
Aim:
1.HADOOP:
Apache Hadoop is an open-source software framework for storage and large-scale
processing of data-sets on clusters of commodity hardware. Hadoop is an Apache top-level
project being built and used by a global community of contributors and users. It is licensed under
the Apache License 2.0.
The Apache Hadoop framework is composed of the following modules:
Hadoop Common – contains libraries and utilities needed by other Hadoop modules
Hadoop Distributed File System (HDFS) – a distributed file-system that stores data on
commodity machines, providing very high aggregate bandwidth across the cluster.
Hadoop YARN – a resource-management platform responsible for managing compute
resources in clusters and using them for scheduling of users' applications.
Hadoop MapReduce – a programming model for large scale data processing.
InstallationSteps:
Aim:
To find procedure to set up the one node Hadoop cluster.
Procedure:Step 1:
SSH Server accepting password authentication (at least for the setup time). To install, run:
student@a4cse196:~$ suPassword:
root@a4cse196:/home/student# apt-get install openssh-server
Step 3:
| .... |
| o. E |
| oB.o |
| +*+. |
| .S+. |
| .o=. |
| .=+ |
| o=. |
| ..o |
+ +
Step 4:
If the master also acts a slave (`ssh localhost` should work without a password)
root@a4cse196:/home/student# cat $HOME/.ssh/id_rsa.pub
>>$HOME/.ssh/authorized_keys Step 5:
Create hadoop group and user:
passwd: password updated successfully Changing the user information for hadoop
Enter the new value, or press ENTER for the default Full Name []:
Room Number []:Work Phone []: Home Phone []: Other []:
Is the information correct? [Y/n] y root@a4cse196:/home/student#
Step 6:
Copy your .tar file to home.(hadoop-2.7.0.tar.gz)
Step 7:
Step 8:
Step 9:
Step 11:
Step 13:
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
Step 14:
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
Step 15:
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
</configuration>
Step 16:
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
Step 18:
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/var/lib/hadoop/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/var/lib/hadoop/hdfs/datanode</value>
</property>
</configuration>
Step 19:
Step 20:
Step 21:
yes
yes
start-yarn.sh root@a4cse196:/home/hadoop# jps 6334 SecondaryNameNode
6498 ResourceManager
6927 Jps
6142 DataNode
5990 NameNode
6696 NodeManager
Step 22:
Browse the web interface for the Name Node; by default it is available at:
http://localhost:50070
Result:
Thus the procedure to set up the one node Hadoop cluster was successfully done and verified
Exp.No: 8 Creating and Executing Your First Container Using Docker
Aim:
To create and execute first contained using Docker.
Procedure:
We will install WSL2 on windows machine manually.
Open power shell in Admin mode.
Note: To use WSL2 below mentioned OS Build is needed.
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel For
information on key differences with WSL 2 please visit https://aka.ms/wsl2
5. Install Ubuntu app from windows store:
Open the Microsoft Store and install Ubuntu 20.04 LTS here
6. Install windows terminal
It enables multiple tabs, quickly between the Linux command line and the windows
command prompt.
Open Installed, “Ubuntu 20.04 LTS” once, So that it will be linked with Windows
terminal.
After following step 2 then Ubuntu will be registered with Windows Terminal.
8. Updating and installing basic packages for Ubuntu. sudo apt
update && sudo apt upgrade
1. Go to Settings
2. Resources
3. WSL integration
4. Enable Ubuntu-20.04
5. Then hit Apply & restart
6. This may take few minutes
7. After Enabling this we will get docker in the ubuntu command line
After running above command most of common required packages will be in installed. We need to make
sure below following packages will be installed.
cURL
Check if cURL already exists
curl -v
If
cURL doesn't exists then install it via following command
sudo apt-get install curl
Go
Check if Go lang exists
go version
If Go doesn't then install with following steps: Download the Go lang package for Linux from here.
sudo wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
The following command will extract the zip file at the downloaded location
Docker
Doker we have already installed in the previous section and with help of WSL. Run the
following command to verify it
`docker --version`
docker-compose --version
Git
Run the following command to if git is installed
git –version
Download the latest release of fabric samples and docker images. The
following link will clone Fabric-samples located at
https://github.com/hyperledger/fabric-samples
Run following command under $HOME/go/src/github.com/ directory
curl -sSL https://bit.ly/2ysbOFE | bash -s
After running below respective images will be downloaded to docker
Note: if you don't have installed vscode it will install first then you need to run
same command again
Result:
Thus creating and executing your first container using Docker is done successfully.
Exp.No: 9 Run a Container from Docker Hub
Aim:
To run a container from Docker Hub.
Procedure:
Open windows terminal and navigate to fabric folder
cd $wsl
cd go/src/github.com/fabric-samples
Go to test-network
cd test-network
Run following command to remove existing any container or artifacts form previous run.
./network.sh down
Running following will boot up fabric test network
./network.sh up
Run following command to list down all running docker images in docker
docker ps -a
Same you can look at docker GUI
Result:
Thus a container from Docker Hub was executed successfully.
Exp.No: 10 Creating Virtual Machine using Open Nebula
Aim:
To Install Virtualbox / VMware Workstation with different flavours of linux or windowsOS on top of
windows 10 through open Nebula.
PROCEDURE:
Steps to install Virtual Box:
1. Download the Virtual box exe and click the exe file…and select next button..
2. Click the next button..
3. Click the next button
4. Click the YES button..