0% found this document useful (0 votes)
113 views61 pages

CC Final 2

Uploaded by

akileshwari R
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)
113 views61 pages

CC Final 2

Uploaded by

akileshwari R
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/ 61

KATHIR COLLEGE OF ENGINEERING

“WISDOM TREE“,

NEELAMBUR, COIMBATORE - 641 062.


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
LABORATORY RECORD

NAME OF THE STUDENT : SIVASAMY E

REG. NO :711619104046

NAME OF THE LABORATORY : CS8711 CLOUD COMPUTING LAB

SEMESTER :VII

YEAR :2022-2023
KATHIR COLLEGE OF ENGINEERING
ISO 9001

“WISDOM TREE“,
NEELAMBUR, COIMBATORE - 641 062.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Bonafide Certificate

This is to certify that the record work for CS8711- CLOUD COMPUTING
Laboratory is the bonafide record of work done by

Mr./Ms .................................................................................. ,Reg.No...............................


in VII Semester of B.E Computer Science and Engineering during the
academic year 2022 -2023.

Staff in-Charge HOD

Submitted for the Practical Examination held on .........................

Internal Examiner External Examiner


TABLE OF CONTENTS

S.NO. DATE EXPERIMENT TITLE MARKS SIGN.

Install Virtualbox / VMware Workstation with


different flavours of linux or windows OS on top of

1. windows7 or 8.

Install a C compiler in the virtual machine created


using virtual box and execute Simple Programs
2.

Install Google App Engine. Create hello world app


and other simple web applications using
3.
python/java.

Use GAE launcher to launch the web applications.

4.

Simulate a cloud scenario using CloudSim and run


a scheduling algorithm that is not present in

5. CloudSim.

Find a procedure to transfer the files from one

6. virtual machine to another virtual machine.

7. Find a procedure to launch


virtual machine using trystack (Online Openstack
Demo Version)

Install Hadoop single node cluster and run simple

8. applications like wordcount.


711619104046

EX NO. : 1
DATE:
Install Virtualbox / VMware Workstation with different flavours of linux or
windows OS on top of windows7 or 8.

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

PROCEDURE:

Steps to install Virtual Box:


1. Download the Virtual box exe and click the exe file...and select next button.

TjJ Oracle VM VirtualBox 5.020 Setup

Welcome to the Oracle VM VirtualBox 5.0.20


Setup Wizard
The Setup Wizard will install Orade VM VirtualBox 5.0.20 on your computer. Click Next to continue or
Cancel to exit the Setup Wizard.

Cancel

Version 5.0.20

2. Click the next button..


3. Click the next button

jvp Oracle VM VirtualBox 5.0.20 Setup


Custom Setup
Select the way you want features to be installed.

Please choose from the options below:

0 Create a shortcut on the desktop

0 Create a shortcut in the Quick Launch Bar

0 Register file associations

Version 5.0.20

4. Click the YES button..


711619104046

Oracle VM VirtualBox 5.0.20 Warning:


Network Interfaces

Installing the Oracle VM VirtualBox 5.0.20 Networking feature


will reset your network connection and temporarily disconnect
you from the network.

Proceed with installation now?

Version 5.0.20

5. Click the install button ...

j£l Oracle VM VirtualBox 5.020 Setup

Ready to Install

The Setup Wizard is ready to begin the Custom installation.

Click Install to begin the installation. If you want to review or change any of your installation settings, dick Back. Click Cancel to exit the wizard.

Version 5.0.20

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

APPLICATIONS:
There are various applications of cloud computing in today’s network world. Many search
engines and so websites are using the concept of cloud computing like
www.amazon.com,hotmail.com, facebook. linkedln.com c etc. the advantages of cloud computing
in context to scalability is like reduced risk , low cost te ,ability to segment the customer base and
auto-scaling based on application load.

RESULT:
Thus the procedure to run the virtual machine of different
configuration.
711619104046

EX.NO.:2
DATE:
Install a C compiler in the virtual machine created using virtual box and
execute Simple Programs

Aim:
To Install a C compiler in the virtual machine created using virtual box and execute
Simple Programs'

PROCEDURE:

Steps to import .ova file:


1. Open Virtual box
2. File -> import Appliance
3. Browse ubuntu_gt6.ova file
4. Then go to setting, select Usb and choose USB 1.1
5. Then Start the ubuntu_gt6
6. Login using username: dinesh, password:99425.

Steps to run c program:

1. Open the terminal


711619104046

2. Type cd /opt/axis2/axis2-1.7.3/bin then press enter


3. gedit hello. c
4. gcc hello.c
5. ./a.out

1. Type cd /opt/axis2/axis2-1.7.3/bin then press enter

2. Type gedit first.c


711619104046

3. Type the c program

4. Running the C program


711619104046

5. Display the output:

Terminal
O dlnesh(g>dlnesh-VlrtualBox: /opt/axis2/axls2-1.7.3/bin
dinesh9dtnesh-VtrtualBox:/opt/axis2/axts2-1.7.3/bin$ gcc first.c dtneshQdtnesh-VtrtualBox:/opt/axts2/axis2-
1.7.3/btn$ ./a.out Enter two number:
65
23
The addition of a and b:88 dtneshgdtnesh-VtrtualBox:/opt/axis2/axts2-l.7.3/bin$ |

APPLICATIONS:
Simply running all programs in grid environment.

RESULT:

Thus the simple C programs executed successfully in the


virtual machine using virtual box.
711619104046

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

Aim:
To Install Google App Engine. Create hello world app and other simple
webApplications using python/java.

☆ ☆☆☆☆

Send feedback

Procedure:

Serverless computing > App Engine > Documentation

Google App Engine Documentation


App Engine is a fully managed, serverless platform for developing and hosting web applications at scale. You can choose from several popular languages, libraries,

and frameworks to develop your apps, then let App Engine take care of provisioning servers and scaling your app instances based on demand.

Pick a language to learn more.

Go PHP Java
View docs View docs View docs

w
Python Node.js .NET
.NET
View docs View docs View docs

Ruby
View docs
0 More languages
View custom runtime docs
711619104046

1. Click View Docs Python 3.7

2. Click Quick Start

-> c 0 ■ cloud.google.com inppnginp/docs/standard/pyttiont

★ Bookmarks 0 Maps (s) WhatsApp TR Download and Wat.. © Advances in Comp.-

Google Cloud Why Google Solutions Products Pricing Getting Started Q, Docs Support

Serverless computing Guides Reference Support Resources Contact Sales

☆ ☆☆☆☆
Serverless computing > App Engine > Documentation > Standard Environment > Python 3
Google App Engine

Documentation Product Overview


Google App Engine Python 3 Standard Send feedback

Python 3 Standard Environment

Quickstart
Environment documentation
» Building an App Migrating from

Python 2.7 IZ

Python 3 apps in the App Engine standard environment run within containers inside of secure sandboxes. Your apps scale automatically to
How-to Guides All How-to Guides
meet traffic demand.
» SettmgUp

►Designing Your App

► Securing
0 Quickstart Ej How-to guides < > APIs and reference
Your App
Deploy your first app Learn a task
API, Configuration Files,
» Defining Configuration Files App Engine Glossary
Testing and Deploying Your App

► Debugging Your App Installing


Google Cloud Client Libraries
» Storing Data and Files Caching d Concepts B Tutorials Resources
data with Memorystore Develop a deep understanding Walkthroughs of common Pricing, quotas, and release notes
of Python 3 standard applications
Authenticating Users environment
» Using a Custom Domain

» Managing Your App's Traffic


711619104046

3. Download the Cloud SDK

4. Click on Quickstarts (Install and initialize Cloud SDK)


711619104046

5. Click and install “Getting started with Cloud SDK”

Google Cloud Why Google Solutions Products Pricing Getting Started

Cloud SDK
Documentation
Product overview gcloud CLI Developer tools > Cloud SOK: Command Line Interface > Documentation ☆☆☆☆☆

overview gcloud CLI cheat sheet


Quickstarts ' “
s nd, dback
Quickstarts
All quickstarts
Gening started with Cloud SDK

How-to guides Getting started with Cloud SDK


All how-to guides Install and initialize Cloud SOK and run a few gcloud
commands.
» Installing the SDK
» Setting up the SDK
Managing SDK components
Scripting guidelines
Enabling accessibility features
Using gcloud interactive shell X
Uninstalling the Cloud SDK Was this page
helpful?

Developer tools Guides Reference Support Resources Send feedback

6. Click on Download the “Cloud SDK installer” for Windows

7. Install the Google Cloud SDK Setup


8. Google Cloud SDK will show up. Initialize for the first use by giving y
(yes)
711619104046

9. Login with your google account

10. Give access to Google Cloud SDK by clicking “Allow”


11 .Now you are authenticated with the Google Cloud SDK (minimize
this and proceed further)

O Google Cloud Why Google

Developer tools

Cloud SDK Tabl<


Documentation Infor
Product overview gcloud CLI overview Mil
Developer tools > Cloud SDK Command Line Interface > Documentation & iCf Tutot
gcloud CLI cheat sheet
Feed

Quickstarts
You are now authenticated with the Google sondh^k

All quickstarts Cloud SDK!


Getting started with Cloud SDK

The authentication flow has completed successfully. You may close this window, or check out the resources below.
How-to guides
All how to guides
» Installing the SDK
Information about command-line tools and client libraries
• Setting up the SDK
Managing SDK components
To learn more about gcloud command-line tool commands, see the gcloud command-line tool guide.
Scripting guidelines

Enabling accessibility features Using For further information about the command-line tools for Google App Engine, Compute Engine. Cloud Storage. BigQuery, Cloud SQL and Cloud DNS (which are all bundled
gcloud Interactive shell £ Uninstalling with Cloud SDK), see Accessing Services with the gcloud CLI.
the Cloud SDK
If you are a client application developer and want to find out more about accessing Google Cloud Platform services with a programming language or framework, see Google

APIs Client Libraries.


711619104046

12. Now start the python coding


Python file: (index.py)
import webapp2 # CGI standard - framework
class MainPage(webapp2.RequestHandler): # create a MainPage class
inherits from webapp module request handler
def get(self): # create a get function for get request for writes out hello
world
self.response.out.write('Hello World')
app = webapp2.WSGIApplication([('/', MainPage),],debug=True) #
instance that routes incoming requests to handlers based on the URL
# Set the MainPage handler with its URL we put in the created handler
In app.yaml file:
> Set python and its version as 27
> Next set the handlers we are going to use (‘/’)
> Set the name of the script as fname.app

13.Open the Google Cloud SDK Shell


14.Run the built-in development server located in the path google-cloud-
sdk\bin\dev_appserver.py “file path”
15.Drag your folder with code files and press enter
16.Running for the first time means you have to install the python extension
by giving y (yes)
711619104046

Output:
Open the browser: URL - Localhost: 8080

Result:
Thus the simple webApplications hello world ceated using
python/java successfully executed.
711619104046
Ex. No. 04
Use GAE launcher to launch the web applications.
Date:

Aim:

To Use GAE launcher to launch the web applications.

Procedure:

Python file: (todo.py)


from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.ext.webapp import template
from google.appengine.api import mail

# Todo defines the data model for the Todos


# as it extends db.model the content of the class will automatically
stored

class TodoModel(db.Model):
author = db.UserProperty(required=True)
shortDescription = db.StringProperty(required=True)

longDescription = db.StringProperty(multiline=True)
url = db.StringProperty()
created = db.DateTimeProperty(auto_now_add=True)
updated = db.DateTimeProperty(auto_now=True)
dueDate = db.StringProperty(required=True)
finished = db.BooleanProperty()

# The main page where the user can login and logout
711619104046
# MainPage is a subclass of webapp.RequestHandler and overwrites
the get method
class MainPage(webapp.RequestHandler):
def get(self):
user = users.get_current_user()
url = users.create_login_url(self.request.uri)
url_linktext = 'Login'
if user:
url = users.create_logout_url(self.request.uri)
url_linktext = 'Logout'

# GQL is similar to SQL


todos = TodoModel.gql("WHERE author = :author and
finished=false",
author=users.get_current_user())

values = {
'todos': todos,
'numbertodos' : todos.count(),
'user': user,
'url': url,
'url_linktext': url_linktext,
}
self.response.out.write(template.render('index.html', values))

# This class creates a new Todo item


class New(webapp.RequestHandler):
def post(self):
user = users.get_current_user()
if user:
testurl = self.request.get('url')
if not testurl.startswith("http://") and testurl:
testurl = "http://"+ testurl
todo = TodoModel(
author = users.get_current_user(),
shortDescription = self.request.get('shortDescription'),
longDescription = self.request.get('longDescription'),
dueDate = self.request.get('dueDate'),
url = testurl,
finished = False)
todo.put();
711619104046

# This class deletes the selected Todo


class Done(webapp.RequestHandler):
def get(self):
user = users.get_current_user()
if user:
raw_id = self.request.get('id')
id = int(raw_id)
todo = TodoModel.get_by_id(id)
todo.delete()
self.redirect('/')

#This class emails the task to yourself

class Email(webapp.RequestHandler):
def get(self):
user = users.get_current_user()
if user:
raw_id = self.request.get('id')
id = int(raw_id)
todo = TodoModel.get_by_id(id)
message = mail.EmailMessage(sender=user.email(),
subject=todo.shortDescription)
message.to = user.email()
message.body = todo.longDescription
message.send()
self.redirect('/')

# Register the URL with the responsible classes

application = webapp.WSGIApplication(
[('/', MainPage),
('/new', New),
('/done', Done),
('/email', Email)],
debug=True)

# Register the wsgi application to run

def main():
run_wsgi_app(application)
711619104046

if name == " main ":


main()

In app.yaml file

application: GAE launcher


version: 1
runtime: python
api_version: 1

handlers:
- url: /css
static_dir: css
- url: /images
static_dir: images
- url: /.* URL - Localhost:8080
Open the browser:

script: todo.py
Output:
711619104046

Result:

Thus the use GAE launcher to launch the web applications sucessfully
completed.
711619104046
Ex. No. 05 Simulate a cloud scenario using CloudSim and run a scheduling algorithm
Date: that is not present in CloudSim.

Aim:
To Simulate a cloud scenario using CloudSim and run a scheduling algorithm
that is not present in CloudSim.

Procedure:

1. Download NetBeans and install it.


2. Download CloudSim 4.0 (jar and source code ), extract and place it is
respective folders
3. Open NetBeans & Create a project “CloudSim
4. Check “Use dedicated folder for Storing Libraries” ^ Click “Finish”
5. Add jar file “cloudsim-4.0”
6. Add “cloudsim examples” in CloudSim Project
7. Run the CloudSim examples
8. Output for CloudSimExample2.java
711619104046

EJ You have succes X Qf Mail - KAVIYA.P X M Inbox - kaviyaap X | 3 netbeans 8.2 witl X

<- -> C i netbeans-ide.informer.com/versions/

Apps * YouTube Video Do... Q Tamil Jothida Palan... 0 WhatsApp


d Solve Python | Hack... E
12.2 8 Dec 2020 Review

0 12.0 23 Jun 2020 Review

o 11.3 17 Mar 2020 Review

o 8.2 31 May 2016 Review

o 8.1 4 Dec 2014 Review

o 8.0.2 10 Feb 2013 Editorial review *****

o 7.4 25 Jun 2013 Review

o 7.3.1 29 Jan 2013 Review

o 7.3 > 7 Oct 2012 Review

7.2.1 1 Jan 2012

>3] Unit III Challenge.pptx

■8
OB i n (T
P Type here to search

Unit III Challenge.pptx Showall X

a=, a-, 3:33 PM 1=1


■■ P Type here to search O ST Q > n
) 8/25/2021
711619104046

3. Open NetBeans & Create a project “CloudSim


711619104046

4. Check “Use dedicated folder for Storing Libraries” ^ Click “Finish”

5. Add jar file “cloudsim-4.0”


711619104046
711619104046

6. Add “cloudsim examples” in CloudSim Project

’ I examples

H Home Share View


%□ RJ) New item □ 3 Open’ Select all
✓ 1— *—1 L®5 Copy path
X * O Easy
’ i—' [3^ Edit jj Select none
Pin to Quick Copy Paste Copy Delete Rename to Properties n
|>| Paste ’ ’
access access » 0 History gtf Invert selection
shortcut
to’ Organize Open Select
Clipboard folder
«- * « Exercise > Ex 7 > Software > doudsim-examples > src > main > java > org > cloudbus > cloudsim > examples > vO Search examples

Date modified Type


& Quick access
container 5/24/201610:28 AM File folder
Downloads network 5/24/201610:28 AM File folder
power 5/24/201610:28 AM File folder
Documents 3 CloudSimExamplel 5/24/201610:28 AM JAVA File 10 KB
Pictures | CloudSimExample2 5/24/201610:28 AM JAVA File 10 KB
This PC 3 CloudSimExample3 5/24/201610:28 AM JAVA File 9 KB
1 CloudSimExample4 5/24/201610:28 AM JAVA File 9 KB
OneDrive
_J CloudSimExample5 5/24/201610:28 AM JAVA File 9 KB
E3 This PC CloudSimExample6 5/24/201610:28 AM JAVA File 10 KB
l\ CloudSimExample7 5/24/201610:28 AM JAVA File 11 KB
3 CloudSimExampleS 5/24/201610:28 AM JAVA File 11 KB
■ Desktop

|S| Documents

Downloads

J) Music

i-' Pictures

S Videos

Windows
Data (D:) (C:)

— kaviyait (\\192.168.2

X it (\\192.168.2.6) (Zf

Network

8 items selected 75.8 KB


O Hi Qi
P Type here to search
"e®o *
711619104046

O CloudSim - NetBeans IDE 8.2

File Edit View Navigate Source Refactor Run Debug Profile Team Tools Window Help |CV Search (Ctrl+I)

i gr g i l^^.> >1 Q- Y l> - ff

Projects X Start Page x CloudSim.java X CloudSimExamplel.java x CloudSimExample2.java x


® Abstractclass
± Sf ARPCIi
1 B /* A ■
i+ARPClient 2 * Title: CloudSim Toolkit *
® ARPSer 3 * Description: CloudSim (Cloud Simulation) Toolkit for Modeling a
ARPServer 4 * of Clouds
t. S’ Array
5 * Licence: GPL - http : / /ww.gnu. org/ copyle ft/gpl. html
6 *
< ,-?* ChatClient
7 * Copyright (c) 2009, The University of Melbourne, Australia
± ChatServer 8
. CloudSim
- */
9
Q (ja Source Packages 10
11 package cloudsim;
B doudsm
|aj) CloudSim java
V
[dj,
CloudSimExamplel.java
CloudSimExample2.ja
va > »
[d£> Output - CloudSim (clean) X | —
CloudSimExample3.java
CloudSimExample4.ja
va
[ajj
CloudSimExampleS.java
CloudSimExample6.|
ava
CloudSimExampte7.j
ava
Irh .U nannrt^ ____________________________________________________________________ LJ 1 ______ ~ ~
CloudSimExampleS.j | 10:1 INS
S’ QJ Notifications t9 ® Navigator
■■
avaP Type here to search
o
HI
n
a ■ 3:58 PM
a Libraries 4>)) g/25/2021

E Q douds«n-4.0.jar
s a JDK 1.8 (Default)
t DNSCIient
E) & DNSServer
E & EchoClient
$ ■Jj'jj EchoServer t File
E FTPClient
I+I 5k FTPServer
E& HTTPClient
i HTTPServer | Search (Ctrl+I)

Jjdj CloudSim,java X|CloudSimExamplel.java x | CloudSimExample2. java


x

■y 2i I o □ I a

[• Sauce Packages
B £ cloudsim
dj) CloudSm.java Log. print Line ( "Starting CloudSimExainple2

65J CloudSimExamplel.
java
CloudSmExample2.)d
va

fl) CkoudSrnExample7
java
CloudS«nExample8.)
ava
B Is Lixanes
E § doudsim-4.0.)ar
// Second step: Create Datacenters
S g) JDK 1.8 (Default)
//Datacenters are the resource providers in CloudSim.
@SuppressWarnings("unused")

P Type here to search


711619104046

O CloudSim - NetBeans IDE 8,2

Projects X Start Page X | [ffi CloudSim.java X | CloudSimExamplel .java X | CloudSimExample2. java x~| _________________________________________ t9
It)--4^ Abstractclass ± Sf ARPCIi i+
Source History ® 0 - g -| & Q Lj | £■ | & H|fij s
ARPClient ® ARPSer ARPServer t S’
Array $ & ChatClient ± ChatServer . 133 //bind the cloudlets to the vms. This way, the broker
134 // will submit the bound cloudlets only to the specific VM
CloudSim e Source Packages
135 broker.bindCloudletToVmfcloudletl.getCloudletId(),vml.getld());
Ei s doudsm 136 broker.bindCloudletToVm(cloudlet2.getCloudletldf),vm2.getld());
CloudSimjava 137
|tsj^ 138 // Sixth step: Starts the simulation -
CloudSimExamplel.ja 139 CloudSim.startSimulation^ ;
140
va
141
CloudSimExample2.ja
142 /I Final step: Print results when simulation is over
va 143 List<Cloudlet> newList = broker.getCloudletReceivedList0;
CloudSimExample3.ja 144
va 145 CloudSim.stopSimulation() ; —
146
CloudSimExample4.ja
147 pri.ntCloud2.etLis t (newList) ;
va
148
[ajj
149 Log.printLine("CloudSimExample2 finished!"); —
CloudSimExampleS.java 150 } —
CloudSimExample6.java Q catch (Exception e) {
t e.printStackTrace() ;
CloudSimExampte7.java Q
t & t CloudSimExampleS.java
> Q (£
153 Log.printLine("The simulation has been terminated due to an unexpected error");
± 154 }
Libraries
t 155 V
£ 3 cloudsm-4-O.jar
t& < >
JDK 1.8 (Default)
X

±
DNSCIient DNSServer >
Output - CloudSim (run) X —
EchoClient EchoServer File *
| run.
t ©■ FTPCIient FTPServer
d? GQ Notifications | dp ® Navigator
HTTPClient
!S P Type HTTPServer
here to search O HI iji n C 1*1 D A *i

7. Run the CloudSim examples


711619104046

8. Output for CloudSimExample2.java

Q CloudSim - NetBeans IDE 8.2


| Q* Search (Ctrl+I)"
File Edit View Navigate Source Refactor Run Debug Profile Team Tools Window Help

& □ C8 % <default config >


w-TO Hi tJJ Start Page xCloudsim. java X |^ CloudSimExamplel.java x , CloudSimExampleS.java x
® :-5i' Abstractclass Source History | |^ [g - | | -j? I £1 Si I Q □ I &
t ARPCIi
® ARPClient Output - CloudSim (run) x
® ARPSer it-
® ARPServer Starting CloudSimExampleZ... Initialising... Starting CloudSim version
3.0 Datacenter_0 is starting... Broker is starting... Entities
± Array B started. 0.0: Broker: Cloud Resource List received with 1 resource(s)
S 0.0: Broker: Trying toCreate VH #0 in
S © ChatClient ft) ®
Datacenter_0
G) lc Source Packages
ChatServer 0.0: Broker: Trying toCreate VH #1 in
Id &2CtoudSim
pH doudsm Datacenter_0
CloudSlm.java 0.1: Broker: VH #0 hasbeen created inDatacenter 92,
CloudSimExamplel. Host #0
java 0.1: Broker: VH fl hasbeen created inDatacenter 92,
|a£ Host #0
0.1: Broker: Sending cloudlet 0 to VH #0 0.1: Broker: Sending cloudlet
CloudSimExampleS.java
1 to VH #1 1000.1: Broker: Cloudlet 0 received 1000.1: Broker:
CloudSimExampleS.ja Cloudlet 1 received
va 1000.1: Broker: All Cloudlets executed. Finishing...
1000.1: Broker: Destroying VH #0
|dR
1000.1: Broker: Destroying VH #1 Broker is shutting down...
CloudSimExample4.)ava Simulation: No more future events
CloudSimExampleS.ja CloudlnformationService: Notify all CloudSim entities for shutting
down.
va DNSClient
Datacenter_0 is shutting down... Broker is shutting down... Simulation
® & DNSServer CloudSimExample6.)a completed. Simulation completed.
® &va
Echoclient
® ® EchoServer CloudSimExample7.ja
t File
va
========== OUTPUT
® ,S FTPClient CloudSimExampleS.ja Cloudlet ID STATUS Start Time Finish Time
® -(JS
va FTPServer 0 SUCCESS 0.1 1000.1
1 SUCCESS 0.1 1000.1
@ &®HTTPCIient
I* libraries CloudSimExamoleZ
± HTTPServer
S’ ®Q
Lip cloudsm-4-O.jar
Notifications j t? ® Navigator .finished!
®g) JDK 1.8 (Default)
P Type here to search

========== OUTPUT ==========


Cloudlet ID STATUS Data center ID VM ID Time Start Time Finish Time
0 SUCCESS 2 0 400 0.1
400.1
**** *Datacenter: Datacenter_0** ***
User id Debt
3 35.6
CloudSimExample1 finished!

Result
Thus Simulate a cloud scenario using CloudSim and run a
scheduling algorithm that is not present in CloudSim executed
successfully .
711619104046

Ex. No. 06 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:

1.Select the OS image and click import.


2.Allocate the default resources to the Guest OS from the host machine and click
next.
3.Then go to setting, select USB option in the left pane and select USB 1.1.
4.Click Start to Power ON the VM.
711619104046

5.Look for the Command Line Interface (CLI) of the Virtual Machine.
6.Login: root, Password: opennebula
711619104046

7.Now open the browser and type the URL - Localhost:9869


8.In the Open Nebula login page use the following credentials
9.Username: oneadmin, Password: opennebula

10. Then follow the steps to Create VMs


a. Click on instances, select VMs then follow the steps to create VM
b. Expand the + symbol
c. Select user oneadmin
d. Then enter the VM Name, No.of instance, and Memory size else use
the default allocation.
e. Then click on create button.
f. Repeat the steps the a to e for creating more than one VMs.
711619104046

Then follow the steps for VM Migration

g. Click on infrastructure
h. Select clusters and enter the cluster name
i. Then select host tab, and select all host
j. Then select Virtual networkss tab, and select all VNets
k. Then select datastores tab, and select all datastores
l. And then choose host under infrastructure tab
m. Click on + symbol to add new host, name the host then click on create.
11. On instances, select VMs to migrate then follow the stpes
a. Click on 8th icon, the drop-down list display
b. Select migrate on that, the popup window display
c. On that select the target host to migrate then click on migrate.

Result:

Thus procedure to transfer the files from one virtual machine to another virtual
machine successfully executed
711619104046

Ex. No. 07 Find a procedure to launch virtual machine using trystack (Online
Date Openstack Demo Version)

Aim:
Find a procedure to launch virtual machine using trystack (Online
Openstack Demo Version)

Procedure:

1. Create an account in Platform9


H You have successfully logge X | Qj Mail - KAVIYA.P • Outlook X | A 2018-2021 Batch Vaccination X | M Inbox - [email protected] X G platform!) openstack demo X + Q— 0X

0 8 google.com/search?q = platform9+openstack+demo&source = hp&ei = qe0tYdaSB4K35OUP9MmDuAo&iflsig=ALs-wAMAAAAAYS37uSrocgBtZ3VbTw-et8glTrqgo6yp&ciq = platf... ☆ •

Apps YouTube Video Do... □ Tamil Jothida Palan... 0 WhatsApp □ Solve Python | Hack... * Microsoft Teams Bloom's Revised Ta... © s tanscstnic.in Stude... Reading list

platform9 openstack demo X $ Q. ® ::: Q

Q. All (Hl News 0 Videos Q Images <J) Shopping • More Tools SafeSearch on

About 6.160 results (0.39 seconds)

https://platform9.com > managed-openstack ▼


OpenStack Setup and Deployment Tools | Platform9
Platforms makes your OpenStack setup easy with our SaaS deployment tools. Get your OpenStack private cloud operational within minutes. Start a free trial!

https://platform9.com > free-trial »


OpenStack and Kubernetes Free Trial | Platforms
Platforms Managed OpenStack & Kubernetes Free Trial: Explore These Features.
OpenStack Features: Highly available OpenStack-as-a-service ...

https://platform9.com > Piatform9 Sandbox ▼


Try OpenStack Sandbox Experience | Platform9
Deploy and operate your OpenStack hybrid cloud within minutes: ...After which you can contact us to request a free trial or speak to a solutions expert.

https://platform9.com > platform9-virtualization-demo ▼


Platform9 Virtualization Demo

■■ P Type here to search O St ri ® ’SJ jQ A J ® g pj)


711619104046

Click “Try SandBox'


711619104046

Explore Managed OpenStack ^ Give all the details ^ Click “Submit”

Fl You have successfully logger X Gfe Mail - KAVIYA.P - Outlook X <*> 2018-2021 Batch Vaccination X M Inbox - [email protected] X ♦ Thank you for creating your X + Q— □X

<- -> C A platform9.com/sandbox/thank-you/?submissionGuid=9d0b2b81-f1e0-41d0-8cbd-0ca9feb621b4 ☆A•

Apps v- YouTube Video Do... □ Tamil Jothida Palan... 0 WhatsApp Q Solve Python | Hack... E^i Microsoft Teams iGC Bloom's Revised Ta... © s tanscstnic.in Stude... [TH] Reading
list

PLATFORM? Products Solutions Pricing Resources Docs About Q, Login Contact Us Get Started

Thank you!
Begin your Kubernetes or Openstack journey by
following the steps below.

Take Platform9 for a spin!

P Type here to search


711619104046

Check the registered mail to get “User Name” and “Password”

To Login “Platform9”.
Click URL ^ Give “User Name” and
“Password”
711619104046

1.6 Instances

Fl You have successfully logge X Mail - KAVIYA.P - Outlook X 2 IT8711 FOSS & CC Lab - Ex 8 X ♦ Platform!? - simple, efficient X M Inbox - kaviyaap@gmail. con X + Q OX

-> C A sandbox-pmo.platform9.net/clarity/index.html?utm_medium=email&_hsmi=87604397&_hsenc=p2ANqtz-9_5dYVeY_MRPql<IFtfDHKI<cPEght9aylb55O4coBSe9BHuZtl65gSts5... ☆ •

Apps YouTube Video Do... o Tamil Jothida Palan... 0 WhatsApp □ Solve Python | Hack... tji Microsoft Teams CC Bloom's Revised Ta... © s tanscst.nic.in Stude... Reading list

PLATFORM9 AO Region:us-sun-01 ~ Tenant:service - ©3 0

Welcome! You are in the Platforms Live Demo. Request Free Trial or Contact Us

■■ P Type here to search O ST Qi ri C ® C d>


711619104046

2. Instance Creation
Move to Instances ^ Click “+INSTANCE”

Fl You have successfully logger x Mail - KAVIYA.P - Outlook X 12 ITB711 FOSS&CC Lab - Ex 8 X ♦ Platform9 - simple, efficient X M Inbox - [email protected] X+ Q— GX

0 A sandbox-pmo.platform9.net/darity/index.htmPutm_medium = email&_hsmi=87604397&_hsenc=p2ANqtz-9_5dYVeY_MRPqklFtfDHKkcPEght9aylb55O4coBSe9BHuZtl65gSts5... ☆ * ■

■■■ Apps YouTube Video Do... Q Tamil Jothida Palan... 0 WhatsApp □ Solve Python | Hack... * Microsoft Teams a Bloom's Revised Ta... 0 S tanscst.nic.in Stude... [TH] Reading list

!S P Type here to search O Hi Qi n C ® A np *■

Source: Boot Instance from ^ Image, Image Selection ^ Choose an “OS image” ^ Click
“Next”
Flavor:
Availability Zone ^ Choose “Nova”
Flavor Selection ^ Choose “ml.small” ^ Click “Next”
Network Selection: Select “tenant-01” ^ Click “Next”

Configure:
1. Instance Name (Eg: Test)
2. SSH Key (Optional)
3. Server Group (Optional)
Enter the details ^ Click “Next”
(Optional) Customize ^ Click “Finish”
New VM Instance Review ^ Click “Create Instance”
Instance is Created
3. To Create new SSH Key
711619104046

Move “Access & Security” ^ Click “+ NEW SSH KEY” ^ Give “Keypair name” &
“Public key content”
To generate SSH public key, In Linux (CentOS), Open
TerminalSwitch to “root” user [Password: newitlab]
To install SSH ^ #yum -y install openssh-server openssh-clients
Set the service to start with the machine ^ #chkconfig sshd on
To generate SSH Key ^ #ssh-keygen -t rsa -f cloud-key
To view “Private Key” of cloud-key
To view “Public Key” of cloud-key
4. Copy “cloud-key.pub” key ^ Paste in platform9 “Import SSH Key Pair ^ Public key
content” ^ Click “IMPORT”

Pl You have successfully logged in. X Q| Mail - KAVIYA.P - Outlook X ♦ Platform!)-simple, efficient cloi X M [email protected] X + Q OX

C ft sandbox-pmo.platform9.net/clarity/mdex.htmPutm_medium =email&_hsmi=87604397&_hsenc=p2ANqtz-_HusiNOPPEglYkvfYVfYXvUCxwiWkPyNf-LT5QKelDxn3Hgh-iBe2jKC... ☆ •

Apps YouTube Video Do... □ Tamil Jothida Palan... 0 WhatsApp □ Solve Python | Hack... « Microsoft Teams CC Bloom's Revised Ta... © s tanscstnic.in Stude... OU

A 0 Region: us-sun-01 » Te nant: service - 0o 0


PLATFORM9

("S Dashboard

SSH API Access


|1J] Infrastructure

Import SSH Key Pair


Q Images
Copy and paste the contents of your public key into the dialog.

Q Instances A key pair allows you to use SSH to log into an


instance after it is launched.

ffi Applications Choose a key pair name you will recognize and paste
your SSH public key into the space provided.
Volumes &
Public SSH keys are normally located at
Snapshots
~/.ssh/ld_rsa.pub .
,ll|| Networks
To create your own SSH key pair: ssh-keygen -t

This will generate 2 files: a private key you keep


secret cloud-key , and a public key cloud- key.pub .

Welcome! You are in the Platform9 Live Demo. Request Free Trial or ContactUs
H SSH_KEY_GEN_Scre....zip ® Ex 6 - Cloudlet Sc....pdf ® Ex 5 - VM Schedul....pdf Showall X
■■ P Type here to search O si Q ■ n ,W'j

Key pair name’

Public key content*

Result:
Thus procedure to launch virtual machine using trystack succesfully Paste the contents of the public key in the space
711619104046

Ex. No. 08 Install Hadoop single node cluster and run simple applications like
Date: word count.

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

Procedures:

/home/sivasamy/Downloads/hadoop-2.7.0

a. To format the HDFS:


bin/hadoop namenode -format

b. To start NameNode daemon and DataNode daemon:


sbin/start-dfs.sh

c. Start ResourceManager daemon and NodeManager daemon:


sbin/start-yarn.sh

d. Make the HDFS directories required to execute MapReduce jobs:


bin/hdfs dfs -mkdir /Annie

e. Copy the input files into the distributed filesystem:

bin/hdfs dfs -put <input-path>/* /Annie


711619104046

f. Execute the wordcount jar file as follows


bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce- examples-
2.7.0jar wordcount /Cloud/file1.txt /op1
Output:

Browse Directory
/opl Go!

Permission Owner Group Size Last Modified Replication Block Size Name

-rw-r-r- itadmin supergroup 0B 5/28/2016, 2:07:16 PM 1 128 MB SUCCESS

-rw-r-r- itadmin supergroup 142 B 5/28/2016, 2:07:16 PM 1 128 MB part-r-00000

Hadoop, 2014.

2. Steps to be followed to Shut down the Hadoop sbin/stop-dfs.sh -> to stop the
nodes sbin/stop-yarn.sh ^ to stop the node managers
711619104046

Result:

Thus Install Hadoop single node cluster simple applications word count
succesfully executed.
711619104046

Ex No:9
Develop a new web service for Calculator
Date:

AIM:
To develop a new web service for a Calculator.
PROCEDURE:

Setting Eclipse for Application Development

1. Create a Dynamic Web Project


• Select File -> New, select Other...

• In the popup window select Web->Dynamic Web


Project category and click NEXT.
• Type in jaxws-calculator as the Project name: and
select Next

• On the next screen check the box for Axis2 Web Services
• Make sure Generate Deployment Descriptor is selected
and click Next.

• Modify the Group Id


to: org.apache.geronimo.samples.jws and Artifact Id:
to Calculator.

Useful Information

Group ID: A name that identifies the group of a module.


The default value is default.
Artifact ID: A name of the module in a group. The default
value is <blank>.
Version: The version of module. The default value is 1.0
Type: The type of module, such as system module (car), jar
module (jar), web archive (war), enterprise archive (ear), and
so on.
711619104046

The default value is car


A module is stored inside a repository as
repository/groupId/artifactId/version/artifactIdversion.
type. This repository structure gives a more standardized and
easily maintainable
structure to Geronimo applications.

• Select Finish. Warning

Depending upon your environment, you may see the error message
"Failed while installing Axis2 Web Services Core 1.1". Do not
worry. We will just have to manually point Axis2 to the installation
directory of Apache Geronimo to fix this error.

2. AXIS2 Configuration
• Select Window->Preferences.

• Select Web Services->Axis2 Preferences.


• Under Axis2 Runtime tab, browse to the installation root
of Apache Geronimo.Select Ok.

This completes the configuration of Eclipse for application


development.

Creating the Web Services Implementation code


To implement the Calculator we are going to create a package
org.apache.geronimo.samples.jws. This package will contain 2 classes. A
Calculator Interface, and CalculatorService which implements the
Calculator interface. Lets go step by step with creating the package,
interface class and implementation class.

1. Right click on Java Resources: src and select New->Package.


2. Name the package as org.apache.geronimo.samples.jws. Select Finish.
3. Right click on the new package and Select New->Interface.

1. Name the interface as Calculator. Select Finish.


711619104046

5.Add the following code to the Calculator interface


class Calculator.classsolid package org.apache.geronimo.samples.jws;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
@WebService(name="CalculatorPortType", targetNamespace =
"http://jws.samples.geronimo.apache.org")
public interface Calculator {
@WebMethod public int add(@WebParam(name = "value1") int
value1, @WebParam(name = "value2") int value2); }

1. Right click on the


package org.apache.geronimo.samples.jws and select
New->Class.
2. Name the class CalculatorService
3. Acceptall the defaults and Select Finish.

4. Add the following code to


CalculatorService.class CalculatorService.classsolid

package org.apache.geronimo.samples.jws;

import javax.annotation.Resource;

import javax.jws.WebService;

import javax.xml.ws.WebServiceContext;
@WebService(serviceName = "Calculator",
portName="CalculatorPort", endpointInterface =
"org.apache.geronimo.samples.jws.Calculator", targetNamespace
= "http://jws.samples.geronimo.apache.org" )

public class CalculatorService implements Calculator {


@Resource private WebServiceContext context;

public int add(int value1, int value2) { System.out.println("User


Principal: " + context.getUserPrincipal()); return value1 +
value2; } }
711619104046

• @WebService- This annotation can be used with a Java class as well


as with interface. In our case we used it with both interface as well as
the POJO. This annotation declares the POJO as a WebService.
@WebService annotation is utilized in generating the WSDL file.
o serviceName is same as the WSDL element service
o name is same as the WSDL element <portType name>
o endpointInterface suggests the user defined name for the
Service Endpoint Interface(SEI).
o portName is the element portName
o targetNamespace is the XML namespace of the WSDL and
some of the XML elements generated from the WebService
• @WebMethod- This annotation is applied to a method to expose it as
a WebService method. In case you have multiple methods you can use
this annotation to selectively expose methods as WebService method.
If you donot use this annotation all the public methods will be exposed
as WebService.
• @WebParam- This annotation is used along with @WebMethod
annotation to define the WebService. It is used to customize parameter
used in the message part of the wsdl.

This completes the development of the Web Service Implementation code.

Generating the wsdl for the web service


Geronimo provides a new jaxws-tools.bat which helps in generating
the WSDL file from service endpoint interface.

• Export the source files to a jar as shown in the figure.


Open a command prompt and point it to the bin directory of
server installation.
1. Run gsh. This will start the Gshell.
2. Run the command WSDL Generation
commandsolid Administrator@T60J9:/>

jaxws/wsgen -classpath C:/WSDL/source.jar -d


C:/WSDL/ -wsdl:soap1.1
org.apache.geronimo.samples.jws.CalculatorService In
this command -classpath is used to set
source.jar(exported from eclipse) in the classpath, -d
711619104046

defines the location where all the generated artifacts will


be placed, -wsdl:soap1.1 suggests a wsdl generation
following soap1.1 protocol,
org.apache.geronimo.samples.jws.CalculatorService is
the SEI used to generate the WSDL

3. Once the above command is


run Calculator_schema1.xsd and Calculator.wsdl will
be generated at C:/wsdl.
4. Rename Calculator.wsdl as CalculatorService.wsdl and
add both the generated files above to WEB-INF directory
of the project. Why are we using gsh if we already have a
jaxws-tools.bat

This is because there are some issues involved with jaxws-


tools.bat in AG 2.1 so we are using a gshell to call the web
services generator.

To learn more about GShell refer Gshell section in user


guide. To know about more options associated with jaxws.
Run jaxws/wsgen -help or jaxws/wsimport -help from
gshell.

Developing a web client for Calculator


This section will take you through the creation of two jsp's index.jsp
and result.jsp.index.jsp will prompt the
user to enter two whole number values to add together. After submitting
the form, the action will be forwarded to result.jsp. Result.jsp will call
the Calculator add Web Service.

1. Right Click on the Web Content folder and Select New->JSP.


2. Name the jsp as index.jsp and Select Finish.

1. Add the following code to

index.jsp index.jspsolid <%@ page


711619104046

import="java.net.URL,javax.xml.namespace.QName,
\javax.xml.ws.Service,org.apache.geronimo.samples.jws.Calcul
ator"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

<title>Calculator</title>

</head>

<body>

<form action="result.jsp"> Please enter 2 whole numbers to


add: <input type="text" name="value1"> +

<input type="text" name="value2">

<input type="submit" value="=">

</form>

</body>

</html>

2. Right Click on the Web Content folder and Select New->JSP.


3. Name the jsp as result.jsp and Select Finish.
4. Add the following code to

jsp. result.jspsolid <%@ page


import="java.net.URL,javax.xml.namespace.QName,

javax.xml.ws.Service,org
.apache.geronimo.samples.jws.Calculator"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
711619104046

<title>Calculator Result</title>

</head>

<% int value1 = 0;

int value2 = 0;

int sum = 0;

try

{ System.out.println( request.getParameter( "value1" ) + " " +


request.getParameter( "value2" ) );

value1 = Integer.parseInt( request.getParameter( "value1" ) );

value2 = Integer.parseInt( request.getParameter( "value2" ) );

URL url = new URL("http://localhost:8080/jaxws-calculator-


1.0/calculator?wsdl");

QName qname = new


QName("http://jws.samples.geronimo.apache.org",
"Calculator");

Service service = Service.create(url, qname); Calculator calc =


(Calculator)service.getPort(Calculator.class);

sum = calc.add(value1, value2);

catch ( Exception e )

e.printStackTrace(); }

%>

<body>
711619104046

The result is: <%=value1%>+<%=value2%>=<%=sum%>


<br> <a href="index.jsp">Back</a>

</body>

</html>

This finishes the development of Web client.

Setting up the Deployment Descriptor and Deployment Plan

1. Expand WEB-INF/web.xml and add the following code

web.xmlsolid <?xml version="1.0" encoding="UTF-8"?> <web-


app xmlns:calc="urn:geronimo-samples-jws"
xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<servlet>

<display-name>CalculatorService</display-name>

<servlet-name>

CalculatorService</servlet-name>

<servlet-class>
org.apache.geronimo.samples.jws.CalculatorService </servlet-
class>

</servlet>

<servlet-mapping>

<servlet-name>CalculatorService</servlet-name>

<url-pattern>/calculator</url-pattern>

</servlet-mapping> <service-ref>

<service-ref-name>services/Calculator</service-ref-name>
<service-interface>javax.xml.ws.Service</service-interface>
711619104046

<wsdl-file>WEB-INF/CalculatorService.wsdl</wsdl-file>
</service-ref>

</web-app>

2 .Similarly double click geronimo-web.xml and add the


following code. geronimo-web.xmlsolid

<?xml version="1.0" encoding="UTF-8"?> <web-app


xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
<dep:environment
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-
1.1">

<dep:moduleId>
<dep:groupId>org.apache.geronimo.samples.jws</dep:groupId
>

<dep:artifactId>Calculator</dep:artifactId>
<dep:version>1.0</dep:version>

<dep:type>car</dep:type> </dep:moduleId>
<dep:dependencies> </dep:dependencies> </dep:environment>

<context-root>

/jaxws-calculator-1.0</context-root>

<service-ref>

<service-ref-name>services/Calculator</service-ref-name>
<port>

<port-name>CalculatorPort</port-name>
<protocol>http</protocol>

<host>localhost</host>

<port>8080</port> <uri>

/jaxws-calculator/calculator</uri> </port>
711619104046

</service-ref> </web-app>

Deploy and Run

1. Right click on jaxws-calculator project. Select Run As-


>Run On Server.

On the next window select Apache Geronimo V2.1 and


Select Finish.
Once the application is deployed on the server. Launch a browser
and run the following URL http://localhost:8080/jaxws-
calculator-1.0/index.jsp.
Give the values as 5,7. Select =.

OUTPUT:

Jaxws Calculator
711619104046

Server Page

Browser Page

Calculation
711619104046

Result

RESULT:
Thus developing a new web service for a calculator was executed
successfully.
711619104046

Ex No:10
Find procedure to attach virtual block to the virtual
Date: machine and check whether it holds the data even after
the release of the virtual machine.

AIM:
To write a procedure to attach virtual block to the virtual machine
and to check whether it holds the data even after the release of the virtual machine.

PROCEDURE:
1. Create and List Existing VMs
2. Pause VM Instances.
3. Reset VM Instances.
4. Delay VM Instances.
5. To attach to a running VM the Image named storage:
$ onevm disk-attach one-5 --image storage
6. To detach a disk from a running VM

onevm detach vm_id disk_id:


711619104046

OUTPUT:

Attach New Disk

RESULT:
Thus the program to attach virtual block to virtual machine was
successfully executed & checked whether it holds the data after the release of the
virtual machine.

You might also like