0% found this document useful (0 votes)
629 views

Ccs335 Cloud Computing Lab Manual

Uploaded by

953622243023
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)
629 views

Ccs335 Cloud Computing Lab Manual

Uploaded by

953622243023
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/ 95

CCS335-CLOUD COMPUTING LABORATORY

MASTER RECORD

B.Tech. Artificial Intelligence and Data Science


III Year / V Semester
Regulation-2021

Department of Artificial Intelligence and Data Science

RAMCO INSTITUTE OF TECHNOLOGY


Rajapalayam – 626 117,
Tamil Nadu.

Prepared by Approved by
Mr. M. Ramnath, AP/AD Dr. M. Kaliappan, HoD/AD
Mr. P. Vetrivel, AP/AD
VISION AND MISSION

Vision of the Institute

To evolve as an Institute of international repute in offering high-quality technical education,


Research and extension programmes in order to create knowledgeable, professionally competent
and skilled Engineers and Technologists capable of working in multi-disciplinary environment
to cater to the societal needs.

Mission of the Institute

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.

Vision of the Department

To impart international quality education, promote collaborative research and graduate


industry-ready engineers in the domain of Artificial Intelligence and Data Science to serve the
society.

Mission of the Department

 Excel in Teaching-Learning process and collaborative Research by the use of modern


infrastructure and innovative components.
 Establish an Artificial Intelligence and Data Science based centre of excellence to
prepare professional technocrats for solving interdisciplinary industry problems in
various applications
 Motivate students to emerge as entrepreneurs with leadership qualities in a societal
centric programme to fulfil Industry and community needs with ethical standards.

2
Program Educational Objectives (PEOs)

After successful completion of the degree, the students will be able to

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)

Engineering Graduates will be able to:

 Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex engineering
problems.
 Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
 Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
 Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.
 Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex engineering
activities with an understanding of the limitations.
 The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.
 Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and
need for sustainable development.

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 1: To apply analytic technologies to arrive at actionable foresight, Insight,


hindsight from data for solving business and engineering problems

 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

 PSO 3: To enrich the critical thinking skills in emerging technologies such as


Hybrid Mobile application development, cloud technology stack, and cyber-
physical systems with mathematical aid to foresee the research findings and
provide the solutions

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

Course Objectives and Outcomes 9

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.

9. Run a Container from Docker Hub.

CONTENT BEYOND SYLLABUS

10. Creating Virtual Machine using Open Nebula.

6
CCS335 CLOUD COMPUTING LABORATORY LTPC 2023

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.

LIST OF EXPERIMENTS:

Note: The lab instructor is expected to design problems based on the topics listed. The

Examination shall not be restricted to the sample experiments designed.

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

COURSE OUTCOMES:

At the end of the course, the student should be able to:

CO1: Explain the design challenges in the cloud technologies.


CO2: Apply the concept of virtualization and its types to create virtual Machine.
CO3: Apply virtualization of hardware resources and Docker to store and manage the application.
CO4: Develop and deploy the services on the cloud and set up a cloud environment.
CO5: Explain security challenges in the cloud environment.
CO6: Apply the cloud technologies to develop the applications using given problem.

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

Department of Artificial Intelligence and Data Science

Academic Year: 2023- 2024 (Odd Semester)

Course Objectives and Outcomes

Degree, Semester& Branch : B.TECH Artificial Intelligence and Data Science

Semester :V

Course Code & Title : CCS335-CLOUD COMPUTING LABORATORY

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:
At the end of the course, the student should be able to:

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.

CO6: Explain Identity Access Management Architecture and its practices.

9
CO - MAPPING

S No Name of the Lab Exercises COs


Install Virtualbox/VMware/ Equivalent open source cloud Workstation

with different flavours of Linux or Windows OS on top of windows 8 CO1


1
and above.
Install a C compiler in the virtual machine created using a virtual box
2 CO2
andflavours
executeofSimple
Linux Programs
or Windows OS on top of windows 8 and above.
Install Google App Engine. Create a hello world app and other simple
Programs CO4
3
3.web applications
Install Google App using python/java.
Engine. Create a hello world app and other simple
web applications
Use the GAE launcher to launch the web applications. CO4
4 using python/java.
4. Use the GAE launcher to launch the web applications.
Simulate a cloud scenario using CloudSim and run a scheduling
5.algorithm
Simulate that
a cloud scenario CO3
5 is not presentusing CloudSim and run a scheduling
in CloudSim.
algorithm that is not
present
Find in CloudSim.
a procedure to transfer the files from one virtual machine to CO3
6 6.another
Find a procedure to transfer the files from one virtual machine to
virtual machine.
another virtual machine.
7 7.Install
InstallHadoop
Hadoopsingle
singlenode
nodecluster
clusterand
andrun
runsimple
simpleapplications
applicationslike
like CO4
wordcount.
wordcount.
8 8.Creating
CreatingandandExecuting
ExecutingYourYourFirst
FirstContainer
ContainerUsing
UsingDocker.
Docker. CO3
9. Run a Container from Docker Hub
CO3
Run a Container from Docker Hub.
9

CONTENT BEYOND SYLLABUS

10. Creating Virtual Machine using Open Nebula. CO5

10
Ex.No:1a Install Virtualbox/VMware Workstation with different flavors of linux or

Date: windows OS on top of windows7 or 8.

Aim:
To Install Virtualbox/VMware Workstation with different flavors of linux or windows OS on top
of windows7 or 8.
Procedure:

STEP:1 Open the VirtualBox website. Go to https://www.virtualbox.org/ in your computer's Internet

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

the downloads page.

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:

Thus the oracle VM Virtual box is installed in windows.


Ex.No:1b INSTALLATION OF VIRTUAL MACHINE

Date:

Aim:
To create a virtual machine using Virtualbox/VMware Workstation on top of windows7 or 8.

Procedure:

Step:1.Click 'New' button to open a


dialog.

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.

Now the virtual machine is created.


 We are ready to install Ubuntu in this virtual machine. Select your new virtual machine and click
'Settings' button. Click on 'Storage' category and then 'Empty' under Controller:IDE. Click
"CD/DVD" icon on right hand side and select the ubuntu ISO file to mount.
 Note that if you have not downloaded 64-bit Ubuntu ISO file, down load it and When
downloading Ubuntu ISO file, make sure to selecte 64-bit version.
.
 VirtualBox may pop up a message about 'Auto capture keyboard' option. Read the message there
and check 'Do not show this message again' option before clicking OK.
Install Ubuntu
Back to Oracle VM VirtualBox Manager, click on the new Ubuntu virtual machine and hit 'Start' button.
Now you shall see a 'Welcome' screen. Click 'Install Ubuntu' button. Note that the installation process may
differ a little bit from version to version. The screenshots here are based on Ubuntu
14.04.1.
Click 'Continue'

.
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

The installation will continue until it is finished.


After installation is complete, click 'Restart Now' button. When you see a screen with a black background
saying 'Please remove installation media and close the tray (if any) then press ENTER:', just follow

.
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

Date: execute Simple Programs

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

4.Compile the C program using the compiler installed.

gcc hello.c

5.Run the object file and get the output.

./a.out
Result:

Thus the C Compiler is installed successfully and executed a sample C program.


Ex.No:3 Install Google App Engine. Create hello world app and other simple
web applications using python/java.
Date:

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.

3. Set the Python path in the Google App Engine launcher


After downloading the SDK, launch the App Engine launcher, go to Edit -> Preferences and make
sure you set the path for where you installed Python in step 1 above.

STEP 2. APP ENGINE SIGN-UP

1. Install python latest version


2. cloud.google.com/appengine/docs/python
Click python 3.8 or 3.9

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';

8.Open a notepad type the following code and save app.yaml


App.yaml
runtime: python27
api_version: 1
threadsafe: false

handlers:
- url: /
script: hello.py

9. Open the google cloud SDK shell


10. Give the commands like C:\Users\Ranjith\AppData\Local\Google\Cloud SDK>google-cloud-
sdk\bin\dev_appserver.py "C:\Users\Ranjith\Desktop\MY CLOUD PROGRAM"
RESULT:

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:2 Go to the project page

STEP:3 Install and then initialize the Google Cloud SDK


STEP:4 Download SDK

STEP:5 Creating a website to host on Google App Engine

STEP:6 Basic structure for the project

STEP:7 This guide uses the following structure for the project:

 app.yaml: Configure the settings of your App Engine application.


 www/: Directory to store all of your static files, such as HTML, CSS, images, and JavaScript.
 css/: Directory to store stylesheets.
 style.css: Basic stylesheet that formats the look and feel of your site.
 images/: Optional directory to store images.
 index.html: An HTML file that displays content for your website.
 js/: Optional directory to store JavaScript files.
 Other asset directories.

STEP: 8 Creating the app.yaml file

 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.

STEP: 9 creating the index.html file

 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>

STEP: 10 Deploying your application to App Engine


 When you deploy your application files, your website will be uploaded to App Engine. To deploy
your app, run the following command from within the root directory of your application where
the app.yaml file is located:
 gcloud app deploy

 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.

STEP: 11 Viewing your application

 To launch your browser and view the app at https://PROJECT_ID.REGION_ID.r.appspot.com, run


the following command:
gcloud app browse

RESULT:

Thus a GAE launcher is used to launch the web applications


Ex.No:5a Simulate a cloud scenario using CloudSim
Date:

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:

Project Name: CloudSim.

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:

Thus the cloudsim is simulated using Eclipse Environment successfully.


Ex No. 5 b Simulate a cloud scenario using CloudSim and running a scheduling
Date: algorithm

Procedure to import Eclipse, running scheduling algorithms in your system

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

Step 2: Download scheduling source code cloudsim-code-master from git hub


repository in your local machine

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

Step 4: Downloaded Eclipse, cloudsim-3.0.3 and Apache Commons Math 3.6.1 in


your localmachine 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 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:

Project Name: CloudSim


Step 9: Unselect the ‘Use default location’ option and then click on ‘Browse’ to open
the path where you have unzipped the Cloudsim-code-master project and finally click
Next to set projectsettings.

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

 Copy and paste


 USB drive
 Network share

STEP 1.Copy And Paste Data In VirtualBox

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.

STEP 2:Share Files From A USB Stick In VirtualBox

 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

STEP 3. Create A Share In VirtualBox


 You should have already downloaded VirtualBox Guest Additions. This should be installed
via Devices > Install Guest Additions, where you should browse for the appropriate EXE file.
Follow the steps to the end, choosing the default options, then Finish.
 Launch VirtualBox and open Devices > Shared Folders > Shared Folders Settings. Click +,
then in Folder Path click the arrow and select Other. Browse (the host OS) for the folder you're
using as a share, highlight it, then Select Folder.in the Add Share window, give the share a
name (keeping the same name in the guest OS as in the host OS is wise).
 Check Auto-mount and Make permanent, then OK.

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:

To find the procedure to set up the one node Hadoop cluster.

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:

Installing Java is the main prerequisite for Hadoop. Install java1.7.

$sudo apt-get update


$sudo apt-get install openjdk-7-jdk
$sudo apt-get install openjdk-7-jre
$ java -version

java version "1.7.0_79"

OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1) OpenJDK 64-


Bit Server VM (build 24.79-b02, mixed mode)
Step 2:

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:

Generate the ssh key


root@a4cse196:/home/student# ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa

Generating public/private rsa key pair. Created directory '/root/.ssh'.


Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in
/root/.ssh/id_rsa.pub.

The key fingerprint is: 77:a1:20:bb:db:95:6d:89:ce:44:25:32:b6:81:5d:d5 root@a4cse196 The


key's random art image is:
+--[ RSA 2048] ---+

| .... |
| 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:

Step 5.1 root@a4cse196:/home/student# sudo addgroup hadoop

Adding group `hadoop' (GID 1003) ... Done.


Step 5.2 root@a4cse196:/home/student# sudo adduser --ingroup hadoop hadoop

Adding user `hadoop' ...


Adding new user `hadoop' (1003) with group `hadoop' ... Creating home directory
`/home/hadoop' ...
Copying files from `/etc/skel' ... Enter new UNIX password:

Retype new UNIX password:

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:

Extracting the tar file.

root@a4cse196:/home/student# sudo tar -xzvf hadoop-2.7.0.tar.gz -C /usr/local/lib/

Step 8:

Changing the Ownership

root@a4cse196:/home/student# sudo chown -R hadoop:hadoop /usr/local/lib/hadoop-2.7.0

Step 9:

Create HDFS directories:

root@a4cse196:/home/student# sudo mkdir -p /var/lib/hadoop/hdfs/namenode


root@a4cse196:/home/student# sudo mkdir -p /var/lib/hadoop/hdfs/datanode
root@a4cse196:/home/student# sudo chown -R hadoop /var/lib/hadoop
Step 10:

Check where your Java is installed: root@a4cse196:/home/student# readlink -f /usr/bin/java


/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

Step 11:

Open gedit and do it root@a4cse196:/home/student# gedit ~/.bashrc Add to ~/.bashrc file:


export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 export
HADOOP_INSTALL=/usr/local/lib/hadoop-2.7.0 export
PATH=$PATH:$HADOOP_INSTALL/bin
export PATH=$PATH:$HADOOP_INSTALL/sbin
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL export
YARN_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib/native"
Step 12:
Reload source
root@a4cse196:/home/student# source ~/.bashrc

Step 13:

Modify JAVA_HOME in /usr/local/lib/hadoop-2.7.0/etc/hadoop/hadoop-env.sh:


root@a4cse196:/home/student# cd /usr/local/lib/hadoop-2.7.0/etc/hadoop
root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit hadoop-env.sh export
JAVA_HOME=${ JAVA_HOME}
Changed this to below path

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

Step 14:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/core-site.xml to have something like:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit core-site.xml
<configuration>

<property>

<name>fs.default.name</name>

<value>hdfs://localhost:9000</value>

</property>

</configuration>

Step 15:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/yarn-site.xml to have something like:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit yarn-site.xml

<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:

Create /usr/local/lib/hadoop-2.7.0/etc/hadoop/mapred-site.xml from template:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# cp /usr/local/lib/hadoop-
2.7.0/etc/hadoop/mapred-site.xml.template /usr/local/lib/hadoop-2.7.0/etc/hadoop/mapred-
site.xml
Step 17:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/mapred-site.xml to have something like:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit mapred-site.xml

<configuration>

<property>

<name>mapreduce.framework.name</name>

<value>yarn</value>

</property>

</configuration>

Step 18:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/hdfs-site.xml to have something like:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit hdfs-site.xml
<configuration>

<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:

Make changes in /etc/profile

$gedit /etc/profile JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64


PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME export PATH
$source /etc/profile

Step 20:

root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# hdfs namenode –format

Step 21:

Switch to hadoop user


start-dfs.sh

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

Create the HDFS directories:

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.

1. Enable windows SubSystem for Linux


dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem Linux /all /norestart
After running above command to verify that Windows subsystem is enabled refer to below image

2. Enable Virtual Machine feature


dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all
/norestart
After running above command to verify that Virtual machine platform is enabled refer to below image.

3. Download linux kernel update package:


To update the WSL package download setup at the below-mentioned link, it needs admin privilege.
WSL2 Linux kernel update package for x64 machines
4. Set WSL-2 as default version
wsl --set-default-version 2

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.

Note: Above terminal is a utility and it is very productive.


7. Ubuntu command line setup:
Note: You have to run the Windows terminal with Administrator rights.Open Windows Terminal and
add a new ubuntu tab, you won’t be able to see the ubuntu terminal.
Under add new terminal section.

 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

9. Docker Installation on Windows


System requirement for docker installation on windows 10 OS builds version 1903 or higher.
we have already enabled WSl2 on windows refer steps 1-4
 Virtualization should be enabled on the windows machine, most of it supports

 Download Docker for windows latest version from here


 Install Docker

 Open docker and it will be running in apptray


 To check docker version run following below command
docker –version
docker-compose --version

10. Enable Docker for ubuntu

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

8. Run following command to check if you are able to access it on Ubuntu


docker –version
docker-compose --version

11. Hyperledger fabric installation on Linux(Ubuntu)


Run following command to install and update basic packages on Ubuntu
sudo apt update
sudo apt upgrade

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

tar xvf go1.16.3.linux-amd64.tar.gz


Set GOPATH using following command
export GOPATH=$HOME/go
export PATH = $PATH:$GOPATH/bin

Run the following command to verify that Go lang is installed successfully


go version

 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

12. Install Hyperledger Fabric and Fabric samples


Note: Hyperledger fabric version is 2.3.2
 Create a directory with following command
Creates a new Directory: mkdir -p $HOME/go/src/github.com/
Navigate to that created directory: cd $HOME/go/src/github.com/

 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

 After downloading, your folder structure looks like below

 Open folder in your favourite editor, mine is vscode simply


run following command
code .

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..

5. Click the install button…


6. Then installation was completed..the show virtual box icon on desktop screen….

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.

Steps to create Virtual Machine through opennebula


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 Virtaul 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.
Result:
Thus the procedure to run the virtual machine of different configuration using open Nebula was
done successfully.

You might also like