CC Lab Manual
CC Lab Manual
Aim:
PROCEDURE TO INSTALL
1- Download Link
Link for downloading the software is [Link]
pro/workstation- [Link]. Download the software for windows. Good thing is that
there is no signupprocess. Click and download begins. Software is around 541 MB.
Initial Splash screen will appear. Wait for the process to complete.
Now you will see VMware Workstation setup wizard dialog box. Click next to continue.
6- End User Licence Agreement
This time you should see End User Licence Agreement dialog box. Check “I accept the terms in the
Licence Agreement” box and press next to continue.
Select the folder in which you would like to install the application. There is no harm in leaving the
defaults as it is. Also select Enhanced Keyboard Driver check box.
8- User Experience Settings
Next you are asked to select “Check for Updates” and “Help improve VMware Workstation Pro”. Do
as
you wish. I normally leave it to defaults that is unchecked.
Next step is to select the place you want the shortcut icons to be placed on your system to launch
the application. Please select both the options, desktop and start menu and click next.
VMware workstation 15 pro installation shortcut selection checkbox screenshot.
10- Installation begins
Now you see the begin installation dialog box. Click install to start the installation process.
Screenshot for VMware Workstation 15 pro installation begin confirmation dialog box on windows 10.
After the installation completes, you should see VMware Workstation icon on the desktop. Double
click on it to launch the application.
Screenshot for VMware Workstation 15 Pro icon on windows 10 desktop.
If you see the dialog box asking for licence key, click on trial or enter the licence key.
Then what you have is the VMware Workstation 15 Pro running on your windows 10
desktop. If don’t have the licence key, you will have 30 days trial.
You can enter the 25-character license key in the dialog box shown below and click OK.
Now you have the license version of the software.
RESULT:
Thus the procedure to run the virtual machine of different configuration.
EX NO: 2 Install a C compiler in the virtual machine and execute a sample program
Aim:
Procedure:
(GCC will be installed from the local repository. After completion of gcc
compiler,ready to run the C program)
Result:
Thus, the image(gcc) has been created and the C program has been compiled successfully.
Ex. No. 3 Install Google App Engine
Aim:
Install Google App Engine. Create hello world app and other simple web applications using
python/java
This document describes the installation of the Google App Engine Software
Development Kit (SDK) on a Microsoft Windows andrunninga simple “helloworld”
application.
The App Engine SDK allows you torun Google App Engine Applications on your local
computer. It simulates the run---time environment of the Google App Engine
infrastructure.
Ifyoudon'talreadyhavePython2.5.4installedinyourcomputer,downloadand
Install Python 2.5.4 from:
[Link]
You can download the Google App Engine SDK by going to:
[Link]
Once the install is complete you can discard the downloaded installer
MakingyourFirstApplication
C:\Documents andSettings\csev\Desktop\apps
And then make a sub---folder in within apps called “ae--01--trivial” – the path to this
folder wouldbe:
Using a text editor such as JEdit ([Link]), create a file called [Link] in the
ae--01--trivial folder with the following contents:
application: ae-01-trivial
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: [Link]
Note:Pleasedonotcopyandpastetheselinesintoyourtexteditor–youmightend up
with strangecharacters – simply type them intoyour editor.
Then create a file in the ae--01--trivial folder called [Link] with three lines in it:
print 'Content-Type:
text/plain' print ' '
print 'Hello there Chuck'
Paste [Link] into your browser and you should see your
application asfollows:
Justforfun,[Link]“Chuck”toyourownnameand press
Refresh in thebrowser to verify your updates.
You can watch the internal log of the actions that the webserver isperforming when
youareinteractingwithyour application in thebrowser. Selectyourapplicationin the
Launcher andpress the Logs button tobring up a log window:
Eachtime youpress Refresh in yourbrowser– you can see it retrieving theoutput
with a GET request.
With two files to edit, there are two general categories of errors that you may
encounter. Ifyoumakeamistakeonthe [Link] file, theAppEnginewill not start and
your launcherwill show ayellow icon near your application:
To get more detail on what is going wrong; take a look at the log for the application:
5
In this instance – the mistake is mis---indenting the last line in the [Link] (line 8).
If you make a syntax error in the [Link] file, a Python trace back error will appear in
yourbrowser.
Theerroryouneedtoseeislikelytobethelastfewlinesoftheoutput–inthiscase I made
a Python syntax error on line one of our one---line application.
Reference: [Link]
When you make a mistake in the [Link] file – you must the fix the mistake and
attempt to start the application again.
If you make a mistake in a file like [Link], you can simply fix the file and press
refreshinyour browser – thereisnoneed torestart theserver.
To shut down the server, use the Launcher, select your application and press the
Stop button.
Result:
Thus, the Google App Engine is installed and the ‘hello world’ app and other simple web
applications using python/java has been compiled successfully.
EX NO 4: Use GAE launcher to launch the web applications.
AIM:
Procedure:
You can use Google App Engine to host a static website.
Static web pages can contain client-side technologies such as HTML, CSS, and JavaScript.
Hosting your static site on App Engine can cost less than using a traditional hosting provider,
as App Engine provides a free tier.
Sites hosted on App Engine are hosted on the REGION_ID.[Link] sub domain,
Such as [my-project-id].[Link].
After you deploy your site, you can map your own domain name to your App Engine-hosted website
1. Create a new Cloud Console project or retrieve the project ID of an existing project to use:
Goto the Project page
2. Install and then initialize the Google Cloud SDK: Google Cloud CLI:
[Link]:
Configure the settings of your App Engine application
www/: Directory to store all of your static files, such as HTML, CSS, images, and JavaScript.
[Link]: Basic stylesheet that formats the look and feel of your site.
and all static files will be stored in and called from the www directory.
1. Create a directory that has the same name as your project ID. You can find your
3. Edit the [Link] file and add the following code to the file:
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: www/[Link]
upload: www/[Link]
- url: /(.*)
static_files: www/\1
upload: www/(.*)
More reference information about the [Link] file can be found in the [Link]
Create an HTML file that will be served when someone navigates to the root page of your website.
<html>
<head>
<title>Hello, world!</title>
<link rel="stylesheet" type="text/css" href="/css/[Link]">
</head>
<body>
<h1>Hello, world!</h1>
<p>
This is a simple static HTML file that will be served from Google App
Engine.
</p>
</body>
</html>
Deploying your application to App Engine
When you deploy your application files, your website will be uploaded to App Engine.
To deploy your app, run the following command from within the root directory of your application
Optional flags:
Include the --project flag to specify an alternate console project ID to what you initialized as the default
Include the -v flag to specify a version ID, otherwise one is generated for you.
Example: -v [YOUR_VERSION_ID]
Result:
Thus, the Google App Engine is used to launch the web applications successfully.
EX NO 5: Simulate a Cloud Scenario using CloudSim and
Run a scheduling algorithm that is not present in CloudSim.
Aim:
To Simulate a Cloud Scenario using CloudSim and Run a scheduling algorithm that is
not present in CloudSim.
Procedure:
1. To start working with 'CloudSim simulation toolkit' requires it to first configured
Correctly.
2. Before you start to setup CloudSim, following resources must be Installed/downloaded
on the local System Cloudsim simulation toolkit setup is easy. Before you start to setup CloudSim,
following resources must be Installed/downloaded on the local system.
Java Development Kit(JDK): As the Cloudsim simulation toolkit is a class library written in the
Java programming language, therefore, the latest version of Java(JDK) should be installed on
your machine, which can be downloaded from Oracles Java portal. For assistance in the
installation process, detailed documentation is provided by Oracle itself and you may follow
the installation instructions
Eclipse IDE for Java developers: As per your current installed operating system(Linux/
Windows). Before you download to make sure to check if 32-bit or 64-bit version is applicable to
your Computer machine. Link for Eclipse Kepler version is available at the following link
Download CloudSim source code: To date, various versions of CloudSim are released the
latest version is 5.0, which is based on a container-based engine. Whereas to keep the setup
simple for beginners we will be setting up the most used version i.e. 3.0.3, which can be
directly downloaded by clicking on any of the following: Click for Windows or click for Linux.
One external requirement of Cloudsim i.e. common jar package of math-related functions
is to be downloaded from the Apache website or you may directly download by clicking here.
Unzip Eclipse, Cloudsim and Common Math libraries to some common folder.
3. To install cloud sim First of all, navigate to the folder where you have
unzipped the eclipse folder and open [Link]
4. Now within Eclipse window navigate the menu: File -> New -> Project, to open the new project
wizard
5. A ‘New Project‘ wizard should open. There are a number of options displayed and you have to
find & select the ‘Java Project‘ option, once done click ‘Next‘.
6. Now a detailed new project window will open, here you will provide the project name and the
path of CloudSim project source code, which will be done as follows:
11. Once you have clicked on ‘Add External JAR’s‘ Open the path where you have unzipped the
commons-math binaries and select ‘[Link]’ and click on open.
12. Ensure external jar that you opened in the previous step is displayed in the list and then click
on ‘Finish’ (your system may take 2-3 minutes to configure the project)
13. Once the project is configured you can open the ‘Project Explorer‘ and start exploring the
Cloudsim project. Also for the first time eclipse automatically start building the workspace for
newly configured Cloudsim project, which may take some time depending on the configuration of
the computer system.
14. Following is the final screen which you will see after Cloudsim is configured.
15. Now just to check you within the ‘Project Explorer‘, you should navigate to the ‘examples‘
folder, then expand the package ‘[Link]‘ and double click to open the
‘[Link]‘.
16. Now navigate to the Eclipse menu ‘Run -> Run‘ or directly use a keyboard shortcut ‘Ctrl +
F11’ to execute the ‘[Link]‘.
17. if it is successfully executed it should be displaying the following type to output in the console
window of the Eclipse IDE.
Result
Now successfully setup/Installed the CloudSim Simulation Toolkit on your computer machine and you
are ready to start with the experimentation.
EX. NO 6: Find a Procedure to Transfer the files from one Virtual Machine
To Another Virtual Machine
AIM
To find a procedure to transfer the files from one virtual machine to another virtual machine.
PROCEDURE
1. You can copy few (or more) lines with copy & paste mechanism. For this you need to share
clipboard between host OS and guest OS, installing Guest Addition on both the virtual machines
(probably setting bidirectional and restarting them). You copy from guest OS in the clipboard
that is shared with the host OS.
Then you paste from the host OS to the second guest OS.
2. You can enable drag and drop too with the same method (Click on the machine, settings,
general, advanced, drag and drop: set to bidirectional )
3. You can have common Shared Folders on both virtual machines and use one of the directory
shared as buffer to copy.
Installing Guest Additions you have the possibility to set Shared Folders too. As you put a file
in a shared folder from host OS or from guest OS, is immediately visible to the other. (Keep in
mind that can arise some problems for date/time of the files when there are different clock
settings on the different virtual machines).
If you use the same folder shared on more machines you can exchange files directly copying
them in this folder.
4. You can use usual method to copy files between 2 different computer with client-server
application. (e.g. scp with sshd active for linux, winscp... you can get some info about SSH
servers e.g. here)
You need an active server (sshd) on the receiving machine and a client on the sending machine.
Of course you need to have the authorization setted (via password or, better, via an automatic
authentication method).
Note: many Linux/Ubuntu distribution install sshd by default: you can see if it is running with
pgrep sshd from a shell. You can install with sudo apt-get install openssh-server.
5. You can mount part of the file system of a virtual machine via NFS or SSHFS on the other, or you
can share file and directory with Samba.
You may find interesting the article Sharing files between guest and host without VirtualBox shared
folders with detailed step by step instructions.
You should remember that you are dialling with a little network of machines with different operative
systems, and in particular:
• Each virtual machine has its own operative system running on and acts as a physical machine.
• Each virtual machine is an instance of a program owned by an user in the hosting operative system
and should undergo the restrictions of the user in the hosting OS.
E.g Let we say that Hastur and Meow are users of the hosting machine, but they did not allow each
other to see their directories (no read/write/execute authorization). When each of them run a virtual
machine, for the hosting OS those virtual machine are two normal programs owned by Hastur and
Meow and cannot see the private directory of the other user. This is a restriction due to the hosting
OS. It's easy to overcame it: it's enough to give authorization to read/write/execute to a directory or to
chose a different directory in which both users can read/write/execute.
RESULT
Thus, the procedure to transfer the files from one virtual machine to another virtual
machine was completed successfully.
Ex no. 7 Install Hadoop Single Node Cluster and Run Simple Applications like Word Count
Aim: To Install Hadoop Single Node Cluster and Run Simple Applications like word count
PROCEDURE:
Step 1: Click here to download the Java 8 Package. Save this file in your home
directory.
Add the Hadoop and Java paths in the bash file (.bashrc). Open. bashrc file.
Now, add Hadoop and Java Path as shown below.
Command: vi .bashrc
For applying all these changes to the current Terminal, execute the source command.
To make sure that Java and Hadoop have been properly installed on your system and can
be accessed through the Terminal, execute the java -version and hadoop version commands.
Command: cd hadoop-2.7.3/etc/hadoop/
Command: ls
Step 7: Open [Link] and edit the property mentioned below inside configuration tag:
[Link] informs Hadoop daemon where NameNode runs in the cluster. It contains
configuration settings of Hadoop core such as I/O settings that are common to HDFS &
MapReduce.
Command: vi [Link]
1
2 <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="[Link]"?>
3 <configuration>
4 <property>
5 <name>[Link]</name>
6 <value>hdfs://localhost:9000</value>
</property>
7 </configuration>
8
Step 8: Edit [Link] and edit the property mentioned below inside
configuration tag:
[Link] contains configuration settings of HDFS daemons (i.e. NameNode, DataNode,
Secondary NameNode). It also includes the replication factor and block size of HDFS.
Command: vi [Link]
1
2 <?xml version="1.0" encoding="UTF-8"?>
3 <?xml-stylesheet type="text/xsl" href="[Link]"?>
<configuration>
4
<property>
5 <name>[Link]</name>
6 <value>1</value>
7 </property>
8 <property>
<name>[Link]</name>
9 <value>false</value>
10 </property>
11 </configuration>
12
Step 9: Edit the [Link] file and edit the property mentioned below
inside configuration tag:
In some cases, [Link] file is not available. So, we have to create the mapred-
[Link] file using [Link] template.
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?xml-stylesheet type="text/xsl" href="[Link]"?>
3 <configuration>
4 <property>
5 <name>[Link]</name>
6 <value>yarn</value>
</property>
7 </configuration>
8
Step 10: Edit [Link] and edit the property mentioned below inside configuration tag:
1
2
<?xml version="1.0">
3 <configuration>
4 <property>
5 <name>[Link]-services</name>
6 <value>mapreduce_shuffle</value>
</property>
7 <property>
8 <name> [Link]</
9 name>
1 <value>[Link]</value>
0 </property>
</configuration>
1
1
Step 11: Edit [Link] and add the Java Path as mentioned below:
[Link] contains the environment variables that are used in the script to run
Hadoop like Java home path, etc.
Command: vi hadoop–[Link]
Command: cd
Command: cd hadoop-2.7.3
This formats the HDFS via NameNode. This command is only executed for the first
time. Formatting the file system means initializing the directory specified by the
[Link] variable.
Never format, up and running Hadoop filesystem. You will lose all your data stored in the
HDFS.
Step 13: Once the NameNode is formatted, go to hadoop-2.7.3/sbin directory and start all
the daemons.
Command: cd hadoop-2.7.3/sbin
Either you can start all daemons with a single command or do it individually.
Command: ./[Link]
Start NameNode:
The NameNode is the centerpiece of an HDFS file system. It keeps the directory tree of all
files stored in the HDFS and tracks all the file stored across the cluster.
On startup, a DataNode connects to the Namenode and it responds to the requests from the
Namenode for different operations.
Start ResourceManager:
ResourceManager is the master that arbitrates all the available cluster resources and thus
helps in managing the distributed applications running on the YARN system. Its work is
to manage each NodeManagers and the each application’s ApplicationMaster.
Start NodeManager:
The NodeManager in each machine framework is the agent which is responsible for
managing containers, monitoring their resource usage and reporting the same to the
ResourceManager.
Start JobHistoryServer:
JobHistoryServer is responsible for servicing all job history related requests from client.
Step 14: To check that all the Hadoop services are up and running, run the below
command.
Command: jps
RESULT
Thus, the installation of a Hadoop single node cluster and run simple applications like wordcount.
Ex no. 8 Install Hadoop Single Node Cluster and Run Simple Applications like Word Count
AIM:
To Create and Execute Your First Container Using Docker and Run a container from Docker Hub.
PROCEDURE:
Run a container from docker hub
Rundocker -h,
$ docker -h
Flag shorthand -h has been deprecated, please use --help Usage:
...
Management Commands:
builder Manage builds
config Manage Docker configs
container Manage containers engine
Manage the docker engine
image Manage images
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
The Docker command line can be used to manage several features of the Docker Engine. In this lab, we
willmainly focus on the container command.
If podman is installed, you can run the alternative command for comparison.
sudo podman -h
You can additionally review the version of your Docker installation, docker version
Client:
Version: 19.03.6
...
We are going to use the Docker CLI to run our first container. Open
KiB Mem : 2046768 total, 173308 free, 117248 used, 1756212 buff/cache
KiB Swap: 1048572 total, 1048572 free, 0 used. 1548356 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+
COMMAND 1 root 20 0 36636 3072 2640 R 0.3 0.2 0:00.04 top
Inspect the container with docker container exec
The docker container exec command is a way to "enter" a running container's namespaces with a new
process.
Open a new terminal. On [Link], select Terminal > New Terminal.
Using [Link], to open a new terminal connected to node1, click "Add New Instance" on
the lefthand side, then ssh from node2 into node1 using the IP that is listed by 'node1 '. For example:
[node2] (local) root@[Link] ~
$ ssh [Link]
[node1] (local) root@[Link] ~
$
In the new terminal, use the docker container ls command to get the ID of the running container you just
created.
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
b3ad2a23fab3 ubuntu "top" 29 minutes ago Up 29 minutes
goofy_nobel
You should see only the top process, bash process and our ps process.
root@b3ad2a23fab3:/# exit
exit
$ ps -ef
# Lots of processes!
docker ps -a
5e1bf0e6b926bd73a66f98b3cbe23d04189c16a43d55dd46b8486359f6fdf048 Nginx is a
lightweight web server. You can access it on port 8080 on your localhost.
Access the nginx server on localhost:8080. curl
localhost:8080
will return the HTML home page of Nginx,
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body
{
width: 35em; margin:
0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
If you are using play-with-docker, look for the 8080 link near the top of the page, or if you run a Docker
client with access to a local browser,
Run a mongo DB server
Now, run a mongoDB server. We will use the official mongoDB image from the Docker Hub. Instead of
using the latest tag (which is the default if no tag is specified), we will use a specific version of the mongo
image.
$ docker container run --detach --publish 8081:27017 --name mongo mongo:4.4 Unable
to find image mongo:4.4 locally
4.4: Pulling from library/mongo
d13d02fa248d: Already exists
bc8e2652ce92: Pull complete
3cc856886986: Pull complete
c319e9ec4517: Pull complete
b4cbf8808f94: Pull complete
cb98a53e6676: Pull complete
f0485050cd8a: Pull complete
ac36cdc414b3: Pull complete
61814e3c487b: Pull complete
523a9f1da6b9: Pull complete
3b4beaef77a2: Pull complete
Digest: sha256:d13c897516e497e898c229e2467f4953314b63e48d4990d3215d876ef9d1fc7c Status:
Downloaded newer image for mongo:4.4
d8f614a4969fb1229f538e171850512f10f490cb1a96fca27e4aa89ac082eba5
Access localhost:8081 to see some output from mongo.
curl localhost:8081
which will return a warning from MongoDB,
It looks like you are trying to access MongoDB over HTTP on the native driver port. If
you are using play-with-docker, look for the 8080 link near the top of the page.
>27017/tcp mongo
af549dccd5cf ubuntu "top" 5 minutes ago Up 5 minutes priceless_kepler
Step 3: Clean Up
First get a list of the containers running using docker container ls.
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
d6777df89fea nginx "nginx -g 'daemon ..." 3 minutes ago Up 3
minutes0.0.0.0:8080-
>80/tcp nginx
ead80a0db505 mongo "docker-entrypoint..." 3 minutes
agoUp 3 minutes [Link]:8081->27017/tcp mongo
af549dccd5cf ubuntu "top" 8 minutes
agoUp 8 minutes priceless_kepler
Next, run docker container stop [container id] for each container in the list. You can also use
thenames of the containers that you specified before.
$ docker container
stopd67 ead af5 d67
e
a
d
a
f
5
1. Remove the stopped containers
docker system prune is a really handy command to clean up your system. It will remove
anystopped containers, unused volumes and networks, and dangling images.
$ docker system
prune
WARNING!
lOMoAR cPSD| 30499130
This will
remove:
- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all dangling
images Are you sure
you want to continue?
[y/N] y Deleted
- Containers:
7872fd96ea4695795c41150a06067d605f69702dbcb9ce49492c9029f0e1b44b
60abd5ee65b1e2732ddc02b971a86e22de1c1c446dab165462a08b037ef78
35c
31617fdd8e5f584c51ce182757e24a1c9620257027665c20be75aa3ab6591
740
Result:
Thus, Creating and Executing of our First Container Using Docker and to Run a container from
Docker Hub has been executed successfully.
lOMoAR cPSD| 30499130
Procedure :
OpenStack is an open-source software cloud computing platform. OpenStack is primarily used for
deploying an infrastructure as a service (IaaS) solution like Amazon Web Service (AWS). In other
words, you can make your own AWS by using OpenStack. If you want to try out OpenStack,
TryStack is the easiest and free way to do it.
In order to try OpenStack in TryStack, you must register yourself by joining TryStack Facebook Group.
The acceptance of group needs a couple days because it’s approved manually. After you have been
accepted in the TryStack Group, you can log in TryStack.
[Link] Homepage
I assume that you already join to the Facebook Group and login to the dashboard. After you log in to
the TryStack, you will see the Compute Dashboard like:
lOMoAR cPSD| 30499130
In this post, I will show you how to run an OpenStack instance. The instance will be
accessible through the internet (have a public IP address). The final topology will like:
Network topology
As you see from the image above, the instance will be connected to a local
network and the local network will be connected to internet.
lOMoAR cPSD| 30499130
Network? Yes, the network in here is our own local network. So, your
instances will be not mixed up with the others. You can imagine this as your
own LAN (Local Area Network) in the cloud.
5. Click Launch.
6. If you want to create multiple instances, you can repeat step 1-5. I created
one more instance with instance name Ubuntu 2.
lOMoAR cPSD| 30499130
I guess you already know what router is. In the step 1, we created our
network, but it is isolated. It doesn’t connect to the internet. To make our
network has an internet connection, we need a router that running as the
gateway to the internet.
1. Go to Network > Routers and then click Create Router.
2. Fill Router Name for example router1 and then click Create router.
3. Click on your router name link, for example router1, Router Details page.
4. Click Set Gateway button in upper right:
1. Select External networks with external.
2. Then OK.
4. Click Add Rule, choose HTTP rule to open HTTP port (port 80), and then click Add.
5. Click Add Rule, choose SSH rule to open SSH port (port 22), and then click Add.
6. You can open other ports by creating new rules.
lOMoAR cPSD| 30499130
Now, you can SSH your instances to the floating IP address that you got in
the step 4. If you are using Ubuntu image, the SSH user will be ubuntu.
RESULT:
Thus, a procedure to launch a virtual machine using TryStack was completed successfully.
lOMoAR cPSD| 30499130
Aim:
To install GridSim and implement the java code for GridSim Environment to create ‘n’ users and
datacenters with the Gridlets running in each datacenter.
Procedure:
7. Click Browse and browse the gridSim folder and Select the folder.
13. Browse and Select all the jar files within gridSim folder → jars
14. Expand the project and Navigate into grid1 → examples → gridsim.example01 →
example1
15. open the source code by double clicking the example code
Example code:
Question:
package gridsim.example02;
/*
* Author Anthony Sulistio
* Date: April 2003
* Description: A simple program to demonstrate of how to use GridSim package.
* This example shows how to create one or more Grid users.
* A Grid user contains one or more Gridlets.
lOMoAR cPSD| 30499130
try
{
printGridletList(list);
id++;
Gridlet gridlet3 = new Gridlet(id, 9000, 900, 900);
lOMoAR cPSD| 30499130
return list;
}
/**
* Creates Grid users. In this example, we create 3 users. Then assign
* these users to Gridlets.
* @return a list of Grid users
*/
private static ResourceUserList createGridUser(GridletList list)
{
ResourceUserList userList = new ResourceUserList();
return userList;
{
int size = [Link]();
Gridlet gridlet;
} // end class
Output:
Creating 25 Gridlets
Creating 6 Grid users
Gridlet ID User ID length file size output size
0 0 3500 300 300
1 0 5000 500 500
2 0 9000 900 900
lOMoAR cPSD| 30499130
3 0 24798 91 253
4 0 4921 136 362
5 0 13917 112 361
6 1 22766 103 244
7 1 22048 129 354
8 1 12355 140 348
9 1 4891 136 324
10 1 26116 108 241
11 1 7467 144 334
12 2 17698 111 301
13 2 2130 129 300
14 2 16183 115 253
15 2 7842 128 354
16 2 31062 115 238
17 2 3469 135 225
18 3 17362 133 288
19 3 2061 135 346
20 3 13402 113 368
21 3 30585 106 348
22 3 22877 134 318
23 3 5026 94 271
24 4 14461 109 308
Result:
Thus, grid is simulated in GridSim environment and the program is executed successfully.