Sie sind auf Seite 1von 130

ADITYA COLLEGE OF ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

15A05710

GRID & CLOUD COMPUTING LAB

Lab Observation Book

Academic Year :_______________________________________________________

Name :_______________________________________________________

Roll Number :_______________________________________________________

Branch :_______________________________________________________

Year & Section :_______________________________________________________


Department of CSE 15A05710 Grid & Cloud Computing Lab

Do’s:

1. Know the location of the fire extinguisher and the first aid box and how to use them in case of
an emergency.
2. Read and understand how to carry out an activity thoroughly before coming to the laboratory.
3. Report fires or accidents to your lecturer/laboratory technician immediately.
4. Report any broken plugs or exposed electrical wires to your lecturer/laboratory technician
immediately.

Don’ts:

1. Do not eat or drink in the laboratory.


2. Avoid stepping on electrical wires or any other computer cables.
3. Do not open the system unit casing or monitor casing particularly when the power is turned on.
Some internal components hold electric voltages of up to 30000 volts, which can be fatal.
4. Do not insert metal objects such as clips, pins and needles into the computer casings. They
may cause fire.
5. Do not remove anything from the computer laboratory without permission.
6. Do not touch, connect or disconnect any plug or cable without your lecturer/ laboratory
technician’s permission.
7. Do not misbehave in the computer laboratory.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 2


Department of CSE 15A05710 Grid & Cloud Computing Lab

INDEX

GRID COMPUTING

STAFF
SNO DATE PROGRAM NAME
SIGN

PROGRAMS USING GRIDSIM

PROGRAMS USING USE GLOBUS TOOLKIT OR EQUIVALENT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 3


Department of CSE 15A05710 Grid & Cloud Computing Lab

INDEX

CLOUD COMPUTING

STAFF
SNO DATE PROGRAM NAME
SIGN

PROGRAMS ON SOFTWARE AS A SERVICE

PROGRAMS ON PLATFORM AS A SERVICE

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 4


Department of CSE 15A05710 Grid & Cloud Computing Lab

15A05710 GRID AND CLOUD COMPUTINGLABORATORY

Course Objectives:
The student should be madeto:
• Be familiar with developing web services/Applications in gridframework.
• Be exposed to tool kits for grid and cloudenvironment.
• Learn to useHadoop
• Learn to run virtual machines of differentconfiguration.

Course Outcomes:
• The student should be able to
• Design and Implement applications on the Cloud.
• Design and implement applications on the Grid.
• Use the grid and cloud tool kits.

GRID COMPUTING

GRID COMPUTING PROGRAMS USING GRIDSIM

1 Program to create one Grid resource with three machines


2 Program to create one or more Grid users. A Grid user contains one or more Gridlets
3 Program to shows how two GridSim entities interact with each other ; main( ie example3 )
class creates Gridlets and sends them to the other GridSim entities, i.e. Test class
4 Program shows how a grid user submits its Gridlets or tasks to one grid resource entity
5 Program to show how a grid user submits its Gridlets or task to many grid resource entities
6 Program to show how to create one or more grid users and submits its Gridlets or task to many
grid resource entities

GRID COMPUTING PROGRAMS USING USE GLOBUS TOOLKIT OR EQUIVALENT

1 Develop a new Web Service for Calculator.


2 Develop new OGSA-compliant Web Service.
3 Using Apache Axis develop a Grid Service.
4 Develop applications using Java or C/C++ Grid APIs
5 Develop secured applications using basic security mechanisms available in Globus Toolkit.
6 Develop a Grid portal, where user can submit a job and get the result.
Implement it with and without GRAM concept.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 5


Department of CSE 15A05710 Grid & Cloud Computing Lab

CLOUD COMPUTING
Programs on SaaS

1. Create an word document of your class time table and store locally and on the cloud with
doc,and pdf format . ( use www.zoho.com and docs.google.com)
2. Create a spread sheet which contains employee salary information and calculate gross and total
sal using the formula
DA=10% OF BASIC
HRA=30% OF BASIC
PF=10% OF BASIC IF BASIC<=3000
12% OF BASIC IF BASIC>3000
TAX=10% OF BASIC IF BASIC<=1500
=11% OF BASIC IF BASIC>1500 AND BASIC<=2500
=12% OF BASIC IF BASIC>2500
( use www.zoho.com and docs.google.com)
NET_SALARY=BASIC_SALARY+DA+HRA-PF-TAX
3. Prepare a ppt on cloud computing –introduction , models, services ,and architecture
Ppt should contain explanations, images and at least 20
pages ( use www.zoho.com and docs.google.com)
4. Create your resume in a neat format using google and zoho cloud

Programs on PaaS

1. Write a Google app engine program to generate n even numbers and deploy it to Google cloud
2. Google app engine program multiply two matrices
3. Google app engine program to validate user ; create a database login(username, password)
in mysql and deploy to cloud
4. Write a Google app engine program to display nth largest no from the given list of numbers
and deploy it into google cloud
5. Google app engine program to validate the user Use mysql to store user info and deploy on to
the cloud
6 Implement Program 1-5 using Microsoft Azure

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 6


Department of CSE 15A05710 Grid & Cloud Computing Lab

CASE STUDY- CLOUD COMPUTING

S. Title of Aim of the Demonstration Type of Experiment/


No Experiment Experiment Equipments/ Demonstration
Components to (Lab/Classroom)
be required
1 Case Study of To understand the Computers with Experiment: Student
Amazon services of Internet perform practical
Amazon elastic Connection under supervision of
cloud faculty and Lab
technician.
2 Case Study of To understand the Computers with Experiment:
Azure services of Internet Student perform
Microsoft azure. Connection practical under
supervision of
faculty and Lab
technician.
3 Case Study of To understand the Computers with Experiment: Student
Hadoop services of Internet perform practical
hadoop Connection under supervision of
faculty and Lab
technician.
4 Case Study of To understand the Computers with Experiment: Student
Aneka services of aneka Internet perform practical
elastic cloud. Connection under supervision of
faculty and Lab
technician.
5 Case Study of To understand the Computers with Experiment: Student
Google Apps services of Internet perform practical
Google apps Connection under supervision of
engine faculty and Lab
technician.
6 Google apps To understand the Computers with Experiment: Student
business solution business solution Internet perform practical
for data access application of Connection under supervision of
and data upload Google apps faculty and Lab
technician.
7 Control panel To understand the Computers with Experiment: Student
software application of Internet perform practical
manager hypervisors Connection under supervision of
Application of faculty and Lab
hypervisors technician.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 7


Department of CSE 15A05710 Grid & Cloud Computing Lab

INTRODUCTION TO GRID COMPUTING

GRID TECHNOLOGY
Flexible, secure, coordinated resource sharing among dynamic collections of individuals,
institutions, and resource

Grid architecture

Defined using services and protocols


Using the ―sand hourglass‖ model similar to the TCP/IP protocol stack

"A computational grid is a hardware and software infrastructure that provides dependable,
consistent, pervasive and inexpensive access to high-end computational capabilities."

Grid computing makes it possible to dynamically share and coordinate dispersed,


heterogeneous computing resources. Flexibility and ubiquity are essential characteristics of Web
services technologies such as WSDL (Web Services Description Language), SOAP (Simple
Object Access Protocol), and UDDI (Universal Description, Discovery, and Integration).
The Open Grid Services Architecture (OGSA) combines technologies to unlock and exploit grid-
attached resources. OGSA defines mechanisms to create, manage, and exchange information
between Grid Services, a special type of Web service. The architecture uses WSDL extensively
to describe the structure and behaviour of a service. Service descriptions are located and
discovered using Web Services Inspection Language (WSIL). By combining elements from grid
computing and Web services technologies, OGSA establishes an extensible and interoperable
design and development framework for Grid Services that includes details for service definition,
discovery, and life-cycle management.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 8


Department of CSE 15A05710 Grid & Cloud Computing Lab

GRID COMPUTING PROGRAMS USING GRIDSIM


How to Install GridSim in Windows (in 3 easy steps)

The contents of this DIY has been tested on Windows 7 Ultimate x64 with GridSim 5.2
beta and JDK8u11 x64. It should work similarly on other Windows OS and for different version
of JDK as long as you use Java version 1.5 or newer. The text shown in RED in the DIY
represents the values that will differ depending upon your JDK version and locations.
GridSim is a simulation toolkit for simulating resource modelling and application
scheduling for parallel and distributed computing. Simulation is the only feasible way to analyse
algorithms on large-scale distributed systems of heterogeneous resources.
In this DIY we will see how to install GridSim in Windows easily and efficiently.

Step 1: Setting up the Prerequisites

1. First of all we need to download the GridSim and latest version of the Java Development
Toolkit (JDK). These can be found here:
GridSim 5.2 beta
JDK latest version for Windows

Note: It is advisable that you must download the appropriate version of the JDK for your system
i.e. x86 version for x86 systems and x64 version for x64 systems.

2. GridSim requires a working JRE so install the JDK.

3. Now its time to install the GridSim. Unpack the downloaded 'GridSim5-2.zip' (let the name
of the unpacked folder be 'GridSim'). As you can see there is no executable file inside the folder
so there is no special program to install the GridSim. Later if you want to remove GridSim, then
remove the whole 'GridSim' directory.

Step 2: Setting up the Environment

Now comes the critical part, the most important part of the GridSim setup is the setting up
the paths to different classes and jar files correctly or you won't be able to run your programs
efficiently.

1. The first path to be set is the 'Path' variable which will contain the location of executable
java files such as 'javac' and 'java' and will be used by the GridSim while compiling and
running a GridSim or Java program.

2. The second path to be set is the 'CLASSPATH' variable which will contain the location of the
class files and will be used by the GridSim while executing an application. So we have to set
three consecutive values first one for location of JDK executables, second one is the location of
gridsim.jar file provided in the GridSim and is used exclusively by the GridSim applications and
third one is the location where we have stored our programs.

3. The third path 'GRIDSIM' is optional, it will specify the location of our GridSim programs.
You can set this to avoid typing the lengthy location of your programs again and again.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 9


Department of CSE 15A05710 Grid & Cloud Computing Lab

To set the paths go to the properties of 'My Computer' —> 'Advanced system settings' —>
'Advanced' tab —> 'Environment Variables...' —> under the 'System variables' —> 'New...' —>
in the popped up box set the 'Variable name' and 'Variable Value' as shown and click 'OK'.

Variable name Variable value


1 Path C:\Program Files\Java\jdk1.8.0_11\bin;
C:\Program Files\Java\jdk1.8.0_11\bin;
2 CLASSPATH C:\Users\Dhyan\Desktop\GridSim\jars\*;
C:\Users\Dhyan\Desktop\GridSim\examples;
3 GRIDSIM C:\Users\Dhyan\Desktop\GridSim

Note: We have to close all the opened command prompt windows, if any.

Step 3: Testing the Setup (Compiling and Executing a GridSim Application)

Finally now we can test whether our installation is successful or not. GridSim includes some test
example programs in the 'GridSim\examples\gridsim\' folder that we can use to test our setup.

1. Compiling a GridSim program: If you have followed this DIY then compiling a GridSim
program is pretty straightforward; the basic syntax for compilation is just similar to that of Java
programs i.e. javac filename.java or javac file_location\filename.java. Let us compile the
Example2.java included in 'GridSim\examples\gridsim\example02\' folder. We will now run
the following command in a new command prompt

1 javac C:\Users\Dhyan\Desktop\GridSim\examples\gridsim\example02\Example2.java
Alternatively you can also run the following command if you have set the 'GRIDSIM' variable in
the previous step.

1 javac %GRIDSIM%\examples\gridsim\example02\Example2.java

2. Running the compiled program: The syntax for running a compiled GridSim program is
similar to that of running a program in Java i.e. java filename. In our case we have to type (see
image 1)

1 java gridsim.example02.Example2

OR if you want to save the output of your program to a file you can use the following

1 java gridsim.example02.Example2 > output.txt

Note: The examples given in the GridSim uses the concept of packages hence it is advisable to
go through the basics of packages in Java for a better understanding of the above stated
commands.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 10


Department of CSE 15A05710 Grid & Cloud Computing Lab

Image 1. Testing the Setup.

Some Important Points

• It is important to set the CLASSPATH correctly, if you make any mistake you might get a
class not found error and if you want to supply the classpath externally while compiling
or executing using -cp or -classpath; then for some reason it might not work and you
would still get the same errors.
• Remember to change the 2nd and 3rd CLASSPATH values if you later decide to move
gridsim.jar file or location of your own programs to some other location, respectively and
accordingly.
• Running GridSim requires a lot of memory since there are many objects to be created.
Therefore, it is recommended to have at least 512 MB RAM or increase JVM heap size
when running Java for large simulation experiments. For example to set max. heap size as
300 MB:

1 java -Xmx300m gridsim.example02.Example2

You can also use GridSim with the Eclipse IDE, JBuilder or JCreator. For more
instructions you might want to head here.
• For more information kindly refer the readme.txt and faq.txt provided with the GridSim.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 11


Department of CSE 15A05710 Grid & Cloud Computing Lab

1. Program to create one Grid resource with three machines


AIM

PROGRAM
package gridsim.example01;
import java.util.Calendar;
import java.util.LinkedList;
import gridsim.*;
class Example1
{
public static void main(String[] args)
{
System.out.println("Starting example of how to create one Grid " +"resource");
try
{
int num_user = 0;
Calendar calendar = Calendar.getInstance();
boolean trace_flag = true; // mean trace GridSim
events/activities String[] exclude_from_file = { "" }; String[]
exclude_from_processing = { "" };
String report_name = null;
System.out.println("Initializing GridSim package");
GridSim.init(num_user, calendar, trace_flag, exclude_from_file,
exclude_from_processing, report_name);
GridResource gridResource = createGridResource();
System.out.println("Finish the 1st example");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Unwanted error happens");
}
}
private static GridResource createGridResource()
{
System.out.println("Starting to create one Grid resource with " +"3 Machines
..."); MachineList mList = new MachineList(); System.out.println("Creates a
Machine list");
int mipsRating = 377;

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 12


Department of CSE 15A05710 Grid & Cloud Computing Lab

mList.add( new Machine(0, 4, mipsRating)); // First Machine


System.out.println("Creates the 1st Machine that has 4 PEs and " + "stores it into the
Machine list");
mList.add( new Machine(1, 4, mipsRating)); // Second Machine
System.out.println("Creates the 2nd Machine that has 4 PEs and " +"stores it into the
Machine list");
mList.add( new Machine(2, 2, mipsRating)); // Third Machine
System.out.println("Creates the 3rd Machine that has 2 PEs and " + "stores it into the
Machine list");
String arch = "Sun Ultra"; // system architecture
String os = "Solaris"; // operating system
double time_zone = 9.0; // time zone this resource located
double cost = 3.0; // the cost of using this resource
ResourceCharacteristics resConfig = new ResourceCharacteristics(
arch, os, mList, ResourceCharacteristics.TIME_SHARED, time_zone,
cost); System.out.println();
System.out.println("Creates the properties of a Grid resource and " + "stores the Machine
list");
String name = "Resource_0"; // resource name
double baud_rate = 100.0; // communication speed
long seed = 11L*13*17*19*23+1;
double peakLoad = 0.0; // the resource load during peak hour
double offPeakLoad = 0.0; // the resource load during off-peak hr
double holidayLoad = 0.0; // the resource load during holiday
LinkedList<Integer> Weekends = new LinkedList<Integer>();
Weekends.add(new Integer(Calendar.SATURDAY));
Weekends.add(new Integer(Calendar.SUNDAY));
LinkedList<Integer> Holidays = new LinkedList<Integer>();
GridResource gridRes = null;
try
{
gridRes = new GridResource(name, baud_rate, seed,
resConfig, peakLoad, offPeakLoad, holidayLoad,
Weekends, Holidays);
}
catch (Exception e) {
e.printStackTrace();
}
System.out.println("Finally, creates one Grid resource and stores " +
"the properties of a Grid resource");
return gridRes;
}
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 13


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 14


Department of CSE 15A05710 Grid & Cloud Computing Lab

2. Program to create one or more Grid users. A Grid user contains one or more Gridlets
AIM

PROGRAM
package gridsim.example02;
import java.util.*;
import gridsim.*;
class Example2
{
public static void main(String[] args)
{
System.out.println("Starting example of how to create Grid users");
System.out.println();
try
{
GridletList list = createGridlet();
System.out.println("Creating " + list.size() + " Gridlets");
ResourceUserList userList = createGridUser(list);
System.out.println("Creating " + userList.size() + " Grid users");
printGridletList(list);
System.out.println("Finish the example");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Unwanted error happens");
}
}
private static GridletList createGridlet()
{
GridletList list = new GridletList();
int id = 0;
double length = 3500.0;
long file_size = 300;
long output_size = 300;
Gridlet gridlet1 = new Gridlet(id, length, file_size, output_size);
id++;
Gridlet gridlet2 = new Gridlet(id, 5000, 500, 500);
id++;

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 15


Department of CSE 15A05710 Grid & Cloud Computing Lab

Gridlet gridlet3 = new Gridlet(id, 9000, 900, 900);


list.add(gridlet1);
list.add(gridlet2);
list.add(gridlet3);
Random random = new Random();
GridSimStandardPE.setRating(100);
int count = 5;
double min_range = 0.10;
double max_range = 0.50;
for (int i = 1; i < count+1; i++)
{
length = GridSimStandardPE.toMIs(random.nextDouble()*output_size);
file_size = (long) GridSimRandom.real(100, min_range, max_range,
random.nextDouble());
output_size = (long) GridSimRandom.real(250, min_range,
max_range, random.nextDouble());
Gridlet gridlet = new Gridlet(id + i, length,
file_size, output_size);
list.add(gridlet);
}
return list;
}
private static ResourceUserList createGridUser(GridletList list)
{
ResourceUserList userList = new ResourceUserList();
userList.add(0); // user ID starts from 0
userList.add(1);
userList.add(2);
int userSize = userList.size();
int gridletSize = list.size();
int id = 0;
for (int i = 0; i < gridletSize; i++)
{
if (i != 0 && i % userSize == 0)
id++;
( (Gridlet) list.get(i) ).setUserID(id);
}
return userList;
}
private static void printGridletList(GridletList list)
{
int size = list.size();
Gridlet gridlet;

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 16


Department of CSE 15A05710 Grid & Cloud Computing Lab

String indent = " ";


System.out.println();
System.out.println("Gridlet ID" + indent + "User ID" + indent
+ "length" + indent + " file size" + indent +
"output size");
for (int i = 0; i < size; i++)
{
gridlet = (Gridlet) list.get(i);
System.out.println(indent + gridlet.getGridletID() + indent +
indent + indent + gridlet.getUserID() + indent + indent
+ (int) gridlet.getGridletLength() + indent + indent +
(int) gridlet.getGridletFileSize() + indent + indent +
(int) gridlet.getGridletOutputSize() );
}
}
}

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 17


Department of CSE 15A05710 Grid & Cloud Computing Lab

3. Program to shows how two GridSim entities interact with each other ; main( ie
example3 ) class creates Gridlets and sends them to the other GridSim entities, i.e. Test
class
AIM

PROGRAM
package gridsim.example03;
import java.util.*;
import gridsim.*;
class Example3 extends GridSim
{
private String entityName_;
private GridletList list_;
private GridletList receiveList_;
Example3(String name, double baud_rate, GridletList list) throws
Exception {
super(name);
this.list_ = list;
receiveList_ = new GridletList();
entityName_ = "Test";
new Test(entityName_, baud_rate);
}
public void body()
{
int size = list_.size();
Gridlet obj, gridlet;
for (int i = 0; i < size; i++)
{
obj = (Gridlet) list_.get(i);
System.out.println("Inside Example3.body() => Sending Gridlet "
+ obj.getGridletID());
// Sends one Gridlet at the time with no delay (by using
super.send(entityName_, GridSimTags.SCHEDULE_NOW,
GridSimTags.GRIDLET_SUBMIT, obj);
gridlet = super.gridletReceive();
System.out.println("Inside Example3.body() => Receiving Gridlet
"+ gridlet.getGridletID());
receiveList_.add(gridlet);
}
super.send(entityName_, GridSimTags.SCHEDULE_NOW,

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 18


Department of CSE 15A05710 Grid & Cloud Computing Lab

GridSimTags.END_OF_SIMULATION);
}
public GridletList getGridletList() {
return receiveList_;
}
public static void main(String[] args)
{
System.out.println("Starting Example3");
System.out.println();
try
{
int num_user = 0; // number of users need to be created
Calendar calendar = Calendar.getInstance();
boolean trace_flag = true; // mean trace GridSim events
String[] exclude_from_file = { "" }; String[]
exclude_from_processing = { "" };
String report_name = null;
System.out.println("Initializing GridSim package");
GridSim.init(num_user, calendar, trace_flag, exclude_from_file,
exclude_from_processing, report_name); GridletList
list = createGridlet(); System.out.println("Creating " +
list.size() + " Gridlets"); Example3 obj = new
Example3("Example3", 560.00, list);
GridSim.startGridSimulation(); GridletList newList =
obj.getGridletList();
printGridletList(newList);
System.out.println("Finish Example3");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Unwanted errors happen");
}
}
private static GridletList createGridlet()
{
GridletList list = new GridletList();
int id = 0;
double length = 3500.0;
long file_size = 300;
long output_size = 300;
Gridlet gridlet1 = new Gridlet(id, length, file_size, output_size);
id++;

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 19


Department of CSE 15A05710 Grid & Cloud Computing Lab

Gridlet gridlet2 = new Gridlet(id, 5000, 500, 500);


id++;
Gridlet gridlet3 = new Gridlet(id, 9000, 900, 900);
// Store the Gridlets into a
list list.add(gridlet1);
list.add(gridlet2);
list.add(gridlet3);
long seed = 11L*13*17*19*23+1;
Random random = new Random(seed);
GridSimStandardPE.setRating(100); int
count = 5;
for (int i = 1; i < count+1; i++)
{
length = GridSimStandardPE.toMIs(random.nextDouble()*50);
file_size = (long) GridSimRandom.real(100, 0.10, 0.40,
random.nextDouble());
output_size = (long) GridSimRandom.real(250, 0.10,
0.50, random.nextDouble());
Gridlet gridlet = new Gridlet(id + i, length,
file_size, output_size);
list.add(gridlet);
}
return list;
}
private static void printGridletList(GridletList list)
{
int size = list.size();
Gridlet gridlet;
String indent = " ";
System.out.println();
System.out.println("========== OUTPUT ==========");
System.out.println("Gridlet ID" + indent + "STATUS");
for (int i = 0; i < size; i++)
{
gridlet = (Gridlet) list.get(i);
System.out.print(indent + gridlet.getGridletID() +
indent + indent);
if (gridlet.getGridletStatus() == Gridlet.SUCCESS)
System.out.println("SUCCESS");
}
}
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 20


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 21


Department of CSE 15A05710 Grid & Cloud Computing Lab

4. Program shows how a grid user submits its Gridlets or tasks to one grid resource entity
AIM

PROGRAM
package gridsim.example04;
import java.util.*;
import gridsim.*;
class Example4 extends GridSim
{
private Integer ID_;
private String name_;
private GridletList list_;
private GridletList receiveList_;
Example4(String name, double baud_rate) throws
Exception {
super(name, baud_rate);
this.name_ = name;
this.receiveList_ = new GridletList(); this.ID_ = new Integer(
getEntityId(name) ); System.out.println("Creating a grid user
entity with name = " +
name + ", and id = " + this.ID_);
this.list_ = createGridlet( this.ID_.intValue() );
System.out.println("Creating " + this.list_.size() + " Gridlets");
}
public void body()
{
int resourceID = 0;
String resourceName;
LinkedList resList;
ResourceCharacteristics resChar;
while (true)
{
super.gridSimHold(1.0); // hold by 1 second
resList = super.getGridResourceList();
if (resList.size() > 0)
{
Integer num = (Integer) resList.get(0);
resourceID = num.intValue();
super.send(resourceID, GridSimTags.SCHEDULE_NOW,
GridSimTags.RESOURCE_CHARACTERISTICS, this.ID_);

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 22


Department of CSE 15A05710 Grid & Cloud Computing Lab

resChar = (ResourceCharacteristics) super.receiveEventObject();


resourceName = resChar.getResourceName();
System.out.println("Received ResourceCharacteristics from " +
resourceName + ", with id = " + resourceID);
super.recordStatistics("\"Received ResourceCharacteristics " +
"from " + resourceName + "\"", "");
break;
}
else
System.out.println("Waiting to get list of resources ...");
}
Gridlet gridlet;
String info;
for (int i = 0; i < this.list_.size(); i++)
{
gridlet = (Gridlet) this.list_.get(i);
info = "Gridlet_" + gridlet.getGridletID();
System.out.println("Sending " + info + " to " + resourceName +
" with id = " + resourceID); super.gridletSubmit(gridlet,
resourceID); super.recordStatistics("\"Submit " + info + " to " +
resourceName +
"\"", "");
gridlet = super.gridletReceive();
System.out.println("Receiving Gridlet " + gridlet.getGridletID());
super.recordStatistics("\"Received " + info + " from " +
resourceName + "\"", gridlet.getProcessingCost());
this.receiveList_.add(gridlet);
}
super.shutdownGridStatisticsEntity();
super.shutdownUserEntity();
super.terminateIOEntities();
}
public GridletList getGridletList() {
return this.receiveList_;
}
private GridletList createGridlet(int userID)
{
GridletList list = new GridletList();
int id = 0;
double length = 3500.0;
long file_size = 300;
long output_size = 300;
Gridlet gridlet1 = new Gridlet(id, length, file_size, output_size);

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 23


Department of CSE 15A05710 Grid & Cloud Computing Lab

id++;
Gridlet gridlet2 = new Gridlet(id, 5000, 500, 500);
id++;
Gridlet gridlet3 = new Gridlet(id, 9000, 900, 900);
gridlet1.setUserID(userID);
gridlet2.setUserID(userID);
gridlet3.setUserID(userID);
list.add(gridlet1);
list.add(gridlet2);
list.add(gridlet3);
long seed = 11L*13*17*19*23+1;
Random random = new Random(seed);
GridSimStandardPE.setRating(100);
int count = 5;
for (int i = 1; i < count+1; i++)
{
length = GridSimStandardPE.toMIs(random.nextDouble()*50);
file_size = (long) GridSimRandom.real(100, 0.10, 0.40,
random.nextDouble());
output_size = (long) GridSimRandom.real(250, 0.10,
0.50, random.nextDouble());
Gridlet gridlet = new Gridlet(id + i, length, file_size,output_size);
gridlet.setUserID(userID);
list.add(gridlet);
}
return list;
}
public static void main(String[] args)
{
System.out.println("Starting Example4");
try
{
int num_user = 1; // number of grid users
Calendar calendar = Calendar.getInstance();
boolean trace_flag = true; // mean trace GridSim events
String[] exclude_from_file = { "" }; String[]
exclude_from_processing = { "" };
String report_name = null;
System.out.println("Initializing GridSim package");
GridSim.init(num_user, calendar, trace_flag, exclude_from_file,
exclude_from_processing, report_name);
String name = "Resource_0";
GridResource resource = createGridResource(name);

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 24


Department of CSE 15A05710 Grid & Cloud Computing Lab

Example4 obj = new Example4("Example4", 560.00);


GridSim.startGridSimulation();
GridletList newList = obj.getGridletList();
printGridletList(newList);
System.out.println("Finish Example4");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Unwanted errors happen");
}
}
private static GridResource createGridResource(String name)
{
System.out.println();
System.out.println("Starting to create one Grid resource with " +
"3 Machines");
MachineList mList = new MachineList();
System.out.println("Creates a Machine list");
int mipsRating = 377;
mList.add( new Machine(0, 4, mipsRating)); // First Machine
System.out.println("Creates the 1st Machine that has 4 PEs and " +
"stores it into the Machine list");
mList.add( new Machine(1, 4, mipsRating)); // Second Machine
System.out.println("Creates the 2nd Machine that has 4 PEs and " +
"stores it into the Machine list");
mList.add( new Machine(2, 2, mipsRating)); // Third Machine
System.out.println("Creates the 3rd Machine that has 2 PEs and " +
"stores it into the Machine list");
String arch = "Sun Ultra"; // system architecture
String os = "Solaris"; // operating system
double time_zone = 9.0; // time zone this resource located
double cost = 3.0; // the cost of using this resource
ResourceCharacteristics resConfig = new ResourceCharacteristics(
arch, os, mList, ResourceCharacteristics.TIME_SHARED,
time_zone, cost);
System.out.println("Creates the properties of a Grid resource and " +
"stores the Machine list");
double baud_rate = 100.0; // communication speed
long seed = 11L*13*17*19*23+1;
double peakLoad = 0.0; // the resource load during peak hour
double offPeakLoad = 0.0; // the resource load during off-peak hr
double holidayLoad = 0.0; // the resource load during holiday

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 25


Department of CSE 15A05710 Grid & Cloud Computing Lab

LinkedList Weekends = new LinkedList();


Weekends.add(new
Integer(Calendar.SATURDAY));
Weekends.add(new Integer(Calendar.SUNDAY));
LinkedList Holidays = new LinkedList();
GridResource gridRes = null; try
{
gridRes = new GridResource(name, baud_rate, seed,
resConfig, peakLoad, offPeakLoad, holidayLoad,
Weekends, Holidays);
}
catch (Exception e) {
e.printStackTrace();
}
System.out.println("Finally, creates one Grid resource and stores " +
"the properties of a Grid resource");
System.out.println();
return gridRes;
}
private static void printGridletList(GridletList list)
{
int size = list.size();
Gridlet gridlet;
String indent = " ";
System.out.println();
System.out.println("========== OUTPUT ==========");
System.out.println("Gridlet ID" + indent + "STATUS" + indent
+ "Resource ID" + indent + "Cost");
for (int i = 0; i < size; i++)
{
gridlet = (Gridlet) list.get(i);
System.out.print(indent + gridlet.getGridletID() +
indent + indent);
if (gridlet.getGridletStatus() == Gridlet.SUCCESS)
System.out.print("SUCCESS");
System.out.println( indent + indent + gridlet.getResourceID()
+ indent + indent + gridlet.getProcessingCost() );
}
}
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 26


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 27


Department of CSE 15A05710 Grid & Cloud Computing Lab

5. Program to show how a grid user submits its Gridlets or task to many grid
resource entities
AIM

PROGRAM
package gridsim.example05;
import java.util.*;
import gridsim.*;
class Example5 extends GridSim
{
private Integer ID_;
private String name_;
private GridletList list_;
private GridletList receiveList_;
private int totalResource_;
Example5(String name, double baud_rate, int total_resource)throws Exception
{
super(name, baud_rate);
this.name_ = name;
this.totalResource_ = total_resource;
this.receiveList_ = new GridletList(); this.ID_ = new Integer(
getEntityId(name) ); System.out.println("Creating a grid user
entity with name = " +
name + ", and id = " + this.ID_);
this.list_ = createGridlet( this.ID_.intValue() );
System.out.println("Creating " + this.list_.size() + " Gridlets");
}
public void body()
{
int resourceID[] = new int[this.totalResource_];
double resourceCost[] = new double[this.totalResource_];
String resourceName[] = new String[this.totalResource_];

LinkedList resList;
ResourceCharacteristics resChar;
while (true)
{
super.gridSimHold(1.0); // hold by 1 second
resList = super.getGridResourceList();

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 28


Department of CSE 15A05710 Grid & Cloud Computing Lab

if (resList.size() == this.totalResource_)
break;
else
System.out.println("Waiting to get list of resources ...");
}
int i = 0;
for (i = 0; i < this.totalResource_; i++)
{
resourceID[i] = ( (Integer)resList.get(i) ).intValue();
super.send(resourceID[i], GridSimTags.SCHEDULE_NOW,
GridSimTags.RESOURCE_CHARACTERISTICS, this.ID_);
resChar = (ResourceCharacteristics) super.receiveEventObject();
resourceName[i] = resChar.getResourceName(); resourceCost[i] =
resChar.getCostPerSec(); System.out.println("Received
ResourceCharacteristics from " +
resourceName[i] + ", with id = " + resourceID[i]);
super.recordStatistics("\"Received ResourceCharacteristics " +
"from " + resourceName[i] + "\"", "");
}
Gridlet gridlet;
String info;
Random random = new Random();
int id = 0;
for (i = 0; i < this.list_.size(); i++)
{
gridlet = (Gridlet) this.list_.get(i);
info = "Gridlet_" + gridlet.getGridletID(); id =
random.nextInt(this.totalResource_); System.out.println("Sending
" + info + " to " + resourceName[id] +
" with id = " + resourceID[id]);
super.gridletSubmit(gridlet, resourceID[id]);
super.recordStatistics("\"Submit " + info + " to " +
resourceName[id] + "\"", ""); gridlet =
super.gridletReceive(); System.out.println("Receiving Gridlet " +
gridlet.getGridletID()); super.recordStatistics("\"Received " +
info + " from " +
resourceName[id] + "\"", gridlet.getProcessingCost());
this.receiveList_.add(gridlet);
}
super.shutdownGridStatisticsEntity();
super.shutdownUserEntity();
super.terminateIOEntities();
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 29


Department of CSE 15A05710 Grid & Cloud Computing Lab

public GridletList getGridletList() {


return this.receiveList_;
}
private GridletList createGridlet(int userID)
{
GridletList list = new GridletList();
int id = 0;
double length = 3500.0;
long file_size = 300;
long output_size = 300;
Gridlet gridlet1 = new Gridlet(id, length, file_size, output_size);
id++;
Gridlet gridlet2 = new Gridlet(id, 5000, 500, 500);
id++;
Gridlet gridlet3 = new Gridlet(id, 9000, 900, 900);
gridlet1.setUserID(userID);
gridlet2.setUserID(userID);
gridlet3.setUserID(userID);
list.add(gridlet1);
list.add(gridlet2);
list.add(gridlet3);
long seed = 11L*13*17*19*23+1;
Random random = new Random(seed);
GridSimStandardPE.setRating(100);
int count = 5;
for (int i = 1; i < count+1; i++)
{
length = GridSimStandardPE.toMIs(random.nextDouble()*50);
file_size = (long) GridSimRandom.real(100, 0.10, 0.40,
random.nextDouble());
output_size = (long) GridSimRandom.real(250, 0.10,
0.50, random.nextDouble());
Gridlet gridlet = new Gridlet(id + i, length,
file_size, output_size);
gridlet.setUserID(userID);
list.add(gridlet);
}
return list;
}
public static void main(String[] args)
{
System.out.println("Starting Example5");
try

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 30


Department of CSE 15A05710 Grid & Cloud Computing Lab

{
int num_user = 1; // number of grid users
Calendar calendar = Calendar.getInstance();
boolean trace_flag = false; // mean don't trace GridSim events
String[] exclude_from_file = { "" }; String[]
exclude_from_processing = { "" };
String report_name = null;
System.out.println("Initializing GridSim package");
GridSim.init(num_user, calendar, trace_flag, exclude_from_file,
exclude_from_processing, report_name);
GridResource resource0 = createGridResource("Resource_0");
GridResource resource1 = createGridResource("Resource_1");
GridResource resource2 = createGridResource("Resource_2");
int total_resource = 3;
Example5 obj = new Example5("Example5", 560.00, total_resource);
GridSim.startGridSimulation();
GridletList newList = obj.getGridletList();
printGridletList(newList);
System.out.println("Finish Example5");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Unwanted errors happen");
}
}
private static GridResource createGridResource(String name)
{
System.out.println();
System.out.println("Starting to create one Grid resource with " +
"3 Machines");
MachineList mList = new MachineList();
System.out.println("Creates a Machine list");
int mipsRating = 377;
mList.add( new Machine(0, 4, mipsRating)); // First Machine
System.out.println("Creates the 1st Machine that has 4 PEs and " +
"stores it into the Machine list");
mList.add( new Machine(1, 4, mipsRating)); // Second Machine
System.out.println("Creates the 2nd Machine that has 4 PEs and " +
"stores it into the Machine list");
mList.add( new Machine(2, 2, mipsRating)); // Third Machine
System.out.println("Creates the 3rd Machine that has 2 PEs and " +
"stores it into the Machine list");

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 31


Department of CSE 15A05710 Grid & Cloud Computing Lab

String arch = "Sun Ultra"; // system architecture


String os = "Solaris"; // operating system
double time_zone = 9.0; // time zone this resource located
double cost = 3.0; // the cost of using this resource
ResourceCharacteristics resConfig = new
ResourceCharacteristics( arch, os, mList,
ResourceCharacteristics.TIME_SHARED, time_zone, cost);
System.out.println("Creates the properties of a Grid resource and "
+ "stores the Machine list");
double baud_rate = 100.0; // communication speed
long seed = 11L*13*17*19*23+1;
double peakLoad = 0.0; // the resource load during peak hour
double offPeakLoad = 0.0; // the resource load during off-peak hr
double holidayLoad = 0.0; // the resource load during holiday
LinkedList Weekends = new LinkedList(); Weekends.add(new
Integer(Calendar.SATURDAY)); Weekends.add(new
Integer(Calendar.SUNDAY)); LinkedList Holidays = new
LinkedList();
GridResource gridRes = null;
try
{
gridRes = new GridResource(name, baud_rate, seed,
resConfig, peakLoad, offPeakLoad, holidayLoad,
Weekends, Holidays);
}
catch (Exception e) {
e.printStackTrace();
}
System.out.println("Finally, creates one Grid resource and stores " +
"the properties of a Grid resource");
System.out.println();
return gridRes;
}
private static void printGridletList(GridletList list)
{
int size = list.size();
Gridlet gridlet;
String indent = " ";
System.out.println();
System.out.println("========== OUTPUT ==========");
System.out.println("Gridlet ID" + indent + "STATUS" + indent
+ "Resource ID" + indent + "Cost");
for (int i = 0; i < size; i++)

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 32


Department of CSE 15A05710 Grid & Cloud Computing Lab

{
gridlet = (Gridlet) list.get(i);
System.out.print(indent + gridlet.getGridletID() +
indent + indent);

if (gridlet.getGridletStatus() == Gridlet.SUCCESS)
System.out.print("SUCCESS");
System.out.println( indent + indent + gridlet.getResourceID()
+ indent + indent + gridlet.getProcessingCost() );
}
}
}

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 33


Department of CSE 15A05710 Grid & Cloud Computing Lab

6. Program to show how to create one or more grid users and submits its Gridlets or task
to many grid resource entities
AIM

PROGRAM
package gridsim.example06;
import java.util.*;
import gridsim.*;
class Example6 extends GridSim
{
private Integer ID_;
private String name_;
private GridletList list_;
private GridletList receiveList_;
private int totalResource_;
Example6(String name, double baud_rate, int total_resource)throws Exception
{
super(name, baud_rate);
this.name_ = name;
this.totalResource_ = total_resource;
this.receiveList_ = new GridletList(); this.ID_ = new Integer(
getEntityId(name) ); System.out.println("Creating a grid user
entity with name = " +
name + ", and id = " + this.ID_);
this.list_ = createGridlet( this.ID_.intValue() );
System.out.println(name + ":Creating "+ this.list_.size() +
" Gridlets");
}
public void body()
{
int resourceID[] = new int[this.totalResource_];
double resourceCost[] = new double[this.totalResource_];
String resourceName[] = new String[this.totalResource_];
LinkedList resList;
ResourceCharacteristics resChar;
while (true)
{
super.gridSimHold(1.0); // hold by 1 second
resList = super.getGridResourceList();

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 34


Department of CSE 15A05710 Grid & Cloud Computing Lab

if (resList.size() == this.totalResource_)
break;
else
{
System.out.println(this.name_ +
":Waiting to get list of resources ...");
}
}
int i = 0;
for (i = 0; i < this.totalResource_; i++)
{
resourceID[i] = ( (Integer)resList.get(i) ).intValue();
super.send(resourceID[i], GridSimTags.SCHEDULE_NOW,
GridSimTags.RESOURCE_CHARACTERISTICS,
this.ID_); resChar = (ResourceCharacteristics)
super.receiveEventObject(); resourceName[i] =
resChar.getResourceName(); resourceCost[i] =
resChar.getCostPerSec(); System.out.println(this.name_ +
":Received ResourceCharacteristics from " +
resourceName[i] + ", with id = " + resourceID[i]);
super.recordStatistics("\"Received ResourceCharacteristics "
+ "from " + resourceName[i] + "\"", "");
}
Gridlet gridlet;
String info;
int id = 0;
for (i = 0; i < this.list_.size(); i++)
{
gridlet = (Gridlet) this.list_.get(i);
info = "Gridlet_" + gridlet.getGridletID();
id = GridSimRandom.intSample(this.totalResource_);
System.out.println(this.name_ + ":Sending " + info + " to " +
resourceName[id] + " with id = " + resourceID[id]);
super.gridletSubmit(gridlet, resourceID[id]);
super.recordStatistics("\"Submit " + info + " to " +
resourceName[id] + "\"", ""); gridlet =
super.gridletReceive(); System.out.println(this.name_ +
":Receiving Gridlet " +
gridlet.getGridletID() );
super.recordStatistics("\"Received " + info + " from " +
resourceName[id] + "\"", gridlet.getProcessingCost());
this.receiveList_.add(gridlet);
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 35


Department of CSE 15A05710 Grid & Cloud Computing Lab

super.shutdownGridStatisticsEntity();
super.shutdownUserEntity();
super.terminateIOEntities();
System.out.println(this.name_ + ":%%%% Exiting body()");
}

public GridletList getGridletList() {


return this.receiveList_;
}
private GridletList createGridlet(int userID)
{
GridletList list = new GridletList();
int id = 0;
double length = 3500.0;
long file_size = 300;
long output_size = 300;
Gridlet gridlet1 = new Gridlet(id, length, file_size, output_size);
id++;
Gridlet gridlet2 = new Gridlet(id, 5000, 500, 500);
id++;
Gridlet gridlet3 = new Gridlet(id, 9000, 900, 900);
gridlet1.setUserID(userID);
gridlet2.setUserID(userID);
gridlet3.setUserID(userID);
list.add(gridlet1);
list.add(gridlet2);
list.add(gridlet3);
GridSimStandardPE.setRating(100);
int max = 5;
int count = GridSimRandom.intSample(max);
for (int i = 1; i < count+1; i++)
{
length = GridSimStandardPE.toMIs(GridSimRandom.doubleSample()*50);
file_size = (long) GridSimRandom.real(100, 0.10, 0.40,
GridSimRandom.doubleSample());

output_size = (long) GridSimRandom.real(250, 0.10,


0.50, GridSimRandom.doubleSample());
Gridlet gridlet = new Gridlet(id + i, length,
file_size, output_size);
gridlet.setUserID(userID);
list.add(gridlet);
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 36


Department of CSE 15A05710 Grid & Cloud Computing Lab

return list;
}
public static void main(String[] args)
{
System.out.println("Starting Example6");
try
{
int num_user = 3; // number of grid users
Calendar calendar = Calendar.getInstance();
boolean trace_flag = false; // mean don't trace GridSim events
String[] exclude_from_file = { "" }; String[]
exclude_from_processing = { "" };
String report_name = null;
GridSim.init(num_user, calendar, trace_flag, exclude_from_file,
exclude_from_processing, report_name);
GridResource resource0 = createGridResource("Resource_0");
GridResource resource1 = createGridResource("Resource_1");
GridResource resource2 = createGridResource("Resource_2");
int total_resource = 3;
Example6 user0 = new Example6("User_0", 560.00, total_resource);
Example6 user1 = new Example6("User_1", 250.00, total_resource);
Example6 user2 = new Example6("User_2", 150.00, total_resource);

GridSim.startGridSimulation();
GridletList newList = null;
newList = user0.getGridletList();
printGridletList(newList, "User_0");
newList = user1.getGridletList();
printGridletList(newList, "User_1");
newList = user2.getGridletList();
printGridletList(newList, "User_2");
System.out.println("Finish Example6");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Unwanted errors happen");
}
}
private static GridResource createGridResource(String name)
{
MachineList mList = new MachineList();
int mipsRating = 377;

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 37


Department of CSE 15A05710 Grid & Cloud Computing Lab

mList.add( new Machine(0, 4, mipsRating)); // First Machine


mList.add( new Machine(1, 4, mipsRating)); // Second Machine
mList.add( new Machine(2, 2, mipsRating)); // Third Machine
String arch = "Sun Ultra"; // system architecture
String os = "Solaris"; // operating system
double time_zone = 9.0; // time zone this resource located
double cost = 3.0; // the cost of using this resource
ResourceCharacteristics resConfig = new
ResourceCharacteristics( arch, os, mList,
ResourceCharacteristics.TIME_SHARED, time_zone, cost);
double baud_rate = 100.0; // communication speed
long seed = 11L*13*17*19*23+1;
double peakLoad = 0.0; // the resource load during peak hour
double offPeakLoad = 0.0; // the resource load during off-peak hr
double holidayLoad = 0.0; // the resource load during holiday
LinkedList Weekends = new LinkedList(); Weekends.add(new
Integer(Calendar.SATURDAY)); Weekends.add(new
Integer(Calendar.SUNDAY)); LinkedList Holidays = new
LinkedList();
GridResource gridRes = null;
try {
gridRes = new GridResource(name, baud_rate, seed,
resConfig, peakLoad, offPeakLoad, holidayLoad,
Weekends, Holidays);
}
catch (Exception e) {
e.printStackTrace();
}
System.out.println("Creates one Grid resource with name = " + name);
return gridRes;
}
private static void printGridletList(GridletList list, String name)
{
int size = list.size();
Gridlet gridlet;
String indent = " ";
System.out.println();
System.out.println("========== OUTPUT for " + name + " ==========");
System.out.println("Gridlet ID" + indent + "STATUS" + indent
+ "Resource ID" + indent + "Cost");
for (int i = 0; i < size; i++)
{
gridlet = (Gridlet) list.get(i);

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 38


Department of CSE 15A05710 Grid & Cloud Computing Lab

System.out.print(indent + gridlet.getGridletID() +
indent + indent);
if (gridlet.getGridletStatus() == Gridlet.SUCCESS)
System.out.print("SUCCESS");
System.out.println( indent + indent + gridlet.getResourceID()
+ indent + indent + gridlet.getProcessingCost() );
}
}
}

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 39


Department of CSE 15A05710 Grid & Cloud Computing Lab

GRID COMPUTING PROGRAMS


USING USE GLOBUS TOOLKIT OR EQUIVALENT:

GLOBUS TOOLKIT

The Globus Toolkit provides software tools to make it easier to build computational grids and
grid-based applications. The Globus Toolkit is both an open architecture and open source toolkit.
• The Globus Toolkit is a product of the Globus Alliance (http://www.globus.org)
• It is middleware for developing grids
• The current release is 6.0.
• Four key protocols and APIs
– Grid Security Infrastructure (GSI)
– Grid Resource Allocation & Mgmt (GRAM)
– Grid Resource Information Protocol (GRIP) and Index Information Protocol (GIIP)
– Grid File Transfer Protocol (GridFTP)
• Implementations on many platforms
– Resources, security systems, data models,
• Various collective layer protocols & tools
– Info services, replica management, etc.
• A basis for many Grid-enabled tools & apps FTP, SSH, Condor, SRB, MPI, EDG,
GridPort,

GLOBUS TOOLKIT™ COMPONENTS


• Security
- GSI – Grid Security Infrastructure
• Resource Management
- GRAM – Grid Resource Allocation
Manager globusrun
RSL
gatekeeper
job manager
DUROC–Dynamically-Updated Request Online Coallocator
• Information Services
MDS – Monitoring and Discovery Service

GRIS – Grid Resource Information Service


GIIS–Grid Index Information Service
MDS Client
• Data Management
o GridFTP, GASS

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 40


Department of CSE 15A05710 Grid & Cloud Computing Lab

The Globus Toolkit latest version 6.0 includes:

GSI: security
GridFTP: file transfer
GRAM: job execution/resource management
MyProxy: credential repository/certificate authority
GSI-OpenSSH: GSI secure single sign-on remote shell

GLOBUS TOOLKIT INSTALLATION PROCEDURE


Step1: For installing Globus Toolkit nothing more easy than download the latest
package: http://toolkit.globus.org/ftppub/gt6/installers/repo/globus-toolkit-
repo_latest_all.deb sudodpkg -iglobus-toolkit-repo_latest_all.deb Step2: Update the
repositories: sudo apt-get update
Step3: To install Debian or Ubuntu package, download the globus-toolkit-repo
package from the link above and install it with the command:
root@sysa63:/home/#dpkg -iglobus-toolkit-repo_latest_all.deb Do
the following for Debian-based systems: root@sysa63:/home/#apt-get
install globus-data-management-client

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 41


Department of CSE 15A05710 Grid & Cloud Computing Lab

1 Develop a new Web Service for Calculator.

AIM:

PROCEDURE:

When we start Globus toolkit container, there will be number of services starts up. The
service for this task will be a simple Math service that can perform basic arithmetic for a
client.
The Math service will access a resource with two properties:
1. An integer value that can be operated upon by the service.
2. A string values that holds string describing the last operation.

The service itself will have three remotely accessible operations that operate upon value:
(a) add, that adds a to the resource property value.
(b) subtract that subtracts a from the resource property value.
(c) getValueRP that returns the current value of value.

Usually, the best way for any programming task is to begin with an overall description of
what you want the code to do, which in this case is the service interface. The service interface
describes how what the service provides in terms of names of operations, their arguments and
return values. Java interface for our service is:

public interface Math {


public void add(int a);
public void subtract(int a);
public int getValueRP();
}

It is possible to start with this interface and create the necessary WSDL file using the standard
Web service tool called Java2WSDL. However, the WSDL file for GT 4 has to include
details of resource properties that are not given explicitly in the interface above. Hence, we
will provide the WSDL file.

Step 1 - Getting the Files

All the required files are provided. The MathService source code files can be found from
http://www.gt4book.com
(http://www.gt4book.com/downloads/gt4book-examples.tar.gz)

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 42


Department of CSE 15A05710 Grid & Cloud Computing Lab

AWindows zip compressed version can be found at


http://www.cs.uncc.edu/~abw/ITCS4146S07/gt4book-examples.zip.Downloadand
uncompress the file into a directory called GT4services. Everything is included (the java
source WSDL and deployment files, etc.):

WSDL service interface description file -- The WSDL service interface description file is
provided within the GT4services folder at:
GT4 ervices\schema\examples\MathService instance\Math.wsdl

Service code in Java -- Both the code for service operations and for the resource properties are
put in the same class for convenience. More complex services and resources would be defined
in separate classes. The Java code for the service and its resource properties is located within
the GT4services folder at:
GT4services\org\globus\examples\services\core\first\impl\MathService.java.

Deployment Descriptor -- The deployment descriptor gives several different important sets of
information about the service once it is deployed. It is located within the GT4services folder
at:
GT4services\org\globus\examples\services\core\first\deploy-server.wsdd.

Step 2 – Building the Math Service

It is now necessary to package all the required files into a GAR (Grid Archive) file. The
build tool ant from the Apache Software Foundation is used to achieve this as shown
overleaf:
Generating a GAR file with Ant (from http://gdp.globus.org/gt4-
tutorial/multiplehtml/ch03s04.html)
Ant is similar in concept to the UNIX make tool but a java tool and XML based.
Build scripts are provided by Globus 4 to use the ant build file. The windows version

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 43


Department of CSE 15A05710 Grid & Cloud Computing Lab

of the build script for MathService is the Python file called globus-build-service.py, which
held in the GT4services directory. The build script takes one argument, the
name of your service that you want to deploy. To keep with the naming convention, this
service will be called first.
In the Client Window, run the build script from the GT4services directory with:
globus-build-service.py first
The output should look similar to the following:

Buildfile: build.xml…..
BUILD SUCCESSFUL

Total time: 8 seconds


During the build process, a new directory is created in your GT4Services directory that is
named build. ll of your stubs and class files that were generated will be in that directory and
its subdirectories. More importantly, there is a GAR (Grid Archive)
file called org globus examples services core first.gar.

The G R file is the package that contains every file that is needed to successfully deploy your
Math Service into the Globus container. The files contained in the GAR file are the Java class
files, WSDL, compiled stubs, and the deployment descriptor.

Step 3 – Deploying the Math Service


If the container is still running in the Container Window, then stop it using Control-C. To
deploy the Math Service, you will use a tool provided by the Globus Toolkit called globus-
deploy-gar. In the Container Window, issue the command:
globus-deploy-gar org_globus_examples_services_core_first.gar
Successful output of the command is :

The service has now been deployed. Check service is deployed by starting container from
the Container Window. You should see the service called MathService.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 44


Department of CSE 15A05710 Grid & Cloud Computing Lab

Step 4 – Compiling the Client

A client has already been provided to test the Math Service and is located in the
GT4Services directory at:
GT4Services\org\globus\examples\clients\MathService instance\Client.java

package org.globus.examples.clients.MathService_instance; import


org.apache.axis.message.addressing.Address;
import org.apache.axis.message.addressing.EndpointReferenceType; import
org.globus.examples.stubs.MathService_instance.MathPortType; import
org.globus.examples.stubs.MathService_instance.GetValueRP;
importorg.globus.examples.stubs.MathService_instance.service.MathServiceAddressingLocator;
public class Client {
public static void main(String[] args) {
MathServiceAddressingLocator locator = new
MathServiceAddressingLocator()
try {
String serviceURI = args[0];
// Create endpoint reference to service
EndpointReferenceType endpoint = new
EndpointReferenceType(); endpoint.setAddress(new
Address(serviceURI)); MathPortType math;
// Get PortType
math = locator.getMathPortTypePort(endpoint);

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 45


Department of CSE 15A05710 Grid & Cloud Computing Lab

// Perform an addition
math.add(10);
// Perform another
addition math.add(5);
// Access value
System.out.println("Current value: "
+ math.getValueRP(new GetValueRP()));
// Perform a subtraction
math.subtract(5);
// ccess value
System.out.println("Current value: "
+ math.getValueRP(new GetValueRP())); }
catch (Exception e) { e.printStackTrace();
}
}
}

When the client is run from the command line, you pass it one argument. The argument is the
URL that specifies where the service resides. The client will create the end point rerference
and incorporate this URL as the address.

The end point reference is then used with the getMathPortTypePort method of a
MathServiceAdressingLocator object to obtain a reference to the Math interface(portType).
Then, we can apply the methods available in the service as though they were local methods
Notice that the call to the service (add and subtract method calls) must be in a ―try {}
catch(){}‖ block because a ―RemoteException‖ may be thrown. The code for the
―MathServiceAddressingLocator‖ is created during the build process.

(a) Settting the Classpath


To compileASANthenewclient,youwillneedtheJARfilesfromtheGlobus toolkit in your
CLASSPATH. Do this by executing the following command in the Client Window:
%GLOBUS LOCATION%\etc\globus-devel-env.bat
You can verify that this sets your CLASSPATH, by executing the command:
echo %CLASSPATH%
You should see a long list of JAR files. Running \gt4\etc\globus-devel-env.bat only needs to
be done once for each Client Window that you open. It does not need to be done each time
you compile.
(b) Compiling Client
Once your CLAS PATH has been set, then you can compile the Client code by typing in the
following command:
javac -classpath

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 46


Department of CSE 15A05710 Grid & Cloud Computing Lab

build\classes\org\globus\examples\services\core\first\impl\:%CL SSPATH%
org\globus\examples\clients\Math ervice instance\Client.java
Step 5 – Start the Container for your ervice
Restart the Globus container from the Container Window
with: globus-start-container -nosec
Step 6 – Run the Client
To start the client from your GT4Services directory, do the following in the Client Window,
which passes the GSH of the service as an argument:
java -classpath
build\classes\org\globus\examples\services\core\first\impl\:%CLASSPATH%
org.globus.examples.clients.MathService_instance.Client
http://localhost:8080/wsrf/services/examples/core/first/MathService

The output will be:


Current value: 15
Current value: 10

Step 7 – Undeploy the Math Service and Kill a Container

Before we can add functionality to the Math Service , we must undeploy the service. In the
Container Window, kill the container with a Control-C. Then to undeploy the service, type in
the following command:
globus-undeploy-gar org_globus_examples_services_core_first which should result with
the following output:
Undeploying gar...
Deleting /...
Undeploy successful

Step 8 - Adding Functionality to the Math Service

In this final task, you are asked to modify the Math service and associated files so the service
supports the multiplication operation. To do this task, you will need to modify:

Service code (Math service.java)

WSDL file (Math.wsdl)

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 47


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 48


Department of CSE 15A05710 Grid & Cloud Computing Lab

2 Develop new OGSA-compliant Web Service.

AIM:

PROCEDURE:

Writing and deploying a WSRF Web Service is easier. We just have to follow five
simple steps:

1. Define the service's interface. This is done with WSDL.


2. Implement the service. This is done with Java.
3. Define the deployment parameters. This is done with WSDD and J DI.
4. Compile everything and generate a GAR file. This is done with Ant.
5. Deploy service. This is also done with a GT4 tool.

To run this program, as a minimum we will be required to have installed the following
prerequisite software.

1. Download the latest Axis2 runtime from the above link and extract it. Now we point
Eclipse WTP to downloaded xis2 Runtime.
Open Window -> Preferences -> WebServices -> Axis2 Emitter

2. Select the Axis2 Runtime tab and point to the correct Axis2 runtime location. Alternatively
at the Axis2 Preference tab, you can set the default setting that will come up on the Web
Services Creation wizards. For the moment we will accept the default settings.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 49


Department of CSE 15A05710 Grid & Cloud Computing Lab

a. Click OK.
b. Next we need to create a project with the support of Axis2 features. Open File ->
New -> Other... -> Web -> Dynamic Web Project
c. Click next

3. Select the name Axis2W Test as the Dynamic Web project name (you can specify any name
you prefer), and select the configured Tomcat runtime as the target runtime. Click next.

4. Select the Axis2 Web service facet. Click Finish.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 50


Department of CSE 15A05710 Grid & Cloud Computing Lab

5. This will create a dynamic Web project in the workbench.

6. Import the wtp/Converter.java class into Axis2WSTest/src (be sure to preserve


the package). Build the Project, if it not auto build.

8. Select Converter.java, open File -> New -> Other... -> Web Services -> Web
Service. Click next.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 51


Department of CSE 15A05710 Grid & Cloud Computing Lab

9. The Web service wizard would be brought up with Web service type set to Bottomup Java
bean Web Service with the service implementation automatically filled in.Move the service
scale to Start service.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 52


Department of CSE 15A05710 Grid & Cloud Computing Lab

9. Click on the Webservice runtime link to select the Axis2 runtime. Click OK.

10. Ensure that the correct server and service project are selected as displayed below. Click
next.

11. This page is the service.xml selection page. if you have a custom services.xml, you can
include that by clicking the Browse button. For the moment, just leave it at the default.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 53


Department of CSE 15A05710 Grid & Cloud Computing Lab

Click next.

12. This page is the Start Server page. It will be displayed if the server has not been
started. Click on the Start Server button. This will start the server runtime.

Click next.

13. This page is the Web services publication page, accept the defaults.

Click Finish.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 54


Department of CSE 15A05710 Grid & Cloud Computing Lab

14. Now, select the Axis2WSTest dynamic Web project, right-click and select Run -> Run As
- > Run on Server to bring up the Axis2 servlet.

Click Next.

15. Make sure you have the xis2W Test dynamic Web project on the right-hand side under
the Configured project.

Click Finish.

16. This will deploy the Axis2 server webapp on the configured servlet container and will
display the Axis2 home page. Note that the servlet container will start up according to the
Server configuration files on your workspace.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 55


Department of CSE 15A05710 Grid & Cloud Computing Lab

17. Click on the ervices link to view the available services. The newly created converter Web
service will be shown there.

18. Click on the Converter Service link to display the wsdl URL of the newly created Web
service. Copy the URL.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 56


Department of CSE 15A05710 Grid & Cloud Computing Lab

19. Now we'll generate the client for the newly created service by referring the ?wsdl generated
by the Axis2 erver. Open File -> New -> Other... -> Web Services -> WebServiceClient

20. Paste the URL that was copied earlier into the service definition field.

21. Click on the Client project hyperlink and enterxis2WSTestClient as the name ofthe
client project. Click OK.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 57


Department of CSE 15A05710 Grid & Cloud Computing Lab

22. Back on the Web Services Client wizard, make sure the Web service runtime is set to
Axis2 and the server is set correctly. Click Next.

23. Next page is the Client Configuration Page. Accept the defaults and click Finish.

24. The Clients stubs will be generated to your Dynamic Web project Axis2WSTestClient.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 58


Department of CSE 15A05710 Grid & Cloud Computing Lab

25. Now we are going to write Java main program to invoke the client stub. Import the
ConverterClient.java file to the workspace into the wtp package in the src folder of
Axis2WSTestClient.

26. Then select the ConverterClient file, right-click and select Run As -> Java Application.
Here's what you get on the server console:

27. Another way to test and invoke the service is to select Generate test case to testthe service
check box on the xis2 Client Web Service Configuration Page whengoing through the Web
Service Client wizard.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 59


Department of CSE 15A05710 Grid & Cloud Computing Lab

28. If that option is selected, the Axis2 emitter will generate JUnit testcases matching the
WSDL we provide to the client. These JUnit testcases will be generated to a newly added
source directory to the Axis2WSTestClient project called test.

Next thing we need to do is to insert the test case with the valid inputs as the Web service
method arguments. In this case, let's test the ConverterConverter OAP11Port httpTest.java by
provide values for Celsius and Farenheit for the temperature conversion. s an example, replace
the generated TODO statement in each test method to fill in the data with values as:
testfarenheitToCelsius() -> farenheitToCelsius8.setFarenheit(212);
testStartfarenheitToCelsius() ->farenheitToCelsius8.setFarenheit(212);
testcelsiusToFarenheit() -> celsiusToFarenheit10.setCelsius(100);
testStartcelsiusToFarenheit() -> celsiusToFarenheit10.setCelsius(100);

Here the testcases were generated to test both the synchronous and asynchronous clients.

29. After that, select the test case, right-click, select Run As -> JUnit Test. You will be to
run able the unit test successfully invoking the Web service.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 60


Department of CSE 15A05710 Grid & Cloud Computing Lab

The Web Service wizard orchestrates the end-to-end generation, assembly, deployment,
installation and execution of the Web service and Web service client. Now that your Web service
is running, there are a few interesting things you can do with this WSDL file. Examples:

We can choose Web Services -> Test with Web Services Explorer to test the service.
We can choose Web Services -> Publish WSDL file to publish the service to a public
UDDI registry.

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 61


Department of CSE 15A05710 Grid & Cloud Computing Lab

3 Using Apache Axis develop a Grid Service.

AIM:

PROCEDURE:

We will need to download and install the following software:


1. Java 2 SDK v1.4.1, http://java.sun.com/j2se/1.4.1/download.html
2. Apache Tomcat v4.124
http://jakartaASAN.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.24/bin/jakarta/
tomcat4.1.24.exe.
3. XML Security v1.0.4,http://www.apache.org/dist/xml/security/java-
library/xmlsecuritybin1.0.4.zip

4. Axis v1.1, http://ws.apache.org/axis/dist/1 1/axis-1 1.zip

1. Java 2SDK
Run the downloaded executable (j2sdk-1 4 1-windows-i586.exe) which will install the SDK
in C:\j2sdk1.4.1. Set the JAVA HOME environment variable to point to this directory as
follows:
Click on START->CONTROL P NEL->SYSTEM
Click on the Advanced tab
Click on the Environment Variables button
Click on the New… button in the user variable section and enter the details
Add the Java binaries to your PATH variable in the same way by setting a user variable
called PATH with the value ―%PATH%;C:\j2sdk1.4.1\bin‖

2. Apache Tomcat

Run the downloaded executable (jakarta-tomcat-4.1.24.exe), and assume


the installation directory is C:\jakarta-tomcat-4.1.24.
Edit C:\ jakarta-tomcat-4.1.24\conf\tomcat-users.xml and create an ―admin‖ and ―manager‖
role as well as a user with both roles. The contents of the file should be similar to:
<?xml version='1.0' encoding='utf8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="myuser" password="mypass"
roles="admin,manager"/></tomcat-users>

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 62


Department of CSE 15A05710 Grid & Cloud Computing Lab

Start Tomcat by running C:\ jakarta-tomcat-4.1.24\bin\startup.bat and test it by browsing


http://localhost:8080/
Stop Tomcat by running C:\ jakarta-tomcat-4.1.24\bin\shutdown.bat.

3. XML Security
Download and unzip
http://www.apache.org/dist/xml/security/javalibrary/xmlsecurity-bin 1_0_4.zip
Copy xml-sec.jar to C:\axis-1_1\lib\
Set-up your CLASSPATH environment variable to including the following:
C:\axis1 1\lib\xml-sec.jar;

4. Apache Axis
Unzip the downloaded Axis archive to C: (this will create a directory C:\axis-1_1).
Extract the file xmlsec.jar from the downloaded security archive to C:\axis1
1\webapps\axis\WEB-INF\lib.

Set-up your CLASSPATH environment variable to including the following:


The current working directory
All the AXIS jar files as found in C:\axis-1 1\lib
C:\jakarta-tomcat-4.1.24\common\lib\servlet.jar
Your CLASSPATH should therefore look something like:
C:\axis-1 1\lib\axis.jar;
C:\axis 1 1\lib\axis-ant.jar;
C:\axis-1 1\lib\commons-discovery.jar;
C:\axis-1 1\lib\commons-logging.jar;
C:\axis-1 1\lib\jaxrpc.jar;
C:\axis-1 1\lib\log4j-1.2.8.jar;
C:\axis-1 1\lib\saaj.jar;
C:\axis-1 1\lib\wsdl4j.jar;
C:\axis-1 1\lib\xercesImpl.jar
C:\axis-1 1\lib\xmlParser PIs.jar;
C:\jakarta-tomcat-4.1.24\common\lib\servlet.jar
C:\axis-1 1\lib\xml-sec.jar;

Now tell Tomcat about your Axis web application by creating the file
C:\jakarta-tomcat-4.1.24\webapps\axis.xml with the following content:
<Context path="/axis" docBase="C:\axis-1_1\webapps\axis" debug="0"
privileged="true">
<LoggerclassName="org.apache.catalina.logger.FileLogger"prefix="axis_lo."
suffix=".txt" timestamp="false"/>

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 63


Department of CSE 15A05710 Grid & Cloud Computing Lab

5. Deploy a Sample Web service packaged within Axis installations


Deploy one of the sample Web Services to test the system and to create the C:\axis-
1_1\webapps\axis\WEB -INF\server-config.wsdd file. From C:\axis-1_1 issue the command
(on one line):
java org.apache.axis.client.AdminClient
http://localhost:8080/axis/services/AdminService/samples/stock/deploy.wsdd
This should return the following:
.- Processing file samples/stock/deploy.wsdd .-
<Admin>Done processing</Admin>

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 64


Department of CSE 15A05710 Grid & Cloud Computing Lab

4 Develop applications using Java or C/C++ Grid APIs

AIM:

SAMPLE CODE:
import AgentTeamwork.Ateam.*;
import MPJ.*;
public class UserProgAteam extends AteamProg {
private int phase;
public UserProgAteam( Ateam o )
{}
public UserProgAteam( )
{}
// real const
public UserProgAteam( String[] args ) {
phase = 0;
}
// phase recovery
private void userRecovery( ) {
phase = ateam.getSnapshotId( );
}
private void compute( ) {
for ( phase = 0; phase < 10; phase++ ) {
try {
Thread.currentThread( ).sleep( 1000 );
}
catch(InterruptedException e ) {
}
ateam.takeSnapshot( phase );
System.out.println( "UserProg team at rank " + MPJ.COMM WORLD.Rank( ) + " : took a
snapshot " + phase );
}
}
public static void main( String[] args ) {
System.out.println( "UserProg team: got started" );
MPJ.Init( args, ateam);
UserProg team program = null;
// Timer timer = new Timer( ); if (
ateam.isResumed( ) ) { program =
( UserProgAteam )

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 65


Department of CSE 15A05710 Grid & Cloud Computing Lab

ateam.retrieveLocalVar( "program" );
program.userRecovery( );
}
else
{
program = new UserProgAteam( args );
ateam.registerLocalVar( "program", program );
}
program.compute( );
MPJ.Finalize( );
}
public class UserProgAteam extends AteamProg {
// application body private void compute(
) { for ( phase = 0; phase < 10; phase++ )
{ try {
Thread.currentThread( ).sleep( 1000 );
}
catch(InterruptedException e ) {
}
ateam.takeSnapshot(ASANphase);

System.out.println ( "UserProgAteam at rank " + MPJ.COMM WORLD.Rank( ) + " : took a


snapshot " + phase );
}}
Socket sample code – within some function
body import AgentTeamwork. team.GridTcp.*;
private final int port = 2000; private GridSocket
socket; private
GridServerSocket server; private InputStream
input; private OutputStream output; for ( int i =
start; i < start + trans; i++ ) {
try {
output.write( i % 128 );
} catch ( IOException e ) {
}
System.out.println ( " ockets with " + myRank + ": " + " output[" + i + "]=" + i % 128 );
}
for ( int i = start; i < start + trans; i++ )
{ try {
System.out.println ( " ockets with " + myRank + ": " + " input[" + i + "]=" + input.read( ) );
} catch ( IOException e ) {
}}
MPI sample code

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 66


Department of CSE 15A05710 Grid & Cloud Computing Lab

import gentTeamwork. team.*;


import MPI.*;
public class UserProgAteam extends AteamProg
{ // application body private void compute( ) {
}
public static void main( String[] args ) {
MPJ.Init( args, ateam );
program.compute( ); MPJ.Finalize( );
}
}

C/C++ compile.sh – Helloworld.cpp

#!/bin/sh
rm -f *.class
javac -classpath MPJ.jar:Ateam.jar:. *.java
# jar cvf GridJNI.jar *.class jar -cvf
GridJNI.jar *.class javah -jni JavaToCpp
g++ -rdynamic JavaToCpp.cpp -o _libJavaToCpp.so_ -shared -ldl g++ -shared -o
_libHelloWorld.so_ GridJNI_library.cpp

HelloWorld.cpp

C/C++ MPI sample code – Helloworld.cpp


#include <iostream.h> using namespace std;
typedef int MPI Request, MPI Status, MPI Comm;
extern void takeSnapshot(int argc);
extern int MPI Init(int* argc, char*** argv);
extern void MPI Finalize();
extern int MPI Comm rank(MPI Comm comm, int *rank); extern int MPI Comm size(MPI
Comm comm, int *size);
int main(int argc, char** argv) {
cerr << "main" << endl;
cerr << "argc = " << argc << endl;
cerr << "argv[0] = " << argv[0] << endl; cerr << "argv[1] = "
<< argv[1] << endl; MPI Init(&argc, &argv);
cout << "MPI Init uccessful!" << endl;
cout << "[HelloWorld.cpp]Calling Rank() and ize()" << endl; int rank, size;
MPI_Comm rank(0,&rank);
MPI_Comm size(0,&size);
cout << "[HelloWorld.cpp]Rank = " << rank << endl;

cout << "[HelloWorld.cpp] ize = " << size << endl; cerr << "Calling

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 67


Department of CSE 15A05710 Grid & Cloud Computing Lab

MPI_Finalize()" << endl; MPI Finalize();


cerr << "finished" << endl;
}

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 68


Department of CSE 15A05710 Grid & Cloud Computing Lab

5 Develop secured applications using basic security mechanisms available in Globus


Toolkit.

AIM:

PROCEDURE:
The Globus Toolkit's Authentication and Authorization components provide the de facto
standard for the "core" security software in Grid systems and applications. These software
development kits (SDKs) provide programming libraries, Java classes, and essential tools for a
PKI, certificate-based authentication system with single sign-on and delegation features, in either
Web Services or non-Web Services frameworks. ("Delegation" means that once someone
accesses a remote system, he can give the remote system permission to use his credentials to
access others systems on his dynamic, multi ASAN-institutional virtual organizations". The
protocols and middleware to enable this Grid infrastructure have been developed by a number of
initiatives, most notably the Globus Project .
behalf.)

WEB SERVICES AUTHENTIC ATION AND AUTHORIZATION –

A Web services implementation of the Grid Security Infrastructure (GSI),containing the


core libraries and tools needed to secure applications using GSI mechanisms. The Grid is a term
commonly used to describe a distributed computing infrastructure which will allow "coordinated
resource sharing and problem solving.
Web Services are simply applications that interact with each other using Web standards,
such as the HTTP transport protocol and the XML family of standards. In particular, Web
Services use the O P messaging standard for communication between service and requestor.
They should be self -describing, self-contained and modular; present a platform and
implementation neutral connection layer; and be based on open standards for description,
discovery and invocation.
The Grid Security Infrastructure (G I) is based on the Generic Security Services PI (GSS-
PI) and uses an extension to X509 certificates to provide a mechanism to authenticate subjects
and authorise resources. It allows users to benefit from the ease of use of a single sign-on
mechanism by using delegated credentials, and time-limited proxy certificates. GSI is used as the
security infrastructure for the Globus Toolkit.
Recently, a new proposal for an Open Grid Services Architecture (OGSA) was
announced which marries the Grid and Web Services to create a new Grid Services model. One
problem, which has not yet been explicitly addressed, is that of security. A possible solution is to
use a suitably secure transport binding, e.g. TLS, and extend it toIncorporate appropriate support
for proxy credentials. It would be useful to test out some of the principles of Grid Services using
the currently available frameworks and tools for developing Web Services. Unfortunately, no
standards currently exist for implemented proxy credential support to provide authenticated
communication between webservices. A number of XML/Web Services security standards are
currently in development, e.g. XML Digital Signatures, SAML, XKMS, XACML, but the

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 69


Department of CSE 15A05710 Grid & Cloud Computing Lab

remainder ofthis document describes an approach proposed by ANL to use GSI over an SSL
link.
A generic Job Submission environment, GAP enables researchers and scientists to
execute their applications on Grid from a conventional web browser. Both Sequentialand Parallel
jobs can be submitted to GARUDA Grid through Portal. It provides a web interface or viewing
the resources and for submitting and monitoring jobs.

Portal users need to set the following in their ~/.bashrc file.

export GLOBUS LOC TION=/opt/asvija/GLOBUS-4.0.7/


source /opt/asvija/GLOBU -4.0.7/etc/globus-user-env.sh
exportPATH=/usr/local/jdk1.6.0_10/bin:
GW_LOCATION/bin:/opt/garudaresv/bin:/opt/voms client/bin:$PATH export
LD_LIBRARY PATH=$LD LIBRARY PATH:/opt/voms client/lib:

Accessing GAP
Type http://192.168.60.40/GridPortal1.3/ (to access the Portal through GARUDA Network) or
http://203.200.36.236/GridPortal1.3 (to access the Portal through Internet) in the address bar of
the web browser to invoke the Portal. It is preferable to access the Portal through GARUDA
Network, since it is much faster than the Internet.
In order to access the facilities of Grid Portal such as Job Submission, Job Status tracking,
Storing(Uploading) of Executables and View Output/Error data, the user has to login into the

Portal using the User's Login Form in the Home page of the Portal.

a) New users are required to click Sign up in the User Login Form, which leads them to home
page of Indian Grid Certification Authority (IGCA) (http://ca.garudaindia.in/). Click on Request
Certificate and acquire the required user/host certificate(s),
details are provided in IGCA section.
Reservation ASANId's that can be used for job submission instead of choosing the
Operating System/Processor parameter.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 70


Department of CSE 15A05710 Grid & Cloud Computing Lab

b) Registered users are required to provide User Id and Password for logging into the Portal
and access various facilities.

Job Management
User can submit their job, monitor the status and view output files using the Job Management
interfaces. Types of job submission (Basic and Advanced) and Job information are covered
under this section.
Basic Job Submission
This interface can be used to submit sequential as well as parallel jobs. The user should provide
the following information:
1. Optional Job Name - User can provide a suitable (alias) name for their job.
2. Type of Job user want to execute,
3. Operating system – Required for their Job,
4. 'Have you reserved the Resources' - optional parameter contains the
5. No. of processes required for the job - This parameter is only for the parallel applications
that require more than one CPU.

6. Corresponding Executables – uploaded from either local or remote machine,


7. Input file, if required - The executable and the input file can either be uploaded from the local
machine or can be selected from the Remote File List, if it is available in the Submit Node

8. STDIN - Required when the user wants to provide any inputs to the application during the
runtime.

9. Optional Execution Time - Here the Execution Time is the anticipated job completion time.
10. Any Command Line arguments or Environment Variables, if required.

11. User Specific Output/ Error files - If the application generates output/error files other than
standard output/error files and its entries should be separated by comma's or single empty space
in case of multiple files.

All those fields marked with * are mandatory fields and should be filled before submitting a job.
By clicking on submit button, the portal submits the job to Grid Way Meta Scheduler, which
then schedules the job for execution and returns the Job

I2. The Job Id has to be noted for future reference to this job. In the event of unsuccessful
submission, the corresponding error message is displayed.
All those fields marked with * are mandatory fields and should be filled before submitting a job.
By clicking on submit button, the portal submits the job to GridWay Meta Scheduler, which then
schedules the job for execution and returns the Job Id. The Job Id has to be noted for future
reference to this job.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 71


Department of CSE 15A05710 Grid & Cloud Computing Lab

Advanced Job Submission

This interface is provided for the user to submit their Sequential and Parallel Jobs. The
difference from Basic job submission being: it is using GT4 Web Services components for
submitting jobs to the Grid instead of Gridway as scheduler.

The user is provided with two modes in this interface:

1. Default mode - Portal creates the XML file for the user.
2. Second mode, recommended for advanced users - The user can provide their-own XML file
as the executable, provided the required files are available in the submit node. The user can view
the status of the job submitted through Portal and the output file of the job by specifying the Job
Id. The option for downloading the Output/ Error file is also provided, after the job execution. To
cancel any of the queued jobs, the user has to select the job and click Cancel Job button,
following which the acknowledgment for the job cancelled is provided.

Job Info
The user can view the status of the job submitted through Portal and the output file of the job by
specifying the Job Id. The option for downloading the Output/ Error file is also provided, after
the job execution. To cancel any of the queued jobs, the user has to select the job and click
Cancel Job button, following which the acknowledgment for the job cancelled is provided.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 72


Department of CSE 15A05710 Grid & Cloud Computing Lab

Resources
The GridWay meta-scheduler provides the following information - Node Name, Head Node,
OS, RCH, Load verage, Status, Configured Process and Available Process. This information
aids user to select a suitable cluster and reserve them in advance for job submission.

Steps for ReservationASANofResources


1. Check the available free resources with valid parameters (Start Time and End Time – duration
for which the resource needs to be reserved). The input fields o. of CPUs and OS entries are
optional.
Example: starttime= 2009-04-02 17:06:53 endtime=2009-04-02 19:07:10
No. of CPUs=2 OS NAME=Linux

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 73


Department of CSE 15A05710 Grid & Cloud Computing Lab

2. Choose the Available Process required for the job. Example: Available Procs =4
3. Select the required resource from the available list of resources.
4. Book the resources for reserving a resource for the requested period of time and process.
5. The reserved resources can be modified/ cancelled.
6. Once the reservation process is successfully completed, the Reservation Id is displayed
and is made available in the Basic Job submission page.

File browser
For the logged-in user, the File Browser lists files, such as the uploaded executables and
Input/Output/Error files, along with their size and last modified information. It also allows
deletion of files.

Accounting

This module provides Accounting information of the jobs that are submitted to GARUDA, such
as no. of jobs submitted, and system parameters such as Memory usage, Virtual memory, Wall
Time, and CPU time. Last one month data is displayed by default.

MyProxy

MyProxy allows user to upload their Globus Certificates into Myproxy Server and the same can
be used for initializing the Grid proxy on the Grid. If the certificate has been already generated
for you, but you do not have access to the above- mentioned files, you can download it from
GridFS machine (from $HOME/.globus directory) using winscp/scp.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 74


Department of CSE 15A05710 Grid & Cloud Computing Lab

MyProxy Init
By default, the "Myproxy Init" option is enabled for the user. Upload proxy by entering
valid inputs - User name, Grid-proxy Passphrase, User certificate file (usercert.pem), User key
file (userkey.pem) and Proxy life time (168 hours is the default value).

MyProxyGet
Grid proxy will be initialized on the Grid head node by providing the inputs - User name,
Myproxy Passphrase and Life time of the certificate.

VOMS Proxy
The Virtual Organization Management System (VOMS) allows users to belong to
Virtual Organizations (VOs), thereby allowing them to utilize resources earmarked for those
VOs.

The user can also request for a new VO by using "Request for VO" link. VOMS proxy
initialization with Multiple roles is provided to the user, by selecting more than one entry on the
Role combo box.
Steps to be followed to access GSRM from gridfs:
Login to gridfs(192.168.60.40)
Upload your IGCA user certificates
Initialize proxy with grid-proxy-init

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 75


Department of CSE 15A05710 Grid & Cloud Computing Lab

Set environmental variables, respectively for whichever client to be used. Run the
SRM commands
GSRM ccess points

pvfs2 (172.20.1.81) node should be used to just test all the available SRM clientinterfaces like
StoRM, DPm, BestMan.
gridfs (192.168.60.40) node should, if the user wishes to use GSRM storage forjob execution.
Users can download/Upload input/output files into GSRM while submitting jobs from gridfs.
Following ccess mechanisms are available at above mentioned nodes to access

GSRM:
1. gridfs(192.168.60.40) : gridfs is the Bangalore GARUDA head node. GSRMservices can
be accessed from here using StoRM command line interface.
If the user wants to use the clientSRM ( StoRM Clients) from gridfs
machine Create a valid user proxy using grid-proxy-init

Set the environment variable for Globus location path


export GLOBUS_LOCATION= GLOBUS_LOCATION:/usr/local/GARUDA/GLOBUS-
4. 0.7/

export PATH=$PATH:/opt/gsrm-client/srmv2storm/bin

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gsrm-
client/cgsi_soap/lib Run the clientSRM command

2. pvfs2 (172.20.1.81): pvfs2 is the GSRM testing node with the following clientinterfaces
installed.

Bestman Java APIs


DPM C APIs

3. GSRM Web Client is accessible from any of the user machines reachable to
GSRMserver(xn05.ctsf.cdac.org.in),using
URL--
https://xn05ASAN.ctsf.cdac.org.in/GSRMClientInterfaces

StoRM Command Line Client


1. StoRM command line client format:
clientSRM <requestName><requestOptions>
2. To get help for clientSRM commands:
client RM –h
3. Command to ping to GSRM server:
clientSRM ping -e <GSRM end point>

Bestman Command Line Clients


1. Command to ping to GSRM server src-ping–servicer

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 76


Department of CSE 15A05710 Grid & Cloud Computing Lab

httpg://xn05.ctsf.cdac.org.in:8446/dpm/ctsf.cdac.org.in/home/garuda
2. Upload file to GSRM server src-copy <src uri><target uri><service uri>

Pre-requisites for using OA compiler


1. Java Run Time Environment (JDK1.6+)
2. Web Browser with Java web start support

Compiler GUI
The users are required to adhere to following directory structure. Application Parent Dir-
src/,bin/,lib/,include/

1) Login
This method is for logging in to the G RUD .
Inputs
user name MyProxy User Name
password MyProxy Password
life time Indicates how long is the proxy's life time
Output Proxy issued by the My proxy server
Proxy string Indicates the status of the operation
Login status Gives when this user was last logged
Last Login Time in Gives users logging in time
Current Login Time

2) uploadProxy
This method uploads a proxy that is generated using other tools, to the MyProxy Server.
Inputs
user name MyProxy User Name
password MyProxy Password
proxyBytes Existing proxy file is given as byte array
Output
uploadStatus Indicates the status of the operation

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 77


Department of CSE 15A05710 Grid & Cloud Computing Lab

3) storeCredential
This method is used for uploading the credentials that is the PKCS12 certificate directly to
the MyProxy Server. It will convert the PKCS12 to certificate and stores in server for users
to download the proxy until it expires.

Sample Inputs
user name MyProxy User Name
password MyProxy Password
p12Bytes PKCS12 file as byte array

Sample Output
StoreStatus Indicates the status of the operation

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 78


Department of CSE 15A05710 Grid & Cloud Computing Lab

6 Develop a Grid portal, where user can submit a job and get the result.
Implement it with and without GRAM concept.

AIM

Software Requirements:

Globus Toolkit or equivalent Eucalyptus or Open Nebula or equivalent

Procedure:

Multiple times that the likely user interface to grid applications will be through portals,
specifically Web portals. A grid portal may be constructed as a Web page interface to provide
easy access to grid applications. The Web user interface provides user authentication, job
submission, job monitoring, and results of the job.

Globus Resource Allocation Manager (GRAM)

When a job is submitted by a client, the request is sent to the remote host and handled by a
gatekeeper daemon. The gatekeeper creates a job manager to start and monitor the job.
When the job is finished, the job manager sends the status information back to the client
and terminates.

The GRAM subsystem consists of the following elements:


The globusrun command and associated APIs Resource Specification Language
(RSL)


The gatekeeper daemon The job manager Dynamically-Updated Request Online
Coallocator (DUROC)

Each of these elements are described briefly below.

The globusrun command

The globusrun command (or its equivalent API) submits a job to a resource within
the grid. This command is typically passed an RSL string (see below) that specifies
parameters and other properties required to successfully

Resource Specification Language (RSL)

RSL is a language used by clients to specify the job to be run. All job submission requests
are described in an RSL string that includes information such as the executable file; its
parameters; information about redirection of stdin, stdout, and stderr; and so on. Basically it
provides a standard way of specifying all of the information required to execute a job,

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 79


Department of CSE 15A05710 Grid & Cloud Computing Lab

independent of the target environment. It is then the responsibility of the job manager on the
target system to parse the information and launch the job in the appropriate way.

The syntax of RSL is very straightforward. Each statement is enclosed within


parenthesis. Comments are designated with parenthesis and asterisks, for example, (* this
is a comment *). Supported attributes include the following:

rsl_substitution: Defines variables

executable: The script or command to be run

arguments: Information or flags to be passed to the executable

stdin: Specifies the remote URL and local file used for the executable stdout: Specifies the
remote file to place

standard output from the job stderr: Specifies the remote file to place standard error from the
job queue: Specifies the

queue to submit the job (requires a scheduler) count: Specifies the number of executions

directory: Specifies the directory to run the job

project: Specifies a project account for the job (requires a scheduler) dryRun:
Verifies the RSL string butdoes not run the job

maxMemory: Specifies the maximum amount of memory in MBs required for the job

minMemory: Specifies the minimum amount of memory in MBs required for the job

hostCount: Specifies the number of nodes in a cluster required for the job environment:
Specifies environmentvariables that are required for the job

jobType: Specifies the type of job single process, multi-process, mpi, or condor

maxTime: Specifies the maximum execution wall or cpu time for one execution

maxWallTime: Specifies the maximum walltime for one execution


maxCpuTime: Specifies the maximumcpu time for one execution

gramMyjob: Specifies the whether the gram myjob interface starts one process/thread
(independent) or more(collective)

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 80


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 81


Department of CSE 15A05710 Grid & Cloud Computing Lab

INTRODUCTION TO CLOUD COMPUTING

What is Cloud Computing?

Cloud computing means that instead of all the computer hardware and software you're
using sitting on your desktop, or somewhere inside your company's network, it's provided for
you as a service by another company and accessed over the Internet, usually in a completely
seamless way. Exactly where the hardware and software is located and how it all works
doesn't matter to you, the user—it's just somewhere up in the nebulous "cloud" that the
Internet represents.

Cloud computing is a buzzword that means different things to different people. For some,
it's just another way of describing IT (information technology) "outsourcing"; others use it to
mean any computing service provided over the Internet or a similar network; and some define
it as any bought-in computer service you use that sits outside your firewall.

Types of cloud computing

IT people talk about three different kinds of cloud computing, where different services
are being provided for you. Note that there's a certain amount of vagueness about how these
things are defined and some overlap between them.

1. Infrastructure as a Service (IaaS) means you're buying access to raw computing


hardware over the Net,such as servers or storage. Since you buy what you need and
pay-as-you-go, this is often referred to as utility computing. Ordinary web hosting is a
simple example of IaaS: you pay a monthly subscription or a per-megabyte/gigabyte
fee to have a hosting company serve up files for your website from their servers.

2. Software as a Service (SaaS) means you use a complete application running on


someone else's system.Web-based email and Google Documents are perhaps the best-
known examples. Zoho is another well-known SaaS provider offering a variety of
office applications online.

3. Platform as a Service (PaaS) means you develop applications using Web-based tools
so they run onsystems software and hardware provided by another company. So, for
example, you might develop your own ecommerce website but have the whole thing,
including the shopping cart, checkout, and payment mechanism running on a
merchant's server. App Cloud (from salesforce.com) and the Google App Engine are
examples of PaaS.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 82


Department of CSE 15A05710 Grid & Cloud Computing Lab

Advantages and disadvantages of cloud


computing Advantages

The pros of cloud computing are obvious and compelling. If your business is selling
books or repairing shoes, why get involved in the nitty gritty of buying and maintaining a
complex computer system? If you run an insurance office, do you really want your sales
agents wasting time running anti-virus software, upgrading word-processors, or worrying
about hard-drive crashes? Do you really want them cluttering your expensive computers with
their personal emails, illegally shared MP3files, and YouTube videos—when you could leave
that responsibility to someone else? Cloud computing allows you to buy in only the services
you want, when you want them, cutting the upfront capital costs of computers and
peripherals. You avoid equipment going out of date and other familiar IT problems like
ensuring system security and reliability. You can add extra services (or take them away) at a
moment's notice as your business needs change. It's really quick and easy to add new
applications or services to your business without waiting weeks or months for the new
computer (and its software) to arrive.

Disadvantages
Instant convenience comes at a price. Instead of purchasing computers and software,
cloud computing means you buy services, so one-off, upfront capital costs become ongoing
operating costs instead. That might work out much more expensive in the long-term.
If you're using software as a service (for example, writing a report using an online word
processor or sending emails through webmail), you need a reliable, high-speed, broadband
Internet connection functioning the whole time you're working. That's something we take for
granted in countries such as the United States, but it's much more of an issue in developing
countries or rural areas where broadband is unavailable.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 83


Department of CSE 15A05710 Grid & Cloud Computing Lab

Programs on SOFTWARE AS A SERVICE

1. Create an word document of your class time table and store locally and on the cloud
with doc,and pdf format . ( use www.zoho.com and docs.google.com)

AIM:

Steps:
1. Go to docs.google.com

2. Select main menu Click Docs option and select Blank Document.
3. Write the title name is Siddharth Institute of Engineering &Technology, Puttur at
(A1 address)
4. Write the sub title name is I.B.Tech TIME TABLE FOR ACADEMIC YEAR
2017-2018 at (A2 address)
5. Write the date is =Today() at G3 address
6. Write the fields A4 address to J4 address location

In the above format the DAY/TIME will appear as above and go to Format cells
and select Alignment .In that under the Text control select tickon wrap text then
click on OK button
7. Write the MON at A5 address location and drag cell with auto fill option up
sat(A10 address)
8. Write subject name GCC fill all cellsif you have lab hour’s like GCC LAB, Enter
the lab name leave 2 cells.
9. If any break or lunch leave the cell

FormattingStyles:
1. Select the cell A1 to J1, click on HOME then click the merge and center button, set
font size to 16.
2. Select the cell A2 to J2, click on HOME then click the merge and center button, set
font size is 12.
3. Select the cell address G5 to G10, click on merge and center button, then type
―LUNCH‖ and click on orientation button &select ―Vertical Text‖.
4. Fill the cellswith particular subjects according toschedule.
5. Write ―GCC‖ in B5, ―Maths‖ in C5 and so on.
6. Select D5&D6, click on merge &center button then type ―BREAK‖, click
on orientation & select ―‖Vertical Text‖.
7. Select H5, I5,J5 cells & type ―GCC LAB‖.
8. Repeat above steps for the remaining cells B5 to J5.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 84


Department of CSE 15A05710 Grid & Cloud Computing Lab

9. At last select A1 to J10 cellsand keep borders by clicking on Borders Button


and select All Borders.
10. At last save the file by clicking on office button then ―save‖, give file name as Time
Table then press ―ok‖.

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 85


Department of CSE 15A05710 Grid & Cloud Computing Lab

2. Create a spread sheet which contains employee salary information and calculate
gross and total sal using the formula
DA=10% OF BASIC
HRA=30% OF BASIC
PF=10% OF BASIC IF BASIC<=3000 12% OF BASIC IF
BASIC>3000 TAX=10% OF BASIC IF BASIC<=1500
=11% OF BASIC IF BASIC>1500 AND
BASIC<=2500 =12% OF BASIC IF BASIC>2500
( use www.zoho.com and docs.google.com)
NET_SALARY=BASIC_SALARY+DA+HRA-PF-TAX

AIM:

Steps:

1. Navigate to Google's home page and click on Google Docs. Sign in if you have an
account.
2. Select main menu →Click sheets option and select Blank Document. Enter
3. Employee details from A1 to J1.
4. At last select A1 to J10 cellsand keep borders by clicking on Borders Button and
select All Borders.
5. Write formulas in formula box ―fx‖.

S.NO EMP Designation Basic DA HRA PF TAX Net Gross


NAME Salary Salary Salary

S.NO EMP NAME Desigantion Salary


1 A Manager 70000
2 B Project Manager 60000
3 C Project Lead 50000
4 D Team lead 40000
5 E Sr.Developer 30000
6 F Developer 1 20000
7 G Developer 2 20000
8 H Developer 3 20000
9 I Tester 20000
10 J Production 20000

Find DA,HRA,PF,TAX and NET SALARY


6. DA=10% OF BASIC
Ex: DA=Basic Salary*10/100

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 86


Department of CSE 15A05710 Grid & Cloud Computing Lab

7. HRA=30% OF BASIC
Ex: HRA= Basic Salary*30/100
8. PF=10% OF BASIC IF BASIC<=3000 12% OF BASIC IF BASIC>3000
Ex: PF= =if(D2<=3000,D2*10/100,D2*12/100) (D2=Basic Salary)
9. TAX=10% OF BASIC IF BASIC<=1500=11% OF BASIC IF BASIC>1500 AND
BASIC<=2500=12% OF BASIC IF BASIC>2500
Ex:
TAX
=If(D2<=1500,D2*10/100,if(D2>1500&D2<=2500,D2*11/100,if(D2>2500,D2*12/1
00)))
10. Net Salary=Salary+DA+HRA-PF-TAX
Ex: Net Salary=D2+E2+F2-G2-H2
11. Gross Salary= Salary+DA+HRA+PF+TAX
12. At last save the file by clicking ―Make a copy‖ or ― Down load as‖ or
―Email as attachment‖, give file name as Time Table then press ―ok‖.

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 87


Department of CSE 15A05710 Grid & Cloud Computing Lab

3. Prepare a PPT on cloud computing – introduction, models, services, and


architecture Ppt should contain explanations, images and at least 20 pages
( use www.zoho.com and docs.google.com)
AIM:

PROCEDURE:
Inserting a Slide:
Toinsert a new slide…

From the Home tab, select ―New Slide‖
➢ As well, you can right‐click between any 2 slides in the preview frame located on the left‐hand side of the window

Normal view and select ―New Slide‖

Deleting a Slide:
To delete a slide…

As well, you can right‐click on any slide in the preview frame located on the left‐hand side of the Normal view and select ―Delete Slide‖

Inserting Pictures:
To insert pictures…

From the Insert tab you can insert pictures from your computer, images, clip art, shapes,
etc…

Also, when you have a blank slide (or parts of a blank slide), you can also click on
options within these blank compartments to insert pictures.

Inserting Charts:
To insert charts…

From the Insert tab you can insert pictures from your computer, clip art, shapes, etc…

Also, when you have a blank slide (or parts of a blank slide), you can also click on
options within these blank compartments to insert charts.
• Once you’ve selected to insert a chart, it will ask you choose what kind of chart you’d
like to insert.
• After you’ve picked a type, the screen will split in half with the chart on one side an an
excel spreadsheet on the other

To modify the chart, make changes in the data presented in the spreadsheet

Charts from Excel can also be copied and pasted into PowerPoint
Inserting Tables:
To insert a table…

From the Insert tab, select ―Table ―and a box will drop down giving you more options
for inserting a table.

Also, when you have a blank slide (or parts of a blank slide), you can also click on
options w/n these blank compartments to insert tables

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 88


Department of CSE 15A05710 Grid & Cloud Computing Lab

Steps:

1. Navigate to Google's home page and click on Google Docs. Sign in if you have an
account.
→ →
2. Select main menu click option select Blank document.
3. Ppt should contain explanations, images and at least 20 pages
4. In first slide enter title name and sub-titles
5. In second slide, write introduction in title box and information in text box as point
wise
6. In next slides, write models, services, and Architecture
Formatting styles
Apply Formatting Styles (font size, font style, font type, and color), Bullets and
Numbering for the title and text from Format tab.
7. From the Insert tab, write the Slide number
8. Taka the picture from the Insert tab.
9. Select the theme and Background Color for the slides.
10. Select Transition to this slide and Transition sound.
11. From the insert tab, apply Animation for the Title, Text and picture from
Animations box. If you want more go to the custom animation tab.
12. At last save the file by clicking ―Make a copy‖ or ― Down load as‖ or
―Email as attachment‖, give file name as Time Table then press ―ok‖.

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 89


Department of CSE 15A05710 Grid & Cloud Computing Lab

4. Create your resume in a neat format using google and zoho cloud
AIM:

PROCUDURE

1. Navigate to Google's home page and click on Google Docs. Sign in if you have an
account.
2. Click on ―Template Gallery‖ to see a list of template options. There are multiple
letter formats you can use for your cover letter, and multiple resume formats as well.
You can find additional templates by clicking the ―More‖ arrows and scrolling
through the options.
3. Select a template you like. Click on the template you want to use, and it will open in a
new window.
4. Personalize the template with your information. The templates are filled with lorem
ipsum dummy text. Simply click where you want to edit, delete the dummy text and
start typing. Changes are automatically saved into your account on Google Docs.
5. The template name appears at the top of your screen, above the toolbars.


For example, if you selected the basic Resume template, ―Resume‖ appears above
the toolbars.

To rename the file, simply click on the template name. It opens in a textbox for
editing. After you've changed the name, click out of the textbox, and your new
name is saved.

If you are making multiple versions of your resume or cover letter, be sure to
label each one with a specific title that will help you remember which is which
(such as the title of the job you're applying for).

6. Once you've completed your basic resume but want to customize it for a particular job
application, make a copy of the resume or cover letter through the "File" menu and
give it a different name. Google Docs automatically saves your new file with your
other docs.
7. At last save the file by clicking ―Make a copy‖ or ― Down load as‖ or
―Email as attachment‖, give file name as Time Table then press ―ok‖.

Storing and Sharing Your Google Docs Resume or Cover Letter

Once you have created a final version of your resume or cover letter, you'll be able to store it
on Google Docs, update it, use it to apply for jobs, and share it with hiring managers and
recruiters.

You can also choose to store it on Google Drive, an organizational system in which you can
create, upload, edit, save, and share documents. Keep in mind that many hiring managers
prefer to receive resumes as attachments in an email or documents uploaded directly to their
corporate job site, rather than shared via link.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 90


Department of CSE 15A05710 Grid & Cloud Computing Lab

If you’re applying online, follow the instructions in the job posting. If you’re sending your
resume directly to a recruiter or hiring manager, through a networking contact, ask your
connection about the preferred method of delivery.

OUTPUT:

RESULT:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 91


Department of CSE 15A05710 Grid & Cloud Computing Lab

Programs on PLATFORM AS A SERVICE

PROCEDURE TO WORK IN GOOGLE CLOUD FOR PLATFORM AS A SERVICE.

STEP1:
Open google cloud and Sign in with your google account.

STEP 2:
Click on console (Right hand side top corner) and Dashboard will appear.

STEP 3:
In Dashboard, Click on App Engine, from the menu of Google Cloud Platform.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 92


Department of CSE 15A05710 Grid & Cloud Computing Lab

SETP 4:

Select the programming language (Platform) in the app Engine home page to work.

In this procedure Java has been selected.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 93


Department of CSE 15A05710 Grid & Cloud Computing Lab

STEP 5:

We have to give name for our new project.

STEP 6:

Select the region of the Google server, where you want to store your source code.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 94


Department of CSE 15A05710 Grid & Cloud Computing Lab

STEP 7:

Let’s start workint on JAVA using platform as a service provided by Google Cloud.

STEP 8:

Select the project created to proceed.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 95


Department of CSE 15A05710 Grid & Cloud Computing Lab

STEP 9:

Click on Continue.

STEP 10:

We have to launch the code editor and cloud shell to create and execute program. Click
on File menu and create your source code file.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 96


Department of CSE 15A05710 Grid & Cloud Computing Lab

The code editor on top of the page and cloud shell is at bottom of the page.

Here,the source code for the program ―to generate n even numbers” in Java is given.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 97


Department of CSE 15A05710 Grid & Cloud Computing Lab

STEP 11:

Compiling and Running the Java source code at cloud shell. Output will be diaplayed at
the Cloud Shell.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 98


Department of CSE 15A05710 Grid & Cloud Computing Lab

1. Write a Google app engine program to generate n even numbers and deploy it to
Google cloud

AIM

PROGRAM IN PHYTHON

n = 40;
i = 2;
print (i);
while (i < (n)):

print (i+2);

i = i+2;

Save the file as ―even.py‖ and open it using command prompt.


To Compile : python even.py

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 99


Department of CSE 15A05710 Grid & Cloud Computing Lab

2. Google app engine program multiply two matrices

AIM

PROGRAM IN C

#include <stdio.h>
int main()
{
int m, n, p, q, c, d, k, sum = 0;
int first[10][10], second[10][10], multiply[10][10];
printf("Enter number of rows and columns of first matrix\n");
scanf("%d%d", &m, &n);
printf("Enter elements of first matrix\n");
for (c = 0; c < m; c++)
for (d = 0; d < n; d++)
scanf("%d", &first[c][d]);
printf("Enter number of rows and columns of second matrix\n");
scanf("%d%d", &p, &q);
if (n != p)
printf("The matrices can't be multiplied with each other.\n");
else
{
printf("Enter elements of second matrix\n");
for (c = 0; c < p; c++)
for (d = 0; d < q; d++)
scanf("%d", &second[c][d]);
for (c = 0; c < m; c++) {
for (d = 0; d < q; d++) {
for (k = 0; k < p; k++) {
sum = sum + first[c][k]*second[k][d];
}
multiply[c][d] = sum;
sum = 0;
}
}
printf("Product of the matrices:\n");
for (c = 0; c < m; c++) {
for (d = 0; d < q; d++)
printf("%d\t", multiply[c][d]);
printf("\n");
}
}
return 0;
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 100


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 101


Department of CSE 15A05710 Grid & Cloud Computing Lab

3. Google app engine program to validate user; create a database login(username,


password) in mysql and deploy to cloud

AIM

PROGRAM IN PHP

Form.html
<!DOCTYPE html>
<html>
<head>
<style>
.form
{
border-style: ridge;
background-color: #f5e960;
border-radius: 15px;
height: 200px;
padding: 25px 0px 0px 0px;
}
</style>
</head>
<body>
<center style="padding: 50px;">
<center><h3 style="color:brown;">Login Details</h3></center>
<form action="verify.php" method="POST" class="form">
<table>
<tr><th></th></tr>
<tr><td><h3>User ID</h3></td><td><input type="text" name="user" style="border-
style: solid;border-color:brown;height:25px;padding:5px;border-radius:5px;"></td></tr>
&nbsp;&nbsp;&nbsp;&nbsp;
<tr><td><h3>Password</h3></td><td><input type="password" name="pass"
style="border-style: solid;border-color:brown;height:25px;padding:5px;border-
radius:5px;"></td></tr> <tr><td></td><td><input type="submit" name="Login"
value="Login" /></td></tr> <tr><td><a href="#">Forgot Pasword?</a></td><td>Not yet
Registered?<a href="form.html">Register here</a></td></tr> </table>

</form>
</center>
</body>
</html>

Form.php
<?php
$server = "localhost";
$user = "root";
$pass = "";

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 102


Department of CSE 15A05710 Grid & Cloud Computing Lab

$db = "registration"
$user = $_POST['user'];
$pass = $_POST['pass'];
$con = new mysqli($server,$user,$pass$db);
//To connect to the database
if($con->connect_error)
{
die("Connection failed");
}
else
{
echo "connected successfully";
}
//To create a table
$sql = "create table user (username varchar(20),password varchar(20));"
if($con->query($sql) === TRUE)
{
echo "created successfully.";
}
else
{
echo "Creation failed.";
}
if($user == "sistk" && $pass == "123")
{ echo "Login successful.";}
else{
echo "invalid details";}
?>

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 103


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 104


Department of CSE 15A05710 Grid & Cloud Computing Lab

4. Write a Google app engine program to display nth largest no from the given list
of numbers and deploy it into google cloud
AIM

PROGRAM IN JAVA

import java.util.Scanner;
public class Kth_Largest
{
public static void main(String[] args)
{
int n, max;
Scanner s = new Scanner(System.in);
System.out.print("Enter number of elements in the array:");
n = s.nextInt();
int a[] = new int[n];
System.out.println("Enter elements of array:");
for(int i = 0; i < n; i++)
{
a[i] = s.nextInt();
}
max = a[0];
for(int i = 0; i < n; i++)
{
if(max < a[i])
{
max = a[i];
}
}
System.out.println("Maximum value:"+max);
}
}

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 105


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 106


Department of CSE 15A05710 Grid & Cloud Computing Lab

5. Google app engine program to validate the user Use mysql to store user info and
deploy on to the cloud

AIM

PROGRAM IN PHP

Form.html
<!DOCTYPE html>
<html>
<head>
<style>
.form
{
border-style: ridge;
background-color: #f5e960;
border-radius: 15px;
height: 200px;
padding: 25px 0px 0px 0px;
}
</style>
</head>
<body>
<center style="padding: 50px;">
<center><h3 style="color:brown;">Login Details</h3></center>
<form action="verify.php" method="POST" class="form">
<table>
<tr><th></th></tr>
<tr><td><h3>User ID</h3></td><td><input type="text" name="user" style="border-
style: solid;border-color:brown;height:25px;padding:5px;border-radius:5px;"></td></tr>
&nbsp;&nbsp;&nbsp;&nbsp;
<tr><td><h3>Password</h3></td><td><input type="password" name="pass"
style="border-style: solid;border-color:brown;height:25px;padding:5px;border-
radius:5px;"></td></tr> <tr><td></td><td><input type="submit" name="Login"
value="Login" /></td></tr> <tr><td><a href="#">Forgot Pasword?</a></td><td>Not yet
Registered?<a href="form.html">Register here</a></td></tr> </table>

</form>
</center>
</body>
</html>
Save.php
<?php
$server = "localhost";
$user = "root";
$pass = "";
$db = "registration"
$user = $_POST['user'];

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 107


Department of CSE 15A05710 Grid & Cloud Computing Lab

$pass = $_POST['pass'];
$con = new mysqli($server,$user,$pass$db);
//To connect to the database
if($con->connect_error)
{
die("Connection failed");
}
else
{
echo "connected successfully";
}
//To create a table
$sql = "create table user (username varchar(20),password varchar(20));"
if($con->query($sql) === TRUE)
{
echo "created successfully.";
}
else
{
echo "Creation failed.";
}
$sql = "Insert into user (username,password) values (sistk,123);"
if($con->query($sql) === TRUE)
{
echo "inserted successfully.";
}
else{
echo "Insertion failed.";
}
if($user == "sistk" && $pass == "123")
{ echo "Login successful.";} else{

echo "invalid details";}

?>

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 108


Department of CSE 15A05710 Grid & Cloud Computing Lab

OUTPUT

RESULT

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 109


Department of CSE 15A05710 Grid & Cloud Computing Lab

CASE STUDY – AMAZON EC2

AmazonElasticComputeCloud(EC2)

Elastic IP addresses:
Allow you to allocate a static IP address and programmatically assign it to an
instance. You can enable monitoring on an Amazon EC2 instance using Amazon
CloudWatch2 in order to gain visibility into resource utilization, operational performance,
and overall demand patterns (including metrics such as CPU utilization, disk reads and
writes, and network traffic). You can create Auto-scaling Group using the Auto-scaling
feature3 to automatically scale your capacity on certain conditions based on metric that
Amazon CloudWatch collects. You can also distribute incoming traffic by creating an elastic
load balancer using the Elastic Load Balancing4 service. Amazon Elastic Block Storage
(EBS)5 volumes provide network-attached persistent storage to Amazon EC2 instances.
Point-in-time consistent snapshots of EBS volumes can be created and stored on Amazon
Simple Storage Service (AmazonS3).Amazon S3 is highly durable and distributed data store.
With a simple web services interface, you can store and retrieve large amounts of data as
objects in buckets (containers) at any time, from anywhere on the web using standard HTTP
verbs. Copies of objects can be distributed and cached at 14 edge locations around the world
by creating a distribution using Amazon CloudFront7 service – a web service for content
delivery (static or streaming content). Amazon SimpleDB8 is a web service that provides the
core functionality of a database- real-time lookup and simple querying of structured data –

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 110


Department of CSE 15A05710 Grid & Cloud Computing Lab

without the operational complexity. You can organize the dataset into domains and can run
queries across all of the data stored in a particular domain. Domains are collections of items
that are described by attribute-value pairs.
Amazon Relational Database Service (Amazon RDS):
Provides an easy way to setup, operate and scale a relational database in the cloud.
You can launch a DB Instance and get access to a full-featured MySQL database and not
worry about common database administration tasks like backups, patch management
etc.Amazon Simple Queue Service (Amazon SQS)10 is a reliable, highly scalable, hosted
distributed queue for storing messages as they travel between computers and application
components.
Amazon Simple Notifications Service (Amazon SNS):
Provides a simple way to notify applications or people from the cloud by creating
Topics and using a publish-subscribe protocol.
Amazon Elastic MapReduce
Provides a hosted Hadoop framework running on the web-scale infrastructure of
Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Simple Storage Service
(Amazon S3) and allows you to create customized JobFlows. JobFlow is a sequence of
MapReduce steps.
Amazon Virtual Private Cloud (Amazon VPC) :
Allows you to extend your corporate network into a private cloud contained within
AWS. Amazon VPC uses IPSec tunnel mode that enables you to create a secure connection
between a gateway in your data center and a gateway in AWS.
Amazon Route53:
Is a highly scalable DNS service that allows you manage your DNS records by creating a
HostedZone for every domain you would like to manage.
AWS Identity and Access Management (IAM):
Enable you to create multiple Users with unique security credentials and manage
the permissions for each of these Users within your AWS Account. IAM is natively
integrated into AWS Services. No service APIs have changed to support IAM, and exiting
applications and tools built on top of the AWS service APIs will continue to work when
using IAM.
AWS also offers various payment and billing services that leverages Amazon’s payment
infrastructure.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 111


Department of CSE 15A05710 Grid & Cloud Computing Lab

All AWS infrastructure services offer utility-style pricing that require no long-term
commitments or contracts. For example, you pay by the hour for Amazon EC2 instance usage
and pay by the gigabyte for storage and data transfer in the case of Amazon S3. More
information about each of these services and their pay-as-you-go pricing is available on
the AWS Website.Note that using the AWS cloud doesn’t require sacrificing the
flexibility and control you’ve grown accustomed to:You are free to use the programming
model, language, or operating system (Windows, OpenSolaris or any flavor of
Linux) ofyour choice.You are free to pick and choose the AWS products that best
satisfy your requirements—you can use any of the services individually or in any
combination.Because AWS provides resizable (storage, bandwidth and computing) resources,
you are free to consume as much or as little and only pay for what you consume. You are free
to use the system management tools you’ve used in the past and extend your datacenter into
the cloud.

CASE STUDY – MICROSOFT AZURE

Execution Environment

The Windows Azure execution environment consists of a platform for applications and
services hosted within one or more roles. The types of roles you can implement in
Windows Azure are:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 112


Department of CSE 15A05710 Grid & Cloud Computing Lab

• Azure Compute (Web and Worker Roles). A Windows Azure application consists of
one or more hosted roles running within the Azure data centers. Typically there will be
at least one Web role that is exposed for access by users of the application. The
application may contain additional roles, including Worker roles that are typically used
to perform background processing and support tasks for Web roles.
• Virtual Machine (VM role). This role allows you to host your own custom instance of
the Windows Server 2008 R2 Enterprise or Windows Server 2008 R2 Standard
operating system within a Windows Azure data center
Data Management
Windows Azure, SQL Azure, and the associated services provide opportunities for storing
and managing data in a range of ways. The following data management services and features
are available:
• Azure Storage: This provides four core services for persistent and durable data storage
in the cloud. The services support a REST interface that can be accessed from within
Azure-hosted or on-premises (remote) applications. The four storage services are:
o The Azure Table Service :provides a table-structured storage mechanism based on
the familiar rows and columns format, and supports queries for managing the data.
It is primarily aimed at scenarios where large volumes of data must be stored, while
being easy to access and update.
o The Binary Large Object (BLOB) Service: provides a series of containers aimed
at storing text or binary data. It provides both Block BLOB containers for
streaming data, and Page BLOB containers for random read/write operations.
o The Queue Service: provides a mechanism for reliable, persistent messaging
between role instances, such as between a Web role and a Worker role.
o Windows Azure Drives provide a mechanism for applications to mount a single
volume NTFS VHD as a Page BLOB, and upload and download VHDs via the
BLOB.
• SQL Azure Database: This is a highly available and scalable cloud database service
built on SQL Server technologies, and supports the familiar T-SQL based relational
database model. It can be used with applications hosted in Windows Azure, and with
other applications running on-premises or hosted elsewhere.
• Data Synchronization: SQL Azure Data Sync is a cloud-based data synchronization
service built on Microsoft Sync Framework technologies. It provides bi-directional data
synchronization and data management capabilities allowing data to be easily shared

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 113


Department of CSE 15A05710 Grid & Cloud Computing Lab

between multiple SQL Azure databases and between on-premises and SQL Azure
databases
• Caching: This service provides a distributed, in-memory, low latency and high
throughput application cache service that requires no installation or management, and
dynamically increases and decreases the cache size automatically as required. It can be
used to cache application data, ASP.NET session state information, and for ASP.NET
page output caching.
Networking Services
Windows Azure provides several networking services that you can take advantage of to
maximize performance, implement authentication, and improve manageability of your hosted
applications. These services include the following:
• Content Delivery Network (CDN). The CDN allows you to cache publicly available
static data for applications at strategic locations that are closer (in network delivery
terms) to end users. The CDN uses a number of data centers at many locations around
the world, which store the data in BLOB storage that has anonymous access. These do
not need to be locations where the application is actually running.
• Virtual Network Connect. This service allows you to configure roles of an application
running in Windows Azure and computers on your on-premises network so that they
appear to be on the same network. It uses a software agent running on the on-premises
computer to establish an IPsec-protected connection to the Windows Azure roles in the
cloud, and provides the capability to administer, manage, monitor, and debug the roles
directly.
• Virtual Network Traffic Manager. This is a service that allows you to set up request
redirection and load balancing based on three different methods. Typically you will use
Traffic Manager to maximize performance by redirecting requests from users to the
instance in the closest data center using the Performance method. Alternative load
balancing methods available are Failover and Round Robin.
• Access Control. This is a standards-based service for identity and access control that
makes use of a range of identity providers (IdPs) that can authenticate users. ACS acts
as a Security Token Service (STS), or token issuer, and makes it easier to take advantage
of federation authentication techniques where user identity is validated in a realm or
domain other than that in which the application resides. An example is controlling user
access based on an identity verified by an identity provider such as Windows Live ID or
Google.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 114


Department of CSE 15A05710 Grid & Cloud Computing Lab

• Service Bus. This provides a secure messaging and data flow capability for distributed
and hybrid applications, such as communication between Windows Azure hosted
applications and on-premises applications and services, without requiring complex
firewall and security infrastructures. It can use a range of communication and messaging
protocols and patterns to provide delivery assurance, reliable messaging; can scale to
accommodate varying loads; and can be integrated with on-premises BizTalk Server
artifacts.

CASE STUDY - HADOOP SERVICE

Hadoop in the cloud:


Hadoop and other big data application frameworks (such as Spark) were
designed and built around the assumption that distributed parallel processing and the
minimization of storage and network latencies are key to maximizing data query performance
over large data sets.This assumption places constraints on the architecture and deployment
for big data infrastructure. For example, since its inception, Hadoop has mandated that the
co-location of storage and compute is essential for good performance. Why Hadoop?

Is Hadoop the only solution for Big Data? What are alternatives?
What are the pros and cons of Hadoop?

The case for Big-Data-as-a-Service:


Cloud-based options for deploying Hadoop have been available for several
years. Multiple providers have introduced Hadoop-as-a-Service, Spark-as-a-Service, and
other similar offerings. A new category of Big-Data-as-a-Service (BDaaS) solutions has
emerged. Most of these solutions today are being delivered in a public cloud service off-
premises. And now, there are also BDaaS solutions available for on-premises
deployment.Over the past few years, we’ve seen an increase in organizations that are
developing, testing, and deploying big data applications in cloud environments. The value
proposition includes the traditional cloud benefits of cost reduction (especially upfront
CapEx), elasticity, flexibility, and agility. In addition, big data applications and tools change
on a seemingly daily basis; a cloud-based deployment can help reduce the challenge and
complexity of keeping skills up-to-date with these technologies.
However, these advantages are offset by the often-cited cloud challenges of:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 115


Department of CSE 15A05710 Grid & Cloud Computing Lab

➢ System availability
➢ Performance
➢ Data security

Evaluating Big-Data-as-a-Service:
The potential challenges around system availability for big data applications in a
cloud-based deployment are the least concerning. Availability was once a major concern for
cloud environments, but it is no longer as significant an issue. For a given cost, cloud-based
deployments are at least as reliable as on-site, bare-metal deployments.The challenges of
performance for big data in a cloud-based deployment can be broken down into two factors:

• compute performance and


• storage access performance.

Historically, virtualization extracted a tax in the form of CPU performance for


its benefits of flexibility and scalability. But with the advent of new virtualization techniques,
such as containers, this compute tax has been largely eliminated. CPU performance need not
be a barrier to the adoption of BDaaS—whether in a public cloud or on-premises.

HDFS – Hadoop Distributed File System:


When file size grows from GBs to TBs, we need some concrete system who can
manage this entire file. As we all know, that database can be distributed over multiple
servers, as the same way when multiple file size increased, a single machine cant process that
files, we need distributed file system (who manage storage across network). HDFS is
specially designed to store huge amount of file size where operations are write once and read
multiple times are done. For Low Latency data access, HDFS is not a good option, as there
are lots of small file included in operation for the update purpose.

Map Reduce:
Map Reduce is uses to process highly distributable issues where so many computers
are collectively used (known as cluster). In terms of programming, there are two functions
which are most common in Map Reduce. 1)Map

2) Reduce
In map step, Master computer or node takes input (Large data set to process) and
divide it into smaller parts and distribute it on other worker nodes (other machine/Hardware).
All worker nodes solve their own small problem and give answer to the master node.
In Reduce step, Master node combines all answers coming from worker node and
forms it in some form of output which is answer of our big distributed problem.

Hive:
If you have gone through the limitations or disadvantages of Hadoop you
might found that to work with Hadoop is not easy for end users especially who are not
familiar with Mapreduce framework. Hive specially developed for People who have strong
control on SQL Queries, Hive provides SQL like language called HiveQL. The main building
blocks of Hive are –
Metastore – To store metadata about columns, partition and system
catalogue. Driver – To manage the lifecycle of a HiveQL statement
Query Compiler – To compiles HiveQL into a directed acyclic graph.
Execution Engine – To execute the tasks in proper order which are produced by the
compiler.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 116


Department of CSE 15A05710 Grid & Cloud Computing Lab

HiveServer – To provide a Thrift interface and a JDBC / ODBC server.


When all these components are merged, it makes the Hadoop very user friendly.

HBase:
As said earlier, HDFS (Hadoop Distributed File System) works on write once and
read many times pattern, but this isn’t a case always. We may require real time read/write
random access for huge dataset; this is where HBase comes into the picture. HBase is built on
top of HDFS and distributed on column-oriented database. HBase is not relational and
doesn’t support SQL, but it’s specially designed to perform which RDBMS can’t such as to
host very large dataset over a cluster.

Mahout:
A success of big data is depends on how fast and efficiently you can convert a
vast amount of information to some actionable information. Whether it is analyzing all log
(visited web pages) of Cyberoam for particular company, like Azilen Technologies, to know
which site is most frequently opened in Azilen or if you want to proceed thousands of
personal email messages and to generate analytics and then to organize and extract
information, Mahot is being used here.

CASE STUDY -ANEKA

Manjrasoft Aneka: An Innovative Solution for Cloud Computing


Aneka is a Platform-as-a-Service solution for Cloud computing. It provides a
framework for developing distributed application that are Cloud aware and can scale on demand
in a completely seamless fashion. Its service oriented architecture provides a flexible and
adaptable middleware that can be easily empowered with additional services and thus tailored for
a specific deployment scenarios or application requirements. Flexibility is at the core of the
platform and it is reflected across all layers of the framework; not only in the infrastructure
middleware building the Aneka Clouds, but also in the application development

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 117


Department of CSE 15A05710 Grid & Cloud Computing Lab

models. Aneka offers different ways to express application logic thus covering a wide variety
of paradigms for distributed programming. This is one of the key features of the frameworks
and allows developers to optimize their development experience and being more productive.
In addition, if the available options cannot satisfy the needs of the enterprise, it is possible to
design and integrate new models that can leverage existing models and take advantage of the
collection of services available in the Aneka Cloud. Flexibility is also in the different
deployment scenarios supported from desktop Grids, clusters, datacenters, and public virtual
infrastructures, thus making Aneka a suitable solution for different market segments, which
are explored and presented as case studies for the framework.

Why Aneka?
Every CIO faces the need to optimize his budget to support the adoption of Cloud
technology. Despite the economic downturn and the challenging business climate,
considerable investments are allocated for infrastructure and software technology
development. Cloud computing provides significant revenues with a minimum upfront
commitment and the ability to comfortably control their expenditure according to the health
status of the managed business. Choosing the right option in such a vibrant market is a
challenging task that cannot be delayed anymore, given the ever growing popularity of the
trend. Aneka Platform as a Service provides a comprehensive and unmatched solution for
Cloud adoption by bringing several advantages to enterprises:

Reduced Costs:
Any successful enterprise business knows the significance of appraising,
managing, and optimizing the Capital Expenditure and Operational Expenditure and
necessities to achieve cost economies. Aneka adeptly leverages your current infrastructure
assets and Cloud management tools with a low cost guarantee.

Improved Reliability:
As one of its kind, Manjrasoft’s Aneka is the most comprehensive and mature path for Cloud
adoption based on the .NET technology. Aneka’s ability to design and create a solid fault
tolerant system infrastructure without having to build topology level knowledge base into
applications simplifies the application development and automatically manages application
load over Clouds, Grids, clusters, or desktops. This gives a newfound level of resiliency with
a guaranteed quality of service and effective metering and monitoring for all the service.

Simplicity:
Moving to a Cloud based model requires the software development team to assume
responsibility of delivering their application in a utility fashion, making them to tightly
integrate with salient software development approaches and focus on IT efficiency. Aneka
offers the most flexible and robust APIs framework that cleanly handles .NET based
enterprise application management and development with lightweight technology and
flexible application integration approaches. This enables software development team to be
more productive by enabling the developers to focus on business logic, instead of being
stifled by technology barriers.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 118


Department of CSE 15A05710 Grid & Cloud Computing Lab

Faster Time to Value:


By unraveling both the immediate technical and business challenges of Cloud integration,
Aneka allow enterprise business to effectively adopt Cloud based application through faster
time to market scenario with minimal budget. Aneka leverages a solid and widely adopted
technology such as the Microsoft .NET framework; thus, enterprise customers can capitalize
their existing .NET base application and engineering expertise over Cloud environment. With
regards to the technical development team, Aneka’s support of multiple programming and
application environments helps them to leverage their current expertise over software
development without having to sunk huge effort on capabilities to adopt new technology and
learning new processes.

Seamless Scalability:
Aneka helps enterprise customers to enrich their applications and services with support for
distributed and scalable runtime environments for multicore desktops, servers and a network
of computing systems that are presented as Clusters, Grid, and Clouds. Aneka empowers the
enterprise application stack to achieve end-to-end performance, scalability and high
availability thus meeting the service levels agreement and providing the desired quality of
service. This process is completely transparent to applications and relies on dynamic
provisioning multiple virtual and/or physical machines for accelerating applications in a
scalable manner from a single multi-core desktop computer to a large-scale elastic Cloud
computing infrastructure such as Amazon EC2.
All these features make Aneka a winning solution for enterprise customers in the Platform-as-
a-Service scenario. There exist other different solutions in the PaaS market, most notably
Google AppEngine and Microsoft Windows Azure. While AppEngine is mostly concerned
with providing a scalable runtime environment for web applications for Java and Python
applications, Aneka aims to be more general and empower any kind of application that
suffers from performance degradation and lack of responsiveness under huge pressure.
Mircrosoft Azure is a giant in the market of Cloud services development and provides a wide
range of services for developing and deploying services on the Cloud.

Infrastructure Support.
Aneka provides the capability of harnessing disparate resources and to be deployed on
heterogeneous hardware and operating system platforms. Current supported deployment
involve: enterprise desktop Grids, Data Centers, Clusters, and public Clouds such as Amazon
EC2 and GoGrid. The supported operating systems include several editions of Windows
(Windows Server 2008, Windows XP, Vista, and 7), Linux distributions such as Fedora,
Ubuntu, and Suse, and Mac OS X. Potentially, any operating system that provides an
implementation of the ECMA 334 and ECMA 335 specifications, can be used as hosting
environment for Aneka. ECMA 334 and 335 specification defines the Common Language
Infrastructure and the C# language, which constitute the technology leveraged by Aneka.
Currently, the platform has been extensively used on their two most popular
implementations: .NET framework (for Windows based platforms) and Mono (for Windows,
Linux, and Mac OS X platform).

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 119


Department of CSE 15A05710 Grid & Cloud Computing Lab

ECMA 334: .NET or Mono / Windows, Linux, & Mac Infrastruscture Enterprise
Desktop Grid Data Centers Clusters Public Cloud Persistence & Security Fabric Services
Hardware Profiling Resource Provisioning High-Availability Membership Foundation
Services Billing & Reporting Resource Reservation Storage Licensing & Accounting
Application Services Bag of Tasks Distributed Threads MapReduce Other models… PSM
Middleware - Container Application Development & Management Software Development
Kit: APIs & Tools Management: Tools, Interfaces and APIs PAL – Platform Abstraction
Layer

Middleware.
The platform features a homogeneous distributed runtime environment for applications. Such
environment is built by aggregating together physical and virtual nodes hosting the Aneka
container. The container is lightweight layer that provides the interfacing with the hosting
environment and manages the services deployed on a node. The interaction with the hosting
platform is mediated through the Platform Abstraction Layer (PAL), which hides in its
implementation all the heterogeneity of the different operating systems. By means of the PAL
it is possible to perform all the infrastructure related tasks such as performance and system
monitoring. These activities are vital to ensure the desired quality of service for applications.
The PAL together with the container, represent the hosting environment of services which
implement the core capabilities of the middleware and make it a dynamically composable and
extensible system. The available services can be aggregated into three major categories:

Fabric Services.
Fabric services implement the fundamental operations of the infrastructure of the Cloud.
These services include: high-availability and failover for improved reliability, node
membership and directory, resource provisioning, performance monitoring and hardware
profiling.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 120


Department of CSE 15A05710 Grid & Cloud Computing Lab

Foundation Services.
Foundation services constitute the core functionalities of the Aneka middleware. They
provide a basic set of capabilities that enhance application execution in the Cloud. These
services provide added value to the infrastructure and are both of use to system
administrators and developers. Within this category we can list: storage management,
resource reservation, reporting, accounting, billing, services monitoring, and licensing.
Services in this level operate across all the range of supported application models.

Application Services.
Application services deal directly with the execution of applications and are in
charge of providing the appropriate runtime environment for each application model. They
leverage foundation and fabric services for several tasks of application execution such as
elastic scalability, data transfer, and performance monitoring, accounting and billing

CASE STUDY – GOOGLE APP ENGINE

Google App Engine :


Often referred to as GAE or simply App Engine, and also used by the acronym
GAE/J) is a platform as a service(PaaS) cloud computing platform for developing and hosting
web applications in Google-managed data centers. Applications are sandboxed and run across
multiple servers. App Engine offers automatic scaling for web applications—as the number
of requests increases for an application, App Engine automatically allocates more
resources for the web application to handle the additionaldemand. Google App
Engine is free up to a certain level of consumed resources. Fees are charged for additional
storage, bandwidth, or instance hours required by the application. It

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 121


Department of CSE 15A05710 Grid & Cloud Computing Lab

was first released as a preview version in April 2008, and came out of preview in September
2011.

Runtimes and frameworks


Currently, the supported programming languages are Python, Java (and, by
extension, other JVM languages such as Groovy, JRuby, Scala, Clojure, Jython and PHP via
a special version ofQuercus), and Go. Google has said that it plans to support more languages
in the future, and that the Google App Engine has been written to be language independent.

Reliability and Support:


All billed High-Replication Datastore App Engine applications have a 99.95%
uptime SLA

Portability Concerns:
Developers worry that the applications will not be portable from App Engine and
fear being locked into the technology. In response, there are a number of projects to create
open-source back-ends for the various proprietary/closed APIs of app engine, especially the
datastore. Although these projects are at various levels of maturity, none of them is at the
point where installing and running an App Engine app is as simple as it is on Google’s
service. AppScale and TyphoonAE are two of the open source efforts. AppScale can run
Python, Java, and Go GAE applications on EC2 and other cloud vendors. TyphoonAE can
run python App Engine applications on any cloud that support linux machines.

Web2py web framework offers migration between SQL Databases and Google App Engine,
however it doesn’t support several App Engine-specific features such as transactions and
namespaces.

Differences with other application hosting:


Compared to other scalable hosting services such as Amazon EC2, App Engine
provides more infrastructure to make it easy to write scalable applications, but can only run a
limited range of applications designed for that infrastructure.
App Engine’s infrastructure removes many of the system administration and
development challenges of building applications to scale to hundreds of requests per second
and beyond. Google handles deploying code to a cluster, monitoring, failover, and launching
application instances as necessary.
While other services let users install and configure nearly any *NIX compatible
software, App Engine requires developers to use only its supported languages, APIs, and
frameworks. Current APIs allow storing and retrieving data from a BigTable non-relational
database; making HTTP requests; sending e-mail; manipulating images; and caching.
Existing web applications that require a relational database will not run on App Engine
without modification. Per-day and per-minute
quotas restrict bandwidth and CPU use, number of requests served, number of concurrent
requests, and calls to the various APIs, and individual requests
are terminated if they take more than 60 seconds or return more than 32MB of data.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 122


Department of CSE 15A05710 Grid & Cloud Computing Lab

Differences between SQL and GQL:


Google App Engine’s datastore has a SQL-like syntax called ―GQL‖. GQL
intentionally does not support the Join statement, because it seems to be inefficient when
queries span more than one machine. Instead, one-to-many and many-to-many relationships
can be accomplished using ReferenceProperty(). This shared-nothing approach allows disks
to fail without the system failing. Switching from a relational database to the Datastore
requires a paradigm shift for developers when modellin their data.
Unlike a relational database the Datastore API is not relational in the SQL sense.
The Java version supports asynchronous non-blocking queries using the Twig Object
Datastore interface. This offers an alternative to using threads for parallel data processing.

CASE STUDY- BUSINESS SOLUTION APPLICATION OF


GOOGLE APPS

Google is the Undisputed Cloud Leader


Achieving a new paradigm in enterprise collaboration means everyone needs
to embrace and work together in a frictionless fashion. Email was first to achieve this near
ubiquity, fostered by clear industry standards along with broad operating platform and device
support. Email is and will remain a critical element for many years to come, but the voices
within the enterprise grew louder as consumer social platforms ushered in a new era of
collaboration beyond asynchronous messages and email attachments. These historical
approaches are marked with frustrating inefficiency, inherently siloed workers, and limited
user flexibility. It also became clear that those who brought us innovation in the past had
unimpressive vision or financial motivation to take us into the future.
How Google Apps for Work Differentiates
Choosing an enterprise messaging and collaboration cloud platform solution
partner is not a small undertaking, but the good news is there are really only two paths to
consider: Google Apps for Work or Microsoft O365. We will cut to the chase and tell you
why we believe Google is the best option for organizations looking to significantly advance
their capabilities while benefiting from everything the cloud has to offer.

1. Google is 100% Cloud, Microsoft O365 is a Hybrid


Cloud is cloud and well, a hybrid premise solution simply is not. If your goal is to
achieve those significant advantages provided by the cloud, then Google is really the only
viable option as Microsoft O365 is a self-described ―hybrid‖ solution. Microsoft provides
reduced capability versions of their products, which can be used online but still recommends

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 123


Department of CSE 15A05710 Grid & Cloud Computing Lab

users have the installed version of Outlook and the Office suite for the best productivity
potential.
While positioned as providing a bridge to online, the reality is you are still living
all of the limitations, flexibility challenges, upgrades, maintenance, administration, and
support as you are today. It is not a seamless experience for Microsoft users trying to
collaborate across the various hybrid platforms Google Apps for Work has only one software
version, 100% browser supported, delivered entirely from the cloud to any device, anytime,
and anywhere.

2. Improved Speed and User Experience Through Real-Time Collaboration


Google was born on the web, purpose-built to transform how teams collaborate.
Traditional solutions are asynchronous and their single-threaded design primarily supports
the individual contributor, which has caused significant frustration for organizations that are
evolving to be more dynamic and collaborative. For example, consider the all too familiar
budget planning cycle. Traditionally, teams would leverage asynchronous emails with an
attachment sent to everyone for input, only to be emailed back in many different files that
require significant time and effort to aggregate accurately. If you actually took the time to
document this process, it would be shocking to see how much time is wasted.
Google Apps for Work delivers an entirely different set of capabilities designed to drastically
improve users’ speed and experience. Key differentiators include:
Instantly search and find information across the organization – Google’s strength
Single version of the truth – users are always accessing the current, latest version
Multiple users able to view, comment, edit, and suggest on the same document, at the same
time
Access Google Apps for Work from any device, anytime, anywhere – users need this
flexibility
Instantly start a multi-party video and voice meeting
Seamless integrated user experience across the platform of services

3. Lowest Total Cost of Ownership


Google’s pricing model has been praised for its simplicity and has been the single
most disruptive force in the messaging and collaboration space. However, per user price is
only one dimension to the many financial advantages provided with a Google Apps for Work
solution. It is critical for an organization to appropriately consider the many direct and
indirect financial contributors from hardware to software to administration and support:

4. Platform of Choice for the New Workforce – It Matters to Them!:


A recent survey of 1,500 IT professionals by Better Cloud uncovered a
significant generational divide when it comes to Google and Microsoft. Many millennials
have grown up using Gmail or Google Apps for Education, so naturally, they prefer to use
Google Apps in the workplace and it remains an important consideration in evaluating the
culture of their future employer. By 2020, millennials will form 50% of the global workforce
(PwC).

5. Version .NOW — Tomorrow’s Innovation Delivered Today…No Upgrades Required


Pound-for-pound, Google represents the best engineering minds and real-time
deployment model in the business. Google has the infrastructure to deliver new features
quickly and the financial depth to fuel continued innovation. Google’s 100% web foundation
provides constant innovation delivery without the reliance others have on traditional legacy
installed product portfolios. In fact, Google’s release schedule for Apps is about every 2
weeks. What that means to you is that feature cycles take months to release, not years.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 124


Department of CSE 15A05710 Grid & Cloud Computing Lab

6. Unmatched Global Infrastructure


At Google, security, reliability, and performance are top priorities. There simply
is no other provider with the focus, track-record, and investment to-date in the global cloud
infrastructure. Google’s infrastructure was built from the ground up by a dedicated team of
world-renowned thought leaders ensuring data can be accessed quickly and reliably — and
done so securely.
The pursuit of educational institutions that pioneered the adoption of training solutions in the
cloud led them to live with the improvement of teaching quality vs. cost reduction. For a time
the prospect of economic crisis became superfluous investments in this environment.
However, the numerous advantages of using Cloud Computing gravitated the balance in its
favor, and now the technology has been considered as a viable alternative in many
educational institutions.

Google Apps for Education


Google Apps for Education is free. The number of users that can be created is not
limited, however, the entity must meet certain prerequisites to acquire this condition.
Normally this is allowed for educational institutions that do not seek profits. They must
demonstrate this activity with appropriate documents sent to Google. Private institutions who
cover for their activities shall procure the Google Apps Business solution.

Components of Google Apps for Education


Google Apps for Education is composed of the same applications available in
Google Apps Business version except just Google Video. Included Gmail, Calendar, Docs
and Sites in this package. There is a limitation on the size of the mailbox version of Google
Apps for Education that is 10GB per user.
Regardless of the organization, millions of students in schools, colleges and other
educational institutions have realized the advantages of the cloud in their academic life, and
come with Google Apps to tackle the challenges posed in their day-to-day life.

Benefits of Google Apps for Education


For educational institutions, there is the concern of cost and maintenance with no
hardware or apply patches (software patch). Educational institutions that have made the
transition to Google Apps have benefited from significant cost savings (TCO). The result is
that now they are channeling their forces to innovate in their own systems.

Communication and Collaboration


Of all the benefits of Google Apps in education, collaboration is clearly the most
noticeable. The educational community is in its components, especially in Google Talk and
Google Docs, many advantages to sharing / collaboration of knowledge, including creating
collaborative networks.

Google Sites
A notable component of Google Apps that is not yet widely used is Google Sites. It
allows students and teachers to set Intranets specific area of interest, thus facilitating the
spread of topics and contents in an easy and uncomplicated way for the community academic.
Cloud Computing technology is the focus of Google Apps, so it offers a dynamic and
uncomplicated features like easy to use and intuitive. Currently it has been recognized by
various educational institutions around the world as a solution to reduce infrastructure costs
and hiring specialized personnel for development, simplifying and democratizing access to
information and knowledge dissemination

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 125


Department of CSE 15A05710 Grid & Cloud Computing Lab

CASE STUDY - APPLICATION OF HYPERVISORS

Virtualization involves a shift in thinking from physical to logical, treating IT


resources as logical resources rather than separate physical resources. Using virtualization in
your environment, you are able to consolidate resources such as processors, storage, and
networks into a virtual environment which provides the following benefits:
• Consolidation to reduce hardware cost.
• Optimization of workloads.
• IT flexibility and responsiveness.
Virtualization is the creation of flexible substitutes for actual resources —
substitutes that have the same functions and external interfaces as their actual counterparts
but that differ in attributes such as size, performance, and cost. These substitutes are called
virtual resources; their users are typically unaware of the substitution.
Virtualization is commonly applied to physical hardware resources by combining
multiple physical resources into shared pools from which users receive virtual resources.
With virtualization, you can make one physical resource look like multiple virtual
resources.Furthermore, virtual resources can have functions or features that are not available
in their underlying physical resources.
System virtualization creates many virtual systems within a single physical system. Virtual
systems are independent operating environments that use virtual resources. Virtual systems
running on IBM® systems are often referred to as logical partitions or virtual machines.
System virtualization is most commonly implemented with hypervisor technology.
Hypervisors are software or firmware components that can virtualize system
resources

Figure 1. Virtualization, a shift in thinking from the physical to the logical

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 126


Department of CSE 15A05710 Grid & Cloud Computing Lab

There are two types of hypervisors:


a. Type 1 hypervisor
b. Type 2 hypervisor
Type 1 hypervisors run directly on the system hardware.
Type 2 hypervisors run on a host operating system that provides virtualization
services, such as I/O device support and memory management. Figure 2 shows how type 1
and type 2 hypervisors differ.
Figure 2. Differences between type 1 and 2 hypervisors

The hypervisors described in this series are supported by various hardware platforms and in
various cloud environments:

PowerVM: A feature of IBM POWER5, POWER6, and POWER7 servers, support


provided for in on IBM i, AIX®, and Linux®.
VMware ESX Server: A "bare metal" embedded hypervisor, VMware ESX's
enterprise software hypervisors run directly on server hardware without requiring an
additional underlying operating system.
Xen: A virtual-machine monitor for IA-32, x86-64, Itanium, and ARM architectures,
Xen allows several guest operating systems to execute on the same computer
hardware concurrently. Xen systems have a structure with the Xen hypervisor as the
lowest and most privileged layer.
KVM: A virtualization infrastructure for the Linux kernel, KVM supports native
virtualization on processors with hardware virtualization extensions. Originally, it
supported x86 processors, but now supports a wide variety of processors and guest
operating systems including many variations of Linux, BSD, Solaris, Windows®,
Haiku, ReactOS, and the AROS Research Operating System (there's even a modified
version of qemu that can use KVM to run Mac OS X).
z/VM: The current version of IBM's virtual machine operating systems, z/VM runs
on IBM's zSeries and can be used to support large numbers (thousands) of Linux
virtual machines.
All of these hypervisors are supported by IBM hardware.

The individual linked articles describe in detail the features, functionalities, and methods to
deploy and manage the virtual systems with corresponding hypervisors.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 127


Department of CSE 15A05710 Grid & Cloud Computing Lab

Choosing the right hypervisor

One of the best ways to determine which hypervisor meets your needs is to compare their
performance metrics. These include CPU overhead, amount of maximum host and guest
memory, and support for virtual processors.
But metrics alone should not determine your choice. In addition to the capabilities of the
hypervisor, you must also verify the guest operating systems that each hypervisor supports.
If you are running heterogeneous systems in your service network, then you must select the
hypervisor that has support for the operating systems you currently run. If you run a
homogeneous network based on Windows or Linux, then support for a smaller number of
guest operating systems might fit your needs.
All hypervisors are not made equal, but they all offer similar features. Understanding the
features they have as well as the guest operating systems each supports is an essential aspect
of any hardware virtualization hypervisor selection process. Matching this data to your
organization's requirements will be at the core of the decision you make. (To get started with
this process, explore the details of each hypervisor.)
The following factors should be examined before choosing a suitable hypervisor.

Virtual machine performance:


Virtual systems should meet or exceed the performance of their physical
counterparts, at least in relation to the applications within each server. Everything beyond
meeting this benchmark is profit.
Ideally, you want each hypervisor to optimize resources on the fly to maximize performance
for each virtual machine. The question is how much you might be willing to pay for this
optimization. The size or mission-criticality your project generally determines the value of
this optimization.

Memory management:
Look for support for hardware-assisted memory virtualization. Memory
overcommit and large page table support in the VM guest and hypervisor are preferred
features; memory page sharing is an optional bonus feature you might want to consider.

High availability:
Each major vendor has its own high availability solution and the way each
achieves it may be wildly different, ranging from very complex to minimalist approaches.
Understanding both the disaster prevention and disaster recovery methods for each system is
critical. You should never bring any virtual machine online without fully knowing the
protection and recovery mechanisms in place.

Live migration:
Live migration is extremely important for users; along with support for live
migration across different platforms and the capability to simultaneously live migrate two or
more VMs, you need to carefully consider what the individual hypervisor offers in this area.

Networking, storage, and security:


In networking, hypervisors should support network interface cards (NICs)
teaming and load balancing, Unicast isolation, and support for the standard (802.1Q) virtual
local area network (VLAN) trunking.
Each hypervisor should also support iSCSI- and Fibre Channel-networked
storage and enterprise data protection software support with some preferences for tools and
APIs, Fibre Channel over Ethernet (FCoE), and virtual disk multi-hypervisor compatibility.

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 128


Department of CSE 15A05710 Grid & Cloud Computing Lab

Management features:
Look for such management features as Simple Network Management Protocol
(SNMP) trap capabilities, integration with other management software, and fault tolerance of
the management server — these features are invaluable to a hypervisor.
Any virtualization infrastructure looking for mainstream adoption in data
centers should offer the best-of-breed combination of several important enterprise readiness
capabilities:
▪ Ease of deployment,
▪ Manageability and automation,
▪ Support and maintainability,
▪ Maturity,
▪ Scalability,
▪ Reliability, availability, and serviceability
▪ Security ,Performance

Creating your App Engine Account

Overview

This is a set of generic instructions for both Java and Python users of App Engine, which
describe how to first obtain an App Engine account as well as how to create your first
application placeholder in the cloud which you can later deploy onto once you've built your
application locally.

1. To create your first App Engine account you'll first need a Google account. The most
popular way to get a Google account is to create a GMail address, so if you already
have a GMail address, then you have a Google account and you can proceed to
http://appengine.google.com and sign in with your GMail(Google) credentials.

2. If you don't, then you can either go to http://gmail.com and click on the "Create an
account" button - if you want to create a GMail account while you're at it.

3. Or, if you just want a Google account, you can proceed directly to
http://appengine.google.com and click on the link, "Create an account now".

4. After creating your Google account either through gmail, or directly at


appengine.google.com, you can then activate your App Engine account.

5. Note: as part of the App Engine activation process, there is an SMS verification
process that you'll need to follow. This means that in order to get approved for App
Engine development, you need to receive an SMS verification message from Google.
If you are in a foreign country where SMS connectivity is not so good with the United
States or Europe, you may have a little difficulty. Fortunately there are alternate ways
to get verified. For further info on activating your App Engine account, see the FAQ
at: http://code.google.com/appengine/kb/

Creating your first application

Assuming your account is now verified through SMS, you should be able to login to the main
"My Applications" page at appengine.google.com. You can now create your first application
by:

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 129


Department of CSE 15A05710 Grid & Cloud Computing Lab

1. Clicking on the button "Create An Application". Keep in mind though that the
application you create at appengine.google.com, is only an empty placeholder until
you upload your first completed application from your local machine. Follow these
steps to create your first app:
2. A dialog will appear that asks you to provide a unique name for your app. This is
needed because your app will be live on the Internet at
<your_unique_app_name>.appspot.com. Checking to for a unique name is easily
done by simply clicking on the button, "Check Availability", to see if your name app
name has been taken by somebody else.

Once you've found a unique name, this will be known as your "application-id" and
will be the value that you apply to your "application:" field in your app.yaml file for
Python, or in your <application></application> field in your appengine-web.xml file
in your Java application. It will also serve as the unique subdomain of appspot.com
for your application, ex: averyuniqueappname.appspot.com.

3. You will also have to set the Application Title. This is the plain text title of your
application. You can use spaces in this name.
4. To create the application, click on the "Save" button. You will then be able to view
the dashboard for your new app. Incidentally, the first time you view the dashboard
for your app, there will be no data shown since you still have to deploy your app
using either the command line tools or the Eclipse plugin.

This concludes the steps on how to create and activate your App Engine account, as well as
how to create your first App Engine (placeholder) App. You can now proceed on to either the
Python, or Java App Engine codelabs!

ADITYA COLLEGE OF ENGINEERING MADANAPALLE Page 130

Das könnte Ihnen auch gefallen