CloudSim in Eclipse


CloudSim is written in Java. The only required knowledge you need to use CloudSim is basic Java programming and some basics about Cloud computing. Knowledge on programming IDEs such as Eclipse or NetBeans is also helpful. It is a library and hence CloudSim does not have to be installed. Normally, you can unpack the downloaded package in any directory, add it to Java classpath and it is ready to be used. Please verify whether Java is available on your system by running java –version and javac command.

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers
To use CloudSim in Eclipse:
  1. Download CloudSim installable files from https://code.google.com/p/cloudsim/downloads/list and unzip
  2. Open Eclipse
  3. Create new Java Project: File -> New
  4. Import unpacked cloudsim project into new Java Project
  5. First step is to initialize CloudSim package by initializing the CloudSim library:
CloudSim.init(num_user, calendar, trace_flag)

 

  1. Datacenters are the resource providers in CloudSim hence creation of Datacenters is a second step; To create Datacenter, you need DatacenterCharacteristics object that stores the properties of a data center such as architecture, OS, list of Machines, allocation policy: time- or space-shared, time zone and its price (G$/Pe time unit)
Datacenter datacenter9883 = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);

 

  1. Third step is to create a broker

 

DatacenterBroker broker = createBroker();

 

  1. Fourth step is to create one virtual machine unique ID of the VM, userId ID of the VM’s owner,mips, number Of Pes amount of CPUs, amount of ram, amount of bandwidth, amount of storage, virtual machine monitor, and cloudletScheduler policy for cloudlets
Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared())

 

  1. Submit Vm or Vm List to Broker
broker.submitVmList(vmlist)

 

  1. Create a Cloudlet with length, file size, output size, utilization model
Cloudlet cloudlet = new Cloudlet(id, length, pesNumber, fileSize, outputSize, utilizationModel, utilizationModel, utilizationModel)

 

  1. submit cloudlet list to the broker
broker.submitCloudletList(cloudletList)

 

  1. Starts the simulation
CloudSim.startSimulation()

 

Sample Output from the Existing Example:

Starting CloudSimExample1…Initialising…Starting CloudSim version 3.0

Datacenter_0 is starting…

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>null

Broker is starting…

Entities started.

0.0: Broker: Cloud Resource List received with 1 resource(s)

0.0: Broker: Trying to Create VM #0 in Datacenter_0

0.1: Broker: VM #0 has been created in Datacenter #2, Host #0

0.1: Broker: Sending cloudlet 0 to VM #0

400.1: Broker: Cloudlet 0 received

400.1: Broker: All Cloudlets executed. Finishing…

400.1: Broker: Destroying VM #0

Broker is shutting down…

Simulation: No more future events

CloudInformationService: Notify all CloudSim entities for shutting down.

Datacenter_0 is shutting down…

Broker is shutting down…

Simulation completed.

Simulation completed.

 

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

Cloudlet ID    STATUS    Data center ID    VM ID    Time    Start Time    Finish Time

0        SUCCESS        2            0        400        0.1        400.1

*****Datacenter: Datacenter_0*****

User id           Debt

3           35.6

**********************************

CloudSimExample1 finished!

 

Advertisements

3 thoughts on “CloudSim in Eclipse”

  1. Hi 🙂

    Thank you for sharing this post. I’m working on a cloudsim project and I’m still a beginner. My project idea is to pass some intensive workloads to the cloud and then measure cloud’s performance, but in this phase, i dont know where to place these workloads exactly in the simulator classes. I figured that Cloudlet class isnt the right one to modify! So, can you please help me with this?

    thanks in advance,
    Ebtesam.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s