0% found this document useful (0 votes)
45 views50 pages

Docsity Cloud Computing Lab Manual

SaaS is a software licensing and delivery model where software is licensed on a subscription basis and hosted centrally, allowing users to access the software from various client devices through a client such as a web browser, without installing and maintaining the software themselves. It is a common delivery model for many business applications including office software, messaging, payroll processing, databases, management tools and more. SaaS applications are also known as on-demand, web-based or hosted software and are considered a type of cloud computing along with infrastructure as a service, platform as a service and others.

Uploaded by

mezin ismaeel
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)
45 views50 pages

Docsity Cloud Computing Lab Manual

SaaS is a software licensing and delivery model where software is licensed on a subscription basis and hosted centrally, allowing users to access the software from various client devices through a client such as a web browser, without installing and maintaining the software themselves. It is a common delivery model for many business applications including office software, messaging, payroll processing, databases, management tools and more. SaaS applications are also known as on-demand, web-based or hosted software and are considered a type of cloud computing along with infrastructure as a service, platform as a service and others.

Uploaded by

mezin ismaeel
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/ 50

Cloud computing lab manual

Computer Science
AAFT University of Media and Arts
49 pag.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Cloud Computing Lab File
CS 4113

Name – Sahil Nair Submitted to-


Class – CSE-A Dr. Surjeet Dalal
SEM – 7th Associate Professor
Year – 4th Department of CSE
Roll No. 10317210053

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


INDEX
Experiment No. Name Of Experiment Page No.
01 Basic Concept Of Cloud 01
Computing With Its History
02 Software As A Service In 04
Detail
03 Basics Of PaaS & Discuss 06
Their Use Cases
04 Basics Of IaaS & Discuss 10
Their Use Cases
05 Steps To Create Multiple 13
VMs & Configure Them
Using Virtual Box
06 Steps To Create Multiple 18
Virtual Machine In VM
Ware
07 Write down the steps to 25
install and run the Google
App Engine on Windows
08 Write down the steps to 32
simulate a cloud scenario
using Cloud Sim

09 Write down the steps to run a 34


scheduling algorithm on
Cloud Environment using
Cloud Sim
10 Write down the steps to 37
Install Hadoop Single Node
Cluster and run simple
applications

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment No. 1

AIM: Write down the basic concept of cloud computing with its history

Cloud Computing
Cloud computing is the on-demand availability of computer system resources, especially data
storage and computing power, without direct active management by the user. The term is
generally used to describe data centers available to many users over the Internet. Large clouds,
predominant today, often have functions distributed over multiple locations from central servers.
If the connection to the user is relatively close, it may be designated an edge server.

H istory of Cloud Computing

Before emerging the cloud computing, there was Client/Server computing which is basically a
centralized storage in which all the software applications, all the data and all the controls are
resided on the server side. If a single user wants to access specific data or run a program, he/she
need to connect to the server and then gain appropriate access, and then he/she can do his/her
business. Then after, distributed computing came into picture, where all the computers are
networked together and share their resources when needed.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


On the basis of above computing, there was emerged of cloud computing concepts that later
implemented. At around in 1961, John Mac Charty suggested in a speech at MIT that computing can be sold
like a utility, just like a water or electricity. It was a brilliant idea, but like all brilliant ideas, it was ahead if
its time, as for the next few decades, despite interest in the model, the technology simply was not ready for
it.

But of course time has passed and the technology caught that idea and after few years we
mentioned that:

In 1999, Salesforce.com started delivering of applications to users using a simple website. The
applications were delivered to enterprises over the Internet, and this way the dream of computing
sold as utility were true.

In 2002, Amazon started Amazon Web Services, providing services like storage, computation
and even human intelligence. However, only starting with the launch of the Elastic Compute
Cloud in 2006 a truly commercial service open to everybody existed.

In 2009, Google Apps also started to provide cloud computing enterprise applications.

Of course, all the big players are present in the cloud computing evolution, some were earlier,
and some were later. In 2009, Microsoft launched Windows Azure, and companies like Oracle
and HP have all joined the game. This proves that today, cloud computing has become
mainstream.

C loud Computing Tools

I nfrastructure As A Service ( IaaS )

It is one of the layers of the cloud computing platform. It allows customers to outsource their IT
infrastructures such as servers, networking, processing, storage, virtual machines, and other
resources. Customers access these resources on the Internet using a pay as per use model.

In traditional hosting services, IT infrastructure was rented out for a specific period of time, with
pre determined hardware configuration. The client paid for the configuration and time, regardless
of the actual use. With the help of the IaaS cloud computing platform layer, clients can
dynamically scale the configuration to meet changing requirements and are billed only for the
services actually used.

IaaS cloud computing platform layer eliminates the need for every organization to maintain the
IT infrastructure.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Platform As A Service ( PaaS )

Platform as a Service (PaaS) provides a runtime environment. It allows programmers to easily


create, test, run, and deploy web applications. You can purchase these applications from a cloud
service provider on a pay as per use basis and access them using the Internet connection. In PaaS,
back end scalability is managed by the cloud service provider, so end- users do not need to worry
about managing the infrastructure. PaaS includes infrastructure and platform to support the web
application life cycle for example Google App Engine, Force.com, Joyent, Azure.

S oftware As A Service ( SaaS )

It is a software distribution model in which services are hosted by a cloud service provider. These
services are available to end-users over the internet so, the end-users do not need to install any
software on their devices to access these services.

There are the following services provided by SaaS providers -

Business Services - SaaS Provider provides various business services to start-up the business.
The SaaS business services include ERP (Enterprise Resource Planning), CRM (Customer
Relationship Management), billing and sales.

Document Management - SaaS document management is a software application offered by a


third party to create, manage, and track electronic documents.

Social Networks - As we all know, social networking sites are used by the general public, so
social networking service providers use SaaS for their convenience and handle the general
public's information.

Mail Services - To handle the unpredictable number of users and load on e-mail services, many e-
mail providers offering their services using SaaS.

C omparison Between IaaS, PaaS & SaaS

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment No. 2
AIM: Write About Software As A Service In Detail

S oftware As A Service
Software as a service ( SaaS ) is a software licensing and delivery model in which software is licensed on a
subscription basis and is centrally hosted.It is sometimes referred to as "on-demand software", and was
formerly referred to as "software plus services" by Microsoft.
SaaS applications are also known as Web-based software, on-demand software and hosted software. The
term "software as a service" (SaaS) is considered to be part of the nomenclature of cloud computing,
along with infrastructure as a service (IaaS), platform as a service (PaaS), desktop as a service
(DaaS),managed software as a service (MSaaS), mobile backend as a service (MBaaS), datacenter as a
service (DCaaS), and information technology management as a service (ITMaaS).
SaaS apps are typically accessed by users using a thin client, e.g. via a web browser. SaaS has become a
common delivery model for many business applications, including office software, messaging software,
payroll processing software, DBMS software, management software, CAD software, development
software, gamification, virtualization, accounting, collaboration, customer relationship
management (CRM), management information systems (MIS), enterprise resource planning (ERP),
invoicing, human resource management (HRM), talent acquisition, learning management systems, content
management (CM), geographic information systems (GIS), and service desk management. SaaS has been
incorporated into the strategy of nearly all leading enterprise software companies.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Use Cases Of Software As A Service ( SaaS )
Most are familiar with the public cloud Software-as-a-Service offerings for enterprise environments such
as Office 365, Basecamp, Salesforce, etc., that allow organizations to have software offerings over the
Internet.

Today, Microsoft Azure is becoming a powerful offering not only for software but also for infrastructure.
Examples of SaaS use cases are Cisco WebEx, Zendesk, and even Facebook.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment No. 3

AIM: Write down the basics of PaaS and discuss their use cases

P latform As A Service
Platform as a service (PaaS) is a complete development and deployment environment in the cloud, with
resources that enable you to deliver everything from simple cloud-based apps to sophisticated, cloud-enabled
enterprise applications. You purchase the resources you need from a cloud service provider on a pay-as-you-go
basis and access them over a secure Internet connection.
Like I aaS, PaaS includes infrastructure servers, storage and networking but also middleware, development
tools, business intelligence (BI) services, database management systems and more. PaaS is designed to support
the complete web application lifecycle: building, testing, deploying, managing and updating.
PaaS allows you to avoid the expense and complexity of buying and managing software licenses, the underlying
application infrastructure and middleware, container orchestrators such as Kubernetes or the development tools
and other resources. You manage the applications and services you develop and the cloud service provider
typically manages everything else.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


C haracteristics Of Platform As A Service
 Easy Development: One-click functionality through a web browser makes it easy for most people to
develop an application.
 Flexibility: The user controls what features and tools are placed within the platform that best suit their
specific needs.
 Portability: When extra capacity is required, users can move to the public cloud or split processing
between private clouds and public clouds, to become a hybrid cloud.
 Security: Features data security, backup and recovery.
 Adaptability: Features can easily be substituted when circumstance change.
 Location: With the platform accessible through the internet, developers in various locations are able to
work on the same application.
 No Infrastructure Investments: User has no need to purchase hardware and will only need to pay for the
resources used, eliminating wasted capacity.

B enefits Of Platform As A Service

1. Rapid Time To Market


2. Minimal Development
3. Cost Effective Development
4. Reduced Pressure On Internal Resources
5. Pre Built Sophisticated Tools
6. Opportunity For Scalability
7. Develop For Multiple Platforms
8. Future Proofing

U se Cases
 HTML5
 JQuery
 JavaScript
 Microsoft Azure
 ASP.NET 4.0
 Web Services
 SQL

7

Saviant offers Azure PaaS Consulting Services in providing cloud solutions to the clients of varied industries like
Real Estate and Construction Industry. Our Azure developer delivered a cloud-based solution to re-engineer the

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


client’s legacy product suite. To perform custom calculation of points, serialization of objects and persistence, and
for handling interactive events, we used JavaScript technology in our solution. We produced a rich user interface
using HTML5 canvas, JavaScript, and JQuery frameworks. Our team has created all the geometric calculations to
transform the objects on various mouse click operations and used Web Services for seamless integration into legacy
systems.

We re-platform the client's existing Flash based tool into a highly interactive cloud based solution through Raphael
JS & HTML5 canvas. With this cloud solution, we were able to build an interactive application to dynamically
customize housing floor plans to its end users. Users can dynamically zoom and change floor plans because of the
rich user interface we have provided. With this cloud solution, the client is handling more than 100 web services and
accelerating their performance rate.

C omparison

 Scalability – On premises solutions are rather difficult to scale, as the type of hardware needed

depends on your application’s demands. If your app experiences heavy traffic, you might need to

significantly upgrade on-premises hardware. This problem doesn’t exist with a cloud service, which you

can quickly scale up or down with a few clicks. Cloud services are a perfect solution for handling peak

loads. With cloud-based services, businesses can use whatever computing resources they need.

 Cost Effectiveness - Cloud computing removes hardware expenses, as hardware is provided by a

vendor. There’s no need to buy, install, configure, and maintain servers, databases, and other

components of your runtime environment. Moreover, using cloud-based solutions, you pay only for

what you use, so if you don’t need extra resources you can simply scale down and not pay for them.

8

 Immediate Availability - Cloud solutions are available as soon as you’ve paid for them, so you can

start using a cloud service right away. There’s no need to install and configure hardware.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


 Performance - Cloud companies equip their data centers with high-performance computing

infrastructure that guarantees low network latency for your applications.

 Security - Cloud infrastructure is kept in safe data centers to ensure a top level of security. Data is

backed up and can easily be recovered. Moreover, cloud vendors ensure the security of your data by

using networking firewalls, encryption, and sophisticated tools for detecting cybercrime and fraud.

9

Experiment No. 4
AIM: Write down the basis of IaaS and discuss their use cases

Infrastructure As A Service
Infrastructure as a service (IaaS) is an instant computing infrastructure, provisioned and managed over the
internet. It is one of the four types of cloud services, along with software as a service (S aaS), platform as a
service (PaaS) and serverless.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


IaaS quickly scales up and down with demand, letting you pay only for what you use. It helps you avoid the
expense and complexity of buying and managing your own physical servers and other datacentre infrastructure.
Each resource is offered as a separate service component and you only need to rent a particular one for as long as
you need it. A cloud computing service provider, such as Azure, manages the infrastructure, while you purchase,
install, configure and manage your own software operating systems, middleware and applications.

C haracteristics Of Infrastructure As A Service


 Automated administrative tasks
 Dynamic scaling
 Platform virtualization technology
 GUI and API-based access
 Internet connectivity

10

Benefits of Infrastructure As A Service

 Increased Performance
 Decreased CapEx
 Increased Security

 Increased Scalability and Flexibility

 Increased Support for Disaster Recovery and Business Continuity

U se Cases

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


 Disaster Recovery
 Program Testing & Development
 Hosting Complex Websites
 High Computing Performance
 Big Data Analysis

C omparison

 Scalability – On premises solutions are rather difficult to scale, as the type of hardware needed depends

on your application’s demands. If your app experiences heavy traffic, you might need to significantly

upgrade on-premises hardware. This problem doesn’t exist with a cloud service, which you can quickly

scale up or down with a few clicks. Cloud services are a perfect solution for handling peak loads. With

cloud-based services, businesses can use whatever computing resources they need.

 Cost Effectiveness - Cloud computing removes hardware expenses, as hardware is provided by a

vendor. There’s no need to buy, install, configure, and maintain servers, databases, and other

components of your runtime environment. Moreover, using cloud-based solutions, you pay only for

what you use, so if you don’t need extra resources you can simply scale down and not pay for

them.

 Immediate Availability - Cloud solutions are available as soon as you’ve paid for them, so you

can start using a cloud service right away. There’s no need to install and configure hardware.

11
 Performance - Cloud companies equip their data centers with high-performance computing

infrastructure that guarantees low network latency for your applications.

 Security - Cloud infrastructure is kept in safe data centers to ensure a top level of security. Data is

backed up and can easily be recovered. Moreover, cloud vendors ensure the security of your data by

using networking firewalls, encryption, and sophisticated tools for detecting cybercrime and fr

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


12

E xperiment – 5
AIM: Write down the steps to create multiple VMs and configure them using Virtual Box.

These are the steps to install multiple VMs through VirtualBox. It uses
various VirtualBox Manage commands to prepare the Virtual Machine. The VirtualBox Manage
unattended install command is then used to install and configure the operating system.

1. Create the virtual machine.


Note the following:

 The $VM variable represents the name of the VM.


 The VirtualBox Manage list os types command lists the OS

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


supported by Oracle VirtualBox, including the name used for each OS in the VBox Manage
commands.
 A 64-bit Oracle VM is created and registered with Oracle VirtualBox.
 The VM has a unique UUID.
 An XML settings file is generated.

2. Create a virtual hard disk and storage devices for the VM.
 Create a 32768 MB virtual hard disk.
 Create a SATA storage controller and attach the virtual hard disk.
 Create an IDE storage controller for a virtual DVD drive and attach an ISO installation.

3. Configure some settings for the VM.


 Enable I/O APIC for the motherboard of the VM.
 Configure the boot device order for the VM.
 Allocate 8192 MB of RAM and 128 MB of video RAM to the VM
4. Perform an unattended install of the OS.
 Specifies an Oracle ISO as the installation ISO.
 Specifies a login name, full name, and login password for a default user on the OS.

Note that the specified password is also used for the root user account on the VM.

 Installs the Additions on the VM.


 Sets the time zone for the OS to Indian Time.
13

5. Start the virtual machine.


 This step completes the unattended installation process.
 The VM starts in headless mode, which means that the Virtual Box Manager
window does not open.

6. Update the OS to use the latest packages.

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


14

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


15

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


16

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


17

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment – 6
AIM: Write down the steps to install multiple virtual machines in VM Ware

Step 1: Set up a VMware Virtual Machine


Start by opening VMware and selecting “Create a New Virtual Machine”

We’ll go with a Typical configuration. If you’re feeling fancy and really want to tweak the parameters, you can
pick a Custom one, but we won’t be going through a full Custom setup.

18

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


You will now need to show VM Ware the path to your Windows 10 ISO. If you don’t have one, here’s how to get
it.

19

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


If VMware doesn’t automatically detect the OS from the ISO, you’ll need to manually select it. You’ll have the
option to pick between a 32 and 64-bit versions of Windows OS.

Choose a name for your Virtual Machine as well as a location where it will be stored.

20

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Next up is creating your virtual disk. The advised maximum limit is 60 GB, which is okay. I advise you to stay
with the “Split virtual disk into multiple files” option, otherwise, VMware will immediately allocate the space on
your hard drive.

Step 2: Customizing the Virtual Machine Hardware

If you want to get fancy, you can customize the hardware that your VM will use. I’ll go ahead and do this to
show you some of the options you can change, but if you’re okay with the VMware defaults you can go ahead and
select “Finish”.

Selecting the Memory option, I can increase or decrease the available RAM for this VM. I’ll go for 2GB instead
of the default 1GB. 21

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


I’ll also give my VM some extra CPU power by allowing it to use two cores instead of one.

When you’re done tweaking the hardware you can close the windows and click “Finish” on the New VM Wizard.
22

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Step 3: Installing Windows 10

Once you’re ready to begin installing, simply click on “Power on this virtual machine”. From here on the install
should begin.

Installing Windows as a virtual machine is no different from making a clean install of Windows.

23

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


That’s all there is to it when working with VMware to create a virtual Windows 10 machine.

24

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment – 7
AIM: Write down the steps to install and run the Google App Engine on Windows

This experiment describes the installation of the Google App Engine Software Development
Kit (SDK) on a Microsoft Windows and running a simple “hello world” application.

The App Engine SDK allows you to run Google App Engine Applications on your local
computer. It simulates the runtime environment of the Google App Engine infrastructure.

Pre Requisites: Python 2.5.4

If you don't already have Python 2.5.4 installed in your computer then download and Install
Python 2.5.4 from:

https://www.python.org/download/releases/2.5.4/

Download and Install

You can download the Google App Engine SDK by going to:

https://code.google.com/appengine/downloads.html

and download the appropriate install package.

Download the Windows installer. The simplest thing is to download it to your Desktop or
another folder that you remember.

25

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Double Click on the Google Application Engine installer.

Click through the installation wizard and it should install the App Engine. If you do not have
Python 2.5, it will install Python 2.5 as well.

Once the install is complete you can discard the downloaded installer.

26

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Making Your First Application

Now you need to create a simple application. We could use the “+” option to have the launcher
make us an application but instead we will do it by hand to get a better sense of what is going
on.

Make a folder for your Google App Engine applications. I am going to make the Folder on
my Desktop called “apps” the path to this folder is:

C:\DocumentsandSettings\csev\Desktop\apps

And then make a sub folder in within apps called “ae01trivial” the path to this folder would be:

C:\DocumentsandSettings\csev\Desktop\apps\ae01trivial

Using a text editor such as JEdit (www.jedit.org), create a file called app.yaml in the
Ae 01 trivial folder with the following contents:

application: ae-01-trivial
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
script: index.py

Note: Please do not copy and paste these lines into your text editor, you might end up with
strange characters, simply type them into your editor.

Then create a file in the ae01trivial folder called index.py with three lines in it:

print 'Content-Type:text/plain'
print ' '
print 'Hello thereChuck'

Then start the Google App Engine Launcher program that can be found under Applications
File.

Add Existing Application command and navigate into the apps directory and select the
ae01trivial folder. Once you have added the application, select its path that you can control the
application using the launcher.

27

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Once you have selected your application and press Run. After a few moments your application
will start and the launcher will show a little green icon next to your application. Then press
Browse to open a browser pointing at your application which is running at
https://localhost:8080.

Paste https://localhost:8080 into your browser and you should see your application
as follows:

Just for fun, edit the index.py to change the name “Chuck” to your own name and press
Refresh in the browser to verify your updates.

Watching The Log

You can watch the internal logo of the actions that the web server is performing when you are
interacting with your application in the browser. Select your application in the Launcher and press
the Logs button to bring up a log window:

28

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Each time you press Refresh in your browser, you can see it retrieving the output with a
GET request.

Dealing With Errors

With two files to edit, there are two general categories of errors that you may encounter. If you
make a mistake on the app.yaml file, the App Engine will not start and your launcher will show a
yellow icon near your application:

To get more detail on what is going wrong, take a look at the log for the application:

29

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


In this instance, the mistake is misindenting the last line in the app.yaml (line8).

If you make a syntax error in the index.py file, a Python trace back error will appear in your
browser.

The error you need to see is likely to be the last few lines of the output, in this case I made a
Python syntax error on line one of our one line application.

Reference: https://en.wikipedia.org/wiki/Stack_trace

When you make a mistake in the app.yaml file, you must then fix the mistake and attempt to
start the application again.

30

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


If you make a mistake in a file like index.py, you can simply fix the file and press refresh in
your browser, there is no need to restart the server.

Shutting Down the Server

To shut down the server, use the Launcher, select your application and press the
Stop button.

31

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment – 8
AIM: Write down the steps to simulate a cloud scenario using Cloud Sim

Cloud Sim is written in Java. The knowledge you need to use Cloud Sim is basic Java programming
and some basics about cloud computing. Knowledge of programming IDEs such as Eclipse or
NetBeans is also helpful. It is a library and, hence, Cloud Sim does not have to be installed.
Normally, you can unpack the downloaded package in any directory, add it to the Java class path and
it is ready to be used. Please verify whether Java is available on your system.

To use Cloud Sim in Eclipse:

1. Download Cloud Sim installable files


from https://code.goog le.com/p/cloud sim/downloads/list and unzip

2. Open Eclipse

3. Create a new Java Project: File ->New

4. Import an unpacked Cloud Sim project into the new Java Project

5. The first step is to initialise the Cloud Sim package by initialising the CloudSim library,as
follows:
Cloud Sim.init(num_user, calendar, trace_flag)

6. Data centres are the resource providers in Cloud Sim; hence, creation of data centres is a
second step. To create Datacenter, you need the Data center Characteristics object that stores the
properties of a data centre such as architecture, OS, list of machines, allocation policy that covers
the time or space shared, the time zone and itsprice:
Datacenter datacenter9883 = new Data center (name, characteristics, new Vm Allocation Policy Simple (host
List)

7. The third step is to create a broker:


Data center Broker broker = create Broker();

8. The fourth step is to create one virtual machine unique ID of the VM, user Id ID of the
VM’s owner, mips, number Of Pes amount of CPUs, amount of RAM, amount of bandwidth,
amount of storage, virtual machine monitor, and cloudlet Scheduler policy for cloudlets:
Vmvm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new Cloudlet
Scheduler Time Shared())

9. Submit the VM list to thebroker:


broker.submitVmList(vmlist)

32

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


10. Create a cloudlet with length, file size, output size, and utilisationmodel:
Cloudlet cloudlet = new Cloudlet(id, length, pesNumber, fileSize, outputSize, utilization Model, utilization
Mode)

11. Submit the cloudlet list to the broker:


broker.submitCloudletList(cloudletList)

12. Start the simulation:


CloudSim.startSimulation()

Sample Output from the Existing Example:

Starting Cloud Sim Example 1


... Initialising ...
Starting Cloud Sim version
3.0 Datacenter_0 is starting...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>null
Broker is starting...
Entities started.
: Broker: Cloud Resource List received with 1resource(s)
0.0: Broker: Trying to Create VM #0 inDatacenter_0
: Broker: VM #0 has been created in Datacenter #2, Host#0
0.1: Broker: Sending cloudlet 0 to VM #0
400.1: Broker: Cloudlet 0 received
: Broker: All Cloudlets executed.Finishing...
400.1: Broker: Destroying VM#0
Broker is shutting down...
Simulation: No more future events
Cloud Information Service: Notify all Cloud Sim entities for shutting
down. Datacenter_0 is shutting down...
Broker is shutting down...
Simulation completed.
Simulation completed.
========== 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*****
Userid Debt
3 35.6

Cloud Sim Example 1 finish!

33

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment – 9
AIM: Write down the steps to run a scheduling algorithm on Cloud Environment using
Cloud Sim

Cloud Sim

Cloud Sim is a programming language based simulator and even though it does not support a
graphical user interface for simulation, it proposes the Cloud Analyst (which is an extension of
Cloud Sim) for investigators who prefers using a user friendly interface to carry out their
researches. Cloud Sim presents itself to the cloud computing researchers as a Java based
framework that supports the main characteristics of Cloud Computing (IaaS) with virtualization
support and task scheduling (PaaS and SaaS) and open up the door for emerging, integrating and
testing new algorithms for task scheduling or new characteristics development, which helped on
delivering new simulators.
Our choice for Cloud Sim stems from it openness and clear logic which is deficient on the other
simulators specifically with GUI based simulators where we were not able to tackle the Cloud
infrastructure layer to better test algorithms related to CPU allocation and introduce new
algorithms. Cloud Sim was the accurate selection for our research, which is focused on
evaluating and assessing the CPU scheduling algorithms for resources allocation in order to help
Cloud providers and users make precise decision about Cloud Computing model adoption.
Cloud Sim Architecture & Design
Cloud Sim is a Java application that was founded on Grid Sim, which is a simulator and a toolkit
for modeling and simulation of entities in parallel and distributed computing, Cloud Sim was
designed in a layered architecture. At the lowest layer, we find the “Sim Java” (Discrete Event
Simulation) which implements the core functionalities needed by the higher level of simulation
(Data Center, Host, Virtual machine). Just above the Sim Java we find the “Grid Sim” toolkit for
modeling multiple Grid infrastructures, including networks and associated traffic. At the next
layer, we find the Cloud Sim simulation layer, which provides support for modeling and
simulation of virtualized Cloud based data center environments including dedicated management
interfaces for VMs, memory, storage, and bandwidth. This layer handles the fundamental issues,
such as provisioning of hosts to VMs, managing application execution, and monitoring dynamic
system state. The top layer in the Cloud Sim simulation toolkit is the “User Code” which is the
main interface for simulation specifications and characteristics configuration (number of
machines, applications, tasks, users, scheduling policies and their basic structure).

34

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


35

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


CPU Scheduling Algorithm

A cloud provider main interest is to increase profits by achieving high levels of users’
satisfaction, which comes with providing the end user with the best experience. Hence, comes
the importance of choosing the finest scheduling algorithms for resources allocation and task
scheduling. The key purpose of scheduling algorithms is the appropriate allocation of task or a
job to the appropriate resource. Therefore, it goes back always to the period necessary to carry
out the execution of a specific task in order to evaluate the quality and performance of the
scheduling algorithms.

First Come First Served Scheduling


The simplest algorithm for resources scheduling is the FCFS algorithm. This algorithm is based
on the arrival time of the resource request.
Round Robin Scheduling
The Round Robin algorithm was designed based on the distribution of the CPU time among the
scheduled tasks. On the same context, all the tasks get on a queue list whereas each task get a small
unit of CPU time.
Cloud Sim Scheduling Policies
The virtualization technology is one of the fundamental concepts of Cloud Computing
infrastructures. Cloud Sim deploy enormously the virtualization technology in order to simulate
IaaS and PaaS provisioning and to use it as a base for users’ applications execution. On the same
perspective comes the challenge of deploying the finest resources allocation and scheduling
algorithm. For example, one Data center that consists of one host with two processing units and
where the cloud user is trying to instantiate two virtual machines with two processing units each.
Logically, there is a separation between the two virtual machines, but in reality, each virtual
machine is limited to the processing power offered by the physical host, therefore we cannot
instantiate both virtual machines on the same host at the same time without an appropriate
scheduling algorithm.

In reference to this critical factor, Cloud Sim proposes two levels of resources allocation policies
based on two basic scheduling policies, which are the time-shared and space-shared allocation
policies. These allocation policies are implemented during the virtual machines construction and
throughout the application execution.

36

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Experiment – 10
AIM: Write down the steps to Install Hadoop Single Node Cluster and run simple
applications

Step 1: Download the Java 8 Package. Save this file in your home directory.

Step 2: Extract the Java Tar File.

Command: tar -xvf jdk-8u101-linux-i586.tar.gz

Step 3: Download the Hadoop 2.7.3 Package.

Command: wget

https://archive.apache.org/dist/hadoop/core/hadoop-2.7.3/hadoop- 2.7.3.tar.gz

Step 4: Extract the Hadoop tar File.

Command: tar -xvf hadoop-2.7.3.tar.gz

37

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Step 5: Add the Hadoop and Java paths in the bash file (.bashrc).

Open. bashrcfile. Now, add Hadoop and Java Path as shown below.

Command: vi .bashrc

Then, save the bash file and close it.

For applying all these changes to the current Terminal, execute the source command.

Command: source .bashrc

To make sure that Java and Hadoop have been properly installed on your system
and can be accessed through the Terminal, execute the java -version and hadoop
version commands.

Command: java -version

38

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Command: hadoop version

Step 6: Edit the Hadoop Configuration files.

Command: cd hadoop-2.7.3/etc/hadoop/

Command: ls

All the Hadoop configuration files are located in hadoop-2.7.3/etc/hadoop directory


as you can see in the snapshot below:

39

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Step 7: Open coresite.xml and edit the property mentioned below inside
configuration tag:

Coresite.xml informs Hadoop daemon where Name Node runs in the cluster. It
contains configuration settings of Hadoop core such as I/O settings that are common
to HDFS & Map Reduce.

Command: vi core site.xml

40

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Step 8: Edit hdfs-site.xml and edit the property mentioned below inside
configuration tag:

hdfs site.xml contains configuration settings of HDFS daemons i.e. Name Node,
Data Node, Secondary Name Node. It also includes the replication factor and block
size of HDFS.

Command: vi hdfs site.xml

Step 9: Edit the mapred site.xml file and edit the property mentioned below inside configuration
tag:

mapred site.xml contains configuration settings of Map Reduce application like


number of JVM that can run in parallel, the size of the mapper and the reducer
process, CPU cores available for a process, etc.

In some cases, mapred-site.xml file is not available. So, we have to create the
mapred site.xml file using mapred-site.xml template.

Command: cp mapred site.xml, template mapred site.xml

41

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Command: vi mapred-site.xml.

Step 10: Edit yarn site.xml and edit the property mentioned below inside
configuration tag:

Yarn site.xml contains configuration settings of Resource Manager and Node


Manager like application memory management size, the operation needed on
program & algorithm, etc.

Command: vi yarn site.xml

42

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Step 11: Edit hadoop env.sh and add the Java Path as mentioned below:

Hadoop env.sh contains the environment variables that are used in the
script to run Hadoop like Java home path, etc.

Command: vi hadoop env.sh

43
Step 12: Go to Hadoop home directory and format the Name Node.
Command: cd

Command: cd hadoop 2.7.3

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Command: bin/hadoop name node format

This formats the HDFS via Name Node. This command is only executed for the
first time. Formatting the file system means initializing the directory specified
by the dfs.name.dir variable.

Never format, up and running Hadoop file system. You will lose all your data
stored in the HDFS.

Step 13: Once the Name Node is formatted, go to hadoop-2.7.3/sbin directory


and start all the daemons.

Command: cd hadoop-2.7.3/sbin

Either you can start all daemons with a single command or do it individually.

Command: ./start-all.sh

The above command is a combination of start-dfs.sh, start-yarn.sh & mr-job


history daemon.sh

Or you can run all the services individually as below:

Start Name Node:

The Name Node is the centerpiece of an HDFS file system. It keeps the directory
tree of all files stored in the HDFS and tracks all the file stored across the cluster.

Command: ./hadoop daemon.sh start name node

44

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Start Data Node

On startup, a Data Node connects to the Name node and it responds to the requests
from the Name node for different operations.

Command: ./hadoop-daemon.sh start data node

Start Resource Manager

Resource Manager is the master that arbitrates all the available cluster resources
and thus helps in managing the distributed applications running on the YARN
system. Its work is to manage each Node Managers and the each application’s
Application Master.

Command: ./yarn-daemon.sh start resource manager

45

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Start Node Manager

The Node Manager in each machine framework is the agent which is responsible for
managing containers, monitoring their resource usage and reporting the same to the
Resource Manager.

Command: ./yarn-daemon.sh start node manager

Start Job History Server

Job History Server is responsible for servicing all job history related requests from client.

Command: ./mr-jobhistory-daemon.sh start history server

Step 14: To check that all the Hadoop services are up and running, run the
below command.

Command: jps

46

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/


Step 15: Now open the Mozilla browser and go to local host: 50070/dfshealth.html to
check the Name Node interface.

47

Document shared on https://www.docsity.com/en/cloud-computing-lab-manual/7017932/

You might also like