How cloudsim work?
As it is already mentioned that the cloudsim allows to model and simulate the cloud system components, therefore to support its function different set of classes has been developed by its developers like:
- To simulating the regions and datacenters the class named “Datacenter.java” is available in org.cloudbus.cloudsim package.
- To simulate the workloads for cloud, the class named as “Cloudlet.java” is available in org.cloudbus.cloudsim package.
- To simulate the load balancing and policy-related implementation the classes named “DatacenterBroker.java”, “CloudletScheduler.java”, “VmAllocationPolicy.java”, etc are available under org.cloudbus.cloudsim package.
- Now because all the different simulated hardware models are required to communicate with each other to share the simulation work updates for this cloudsim has implemented a discrete event simulation engine that keeps track of all the task assignments among the different simulated cloud components.
To read understand more on the architecture, you should definitely read the article titled “CloudSim Simulation Toolkit: An Introduction” as well as “Beginners Guide to Cloudsim Project Structure“
How to run my first cloudsim simulation scenario?
Once you have completed your installation/setup and understand the basic working of the cloudsim, the next step is to implement your own custom scenario. Any simulation will go through the following steps:
- Initialize the CloudSim with the current clock time and this will also initialize the core CloudInformationService entity.
- Create Datacenter(s) as Datacenters are the resource providers in CloudSim. We need at list one of them to run a CloudSim simulation.
- Create Broker to simulate the user workload scheduling as well as virtual machine allocation and placements.
- Create one/more virtual machine and submit to the broker for further submitting it to the respective DataCenters for its placement and execution management during the simulation run.
- Create one/more Cloudlet and submit the cloudlet list to the broker for further task scheduling on the active virtual machines for its processing during the simulation run.
- Starts the simulation, this will initiate all the entities and components created above and put them into execution for supporting various simulation operations.
- Stop the simulation, concludes simulation and flush all the entities & components before the exit of a simulation run.
- Print results when the simulation is over, where you will be able to display which cloudlet executed on which virtual machine along with how much time it spent in execution, its start time as well as its finish time.
The step by step detailed description about each step can be read in the article “Guide to CloudsimExample1.java simulation workflow“
It is frequently used for?
- Load Balancing of resources and tasks
- Task scheduling and its migrations
- Optimizing the Virtual machine allocation and placement policies
- Energy-aware Consolidations or Migrations of virtual machines
- Optimizing schemes for Network latencies for various cloud scenarios
- and many more.