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

Ccs335 Cc Lab Manual Lab Experiments

The CCS335 Cloud Computing Lab Manual outlines a series of practical exercises for students at Stella Mary's College of Engineering, focusing on cloud architecture, virtualization, and security issues. It includes detailed instructions for installing software, creating applications, and executing various cloud-related tasks using tools like VirtualBox, Google App Engine, and Docker. The manual aims to equip students with the necessary skills to develop and manage cloud-based solutions effectively.

Uploaded by

alonedhoni26
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 views78 pages

Ccs335 Cc Lab Manual Lab Experiments

The CCS335 Cloud Computing Lab Manual outlines a series of practical exercises for students at Stella Mary's College of Engineering, focusing on cloud architecture, virtualization, and security issues. It includes detailed instructions for installing software, creating applications, and executing various cloud-related tasks using tools like VirtualBox, Google App Engine, and Docker. The manual aims to equip students with the necessary skills to develop and manage cloud-based solutions effectively.

Uploaded by

alonedhoni26
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/ 78

lOMoARcPSD|53107473

CCS335 CC lab manual - Lab Experiments

Cloud Computing (Anna University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by alone ([email protected])
lOMoARcPSD|53107473

STELLA MARY’S COLLEGE OF ENGINEERING


(Approved by AICTE, New Delhi, Affiliated to Anna University, Chennai&Accredited by NAAC)
Aruthenganvilai, Kallukatti Junction, Azhikal Post Kanyakumari District – 629 202, Tamil Nadu

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CCS335 CLOUD COMPUTING LAB MANUAL

REGULATION – 2021

SEMESTER-V
2023-2024(Odd)

LAB MANUAL

Prepared by,
Dr. M. SUPRIYA,
AP/ Dept. of CSE

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Institute Vision:

To emerge as a premiere institution, acknowledged as a center for excellence


imparting technical education, creating technocrats who can address the needs of
the society through exploration and experimentation and uplift mankind.

Institute Mission:

To provide an education that transforms students, through rigorous course-work


and by providing an understanding of the needs of the society and the industry.

Department Vision:

To produce Computer Science professionals who can accomplish path-breaking solutions


for a better society, through quality technical education, on gaining the required inter-
personal, entrepreneurial and computing skills. .

Department Mission:

To impart a holistic and experiential learning experience by making use of innovative


teaching methodologies.
To provide optimal technology solutions through collaborative and life-long learning for
industry and societal needs with universal ethical values.
To nurture leadership skills and facilitate various co-curricular and extra-curricular
activities to implant the spirit of entrepreneurship.
To provide industry-institute-interaction opportunities in order to motivate inter-
disciplinary research capabilities with an inquiring mind.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Programme Education Objectives (PEOs)

PEO1:

Graduates will be competent in creating innovative technologies through inter- disciplinary


research and comprehensive skills sets that are suitable for the global computing industry.

PEO2:

Graduates will be capable of managing leading positions with a broad understanding of the
application of ethics in evolving computer-based solutions for the societal needs.

PEO3:

Graduates will imbibe entrepreneurial qualities and develop their career by upgrading their,
communication, analytical and professional skills constantly.

Programme Specific Outcomes(PSOs)

At the completion of the programme, the students will be able to:

PSO1:

Use data management techniques and algorithmic thinking for Software Design and
Development practices.

PSO2:

Develop reliable IT solutions based on the expertise in Distributed Applications Development,


Web Designing and Networking for various societal needs and entrepreneurial practices
ethically.

PSO3:

Manage multidisciplinary environments effectively through their interpersonal and analytical


skills and be responsible members and leaders of the society.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

COURSE OBJECTIVES:
To understand the principles of cloud architecture, models and infrastructure.
To understand the concepts of virtualization and virtual machines.
To gain knowledge about virtualization Infrastructure.
To explore and experiment with various Cloud deployment environments.
To learn about the security issues in the cloud environment

COURSE OUTCOMES:

CO1: Understand the design challenges in the cloud.

CO2: Apply the concept of virtualization and its types.

CO3: Experiment with virtualization of hardware resources and Docker.

CO4: Develop and deploy services on the cloud and set up a cloud environment.

CO5: Explain security challenges in the cloud environment.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

PRACTICAL EXERCISES: 30 PERIODS

1. Install Virtualbox/VMware/ Equivalent open source cloud Workstation with different flavours

of Linux or Windows OS on top of windows 8 and above.

2. Install a C compiler in the virtual machine created using a virtual box and execute Simple

Programs

3. Install Google App Engine. Create a hello world app and other simple web applications using

python/java.

4. Use the GAE launcher to launch the web applications.

5. Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is not present

in CloudSim.

6. Find a procedure to transfer the files from one virtual machine to another virtual machine.

7. Install Hadoop single node cluster and run simple applications like wordcount.

8. Creating and Executing Your First Container Using Docker.

9. Run a Container from Docker Hub

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

NO. DATE NAME OF EXPERIMENT


1 08/08/23 Install Virtualbox/VMware/ Equivalent open source cloud
Workstation with different flavours of Linux or Windows OS
on top of windows 8 and above.

2 18/08/23 Install a C compiler in the virtual machine created using a


virtual box and execute Simple Programs

3 30/08/23 Install Google App Engine. Create a hello world app and other
simple web applications using python/java.
4 12/09/23 Use the GAE launcher to launch the web applications.

5 22/09/23 Simulate a cloud scenario using CloudSim and run a scheduling


algorithm that is not present in CloudSim.

6 5/10/23 Find a procedure to transfer the files from one virtual machine to
another virtual machine.

7 13/10/23 Install Hadoop single node cluster and run simple applications like
wordcount.

8 25/10/23 Creating and Executing Your First Container Using Docker.

9 3/11/23 Run a Container from Docker Hub

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Ex No:1
INSTALL VIRTUALBOX/VMWARE WORKSTATION

Date:

AIM:
To find the procedure to install VirtualBox/VMWARE workstation with different flavours
of Linux or Windows OS on the top of the Windows 7 or 8
PROCEDURE:
STEP1: Download the link. Download the software for Windows click and download
begins.
STEP2: Download the installer file.
STEP3: Locate the downloaded installer file.
STEP4: User Access Control Warning. In UAC dialog box, Click yes to continue. Install
splash screen will appear
. STEP5: VMware workstation setup wizard dialog box click next to continue.
STEP6: End user license Agreement. Check “I accept the terms in the license Agreement”
box and press next to continue.
STEP7: Custom setup options. Select the folder in which you would like to install the
application.
STEP8: User experience setting.
STEP9: Application shortcuts preference. Please select both the options, desktop and start
menu and click next.
STEP10: Installation begins.
. STEP11: Launch the VMware workstation and License.
STEP12: The virtualbox/VMware software is ready

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:
Thus the installation of VMware workstation with different flavour of Windows OS
on the top of Windows was successfully completed.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Ex No:2
SETTING UP C PROGRAMMING ENVIRONMENT
Date:

AIM:
To install a C program compiler in the virtual machine created using virtual box
and execute simple program.

PROCEDURE:

(i) Install Virtual Box:

1) Download Virtual box platform package for your OS.


2) Open the installation package and finish installing virtual box.
3) When finished installation, close the Window

(ii) Download Linux:

1) Download the latest version of Ubuntu(32-bit)

(iii) Install Linux Using Virtual Box:

1) Run virtual box by double clicking the icon.


2) Click “New” button on the top left corner.
3) Click “Continue” on the pop up Window.
4) Type VM name select “Linux” for the OS and choose “Ubuntu” for version.
5) Choose the amount of memory do allocate(S12 to 1024)
6) Choose create a new Virtual hard Disk.
7) Choose VDI(Virtual Box Disk Image)
8) Choose “dynamically allocated” Click continue. This way the size of you virtual hard
disk , will grow and use.
9) Click the folder and choose the Ubuntu iso file you downloaded
10) Select the size of the Virtual Disk (5GB) and click continue.
11) Click create.

(iv) Running Linux:


1) Choose Ubuntu from left column and click start.
2) Click continue on pop up Window.
3) Choose the Downloaded Ubuntu iso file and click start and install Ubuntu.
4) Check “Download” updated and click forward.
5) Choose “Erase disk and install Ubuntu”.
6) Click install when finished click restart.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

(v) C programming on Linux:


1) Open terminal.
2) Open gedit by typing “gedit&” on terminal.
3) Type the C program and save as “filename.c”.
4) Type “ls ” on the terminal to see all files under current folder.
5) Confirm that the program file in the directory.
6) Type “gcc filename.c” to compile and type “ls” to confirm that a new executable file
“a.out” is created.
7) Type “./a.out” on the terminal to run the program.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCULSION:

Thus the C compiler was installed in the virtual machine created using Virtual box
and the C program was executed successfully.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Ex No:3 INSTALLING AND RUNNING THE GOOGLE APP ENGINE


ON WINDOWS
Date:

AIM:
To install google app engine and create hello world app and other simple web
application using Python / Java.
PROCEDURE:
STEP 1: Download and install Python.
STEP 2: Download the google app engine SDK.
STEP 3: Download the Windows Installer.
STEP 4: Double click on the google App Engine Installer click through the installation
wizard and it should install the App Engine.
STEP 5: Make a folder for your google App Engine Application and then make a sub
folder called “ae-01-trivial”
STEP 6: Using a text editor such as JEdit, Create a File called app.yaml in the “ae-01-
trivial” folder with the following contents
application: ae-01-trivial
version: 1
runtime: Python
api_version:1
handlers:
-url : %*
script: index.py
Then create a folder called index.py with three lines
Print”Content-type text/Plain”
Print””

Print”Hello there”
STEP 7: Start the Google App Engine Launcher program using file-> Add existing
Application , select the ae-01- trivial folder. Once you have selected the application ;
Press Run

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

STEP 8: After a few moments, your application will start and the Launcher will
show a green icon next to it. Then press Browse do open a browser pointing
at your application which is running at http://localhost.8080/
STEP 9: Paste http://localhost.8080/ into your browser and you should see your
applications output.
STEP 10: Select your application in the Launcher and press the logs button to bring
up a log Window.
STEP 11: To shut down the server , use the launcher select you application and press
the stop button.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:

Thus the google app engine was installed and a simple application using python was
created and executed successfully.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

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.
STEP 2: Install and then initialize the Google Cloud SDK.
STEP 3: The basic structure for the project consisted of two files, namely , app.yaml
which continue the configure settings of your AppEngine application Next , the
www.directory to store all of your static files, such as HTML, CSS, image and Java Script.
STEP 4: In the google SDK shell, initialize the cloud. Then deploy your application to
AppEngine using gcloud app deploy.
. STEP 5: To view your application and launch it use the command gcloud app browse.
STEP 6: Now we can view the app with the corresponding link shown in the shell like
https://PROJECT_ID.REGION_ID_r.appspot.com.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:
Thus the web application was launched successfully using the GAE launcher.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Ex No:5 SIMULATE A CLOUD SCENARIO USING CLOUS SIM AND


RUN A SCHEDULING ALGORITHM THAT IS NOT PRESENT
IN CLOUD SIM
Date:

AIM:
To simulate a cloud scenario using clous sim and run a scheduling algorithm that is
not present in cloud sim
PROCEDURE:
STEP 1: Download the cloud sim installable files from
http://code.google.com/p/cloudsim/downloads/list and unzip
STEP 2: Open the IDE’s such as Eclipse or NetBeans in your system
STEP 3: Create a new java project
File -> New
STEP 4: Import an unpacked Cloud Sim project into the new Java project
. STEP 5: The first step is to initialize the cloud sim package by initializing the cloud
Sim Library ,as cloud Sim.init (num-user , calender , trace-flag)
STEP 6: Creation of data centers is the second step. To create datacenter, you need
the Data center characteristics object that stores the properties of data center such as OS , list
of machines,time zone etc
STEP 7: The third step is to create a broker.
DataCenter Broker broker =CreateBroker();
STEP 8: The fourth step is to create one virtual machine Unique mips, ID of the VM ,
UserID ID the VM’s owner,mips,amount of storage etc
Vm vm = new Vm (VMid ,brokerID ,mips.ped Number,ram,bw,size,vmm,new
CloudScheduler Time Shared())
STEP 9: Submit the VM list of the broker
Broker.submit Vmlist (Vmlist)
STEP 10: Create a cloud let with length , file size , output and utilization model.
Cloudlet.Cloudlet =new
cloudlet(id,length,pesNumber,filesize,outputsize,utilization,Model,Utilization mode)
STEP 11: Submit the cloud let list to the broker broker.submit Cloudlet list(Cloudlet
List)
STEP 12: Start the simulation

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Cloudsim , startSimulation()

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:

Thus a cloud scenario using Cloud Sim was simulated and a scheduling algorithm that
is not present in cloud Sim was executed and the output is verified successfully.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Ex no: 6 FIND A PROCEDURE TO TRANSFER THE FILES FROM ONE


VIRTUAL MACHINE TO ANOTHER VIRTUAL MACHINE

Date:

Aim:
To find a procedure to transfer the files from one virtual machine to another virtual machine.

Procedure:

STEP 1: You can copy dew (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.

STEP 2: You can enable drag and drop too with the same method (Click on the machine,
settings, general, advanced , drag and drop: set to bidirectional)

STEP 3: You can have common shared folders on both virtual machines and use one of the
directory shared as buffer to copy. Installing Guest Additions you have the possibility to set
shared folders too.

STEP 4: You can use usual method to copy file between two different computer with client
server application (eg: scp with sshd active for linux)

STEP 5: You can mount part of the wile system op a virtual machine via NFS or 3S HFS (or)
you can also share file and directory with samba.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:

Thus the procedure to transfer the files from one virtual machine to another virtual machine
was explained and the output is verified successfully.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Ex No:7 INSTALL HADOOP SINGLE NODE CLUSTER AND RUN


APPLICATIONS LIKE WORDCOUNT
Date:

Aim:
To install Hadoop single node cluster and run simple applications like word count.

Procedure:

STEP 1: Download the Java & package from https ://drive google.com/field /oBwIBPXSo Ix-
FIKIRN21 = MU9ZMm8/ view and save this file in your home directory.

STEP 2: Extract the Java Jar File using the command, tar-xuf jdk-swor-linux. I586. tar.gz

STEP 3: Download the Hadopp 3.7.3 package using the command wget https ://archive.
Apache.org/disk / hadopp / core/ hadap-2.7.3/ hadoop-2.7. 3. Tar.gz

STEP 4: Extract the Hadopp tur file using command bar. xvf hadoop.2.7. 3. tar.gz.

STEP 5: Add the Hadoop and Java path in the bash file, save the bash tile and close it.

STEP 6: Edit the Hadoop Configuration files using the command cd hadoop-2.7.3 / etc / Hadoop

STEP 7: Open the core site.xml and edit the property mentioned below using Vi core site.xmI

STEP 8: Edit the half site.xml and edit the property using Vi hdfs.site.xml

STEP 9: Edit the mapred site.xml file and edit the property using cp mapred-site.xmI template
mapred-site.xml and then use the command vi mapred-site. xmI

STEP 10:Edit yarn site.xml and edit the property using vi yarn- site. xml.

STEP 11: Edit hadoop.env,sh and add the Java Path using vi hadoop- env. sh

STEP 12: Go to hadoop home directory and format the NameNode

STEP 13 : Once the NameNode is formatted, go to hadoop-2.7.3 /sbin directory and start all the
demons using /startallsh

STEP 14: Once the hadoop single node cluster is installed, we can now run a simple application
like word count in it.

STEP 15: Create a new Java project and add JAR files to it.

STEP 16: Create a new package within the project with the name com. code, dezyre.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

STEP 17: Now implement the word count example program and create a Mapper class within
the word count class which extends Map Reduce Base class to implement mapper interface.

STEP 18: Finally, execute the Hadoop Map Reduce word count program.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:

Thus the program for find procedure to set up the Hadoop single node cluster and run
simple application like word count was executed successfully and the output is verified

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

E.x.No: 8
Date: Creating and Executing First Container using Docker

AIM:
To create and execute the first docker container.

PROCEDURE:
Step 1:

Clone the repository at https://github.com/docker/welcome-to-docker.

git clone https://github.com/docker/welcome-to-docker

The rest of this guide requires you to run commands in the new project directory.
Run the following command before moving on.
cd welcome-to-docker
Step 2:
Verify the docker file
Open the sample application in your IDE. Note that it already has a Dockerfile.
For your ownprojects you need to create this yourself.
Step 3:
Build Your Image
You can build an image using the following docker build command via a CLI in
your project folder.
docker build -t welcome-to-docker .
Breaking down this command
The -t flag tags your image with a name. (welcome-to-docker in this case).
And the . letsDocker know where it can find the Docker file.

Step 4 :
Run your Container
Once the build is complete, an image will appear in the Images tab. Select the
image name to see its details. Select Run to run it as a container. In the
Optional settings remember to specifya port number (something like 8089).

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

You can also run using


docker run welcome-to-docker.

Step 5:
View the output in the localhost:8080

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

OUTPUT / SCREENSHOTS:

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:

Thus, the first docker container has been created and executed successfully.

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

E.x. No: 9
Date: Run a Container from Docker Hub

AIM:
To run a container from docker hub.

PROCEDURE:

Step 1:

Sign to the docker hub. Using,

docker login

Step 2:
Pull the docker image.
docker pull hello-world
Step 3:
Run your image.
Once the build is complete, an image will appear in the Images tab. Select the
image name to see its details. Select Run to run it as a container
Also, you can run an image using the following docker run command via a CLI
in your project folder.

docker run hello-world


Step 4:
View the container. If the container worked correctly, it shows the following
message

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

OUTPUT / SCREENSHOTS:

Downloaded by alone ([email protected])


lOMoARcPSD|53107473

CONCLUSION:

Thus, the first docker image has been pulled from docker hub and ran a container
successfully.

Downloaded by alone ([email protected])

You might also like