Guide To Cloudsimexample1.Java Simulation Workflow: Cloudsim Setup Using Eclipse Ide
Guide To Cloudsimexample1.Java Simulation Workflow: Cloudsim Setup Using Eclipse Ide
java
simulation workflow
published: july 20, 2019 / updated: november 25, 2019 anupinder singh cloudsim
Any Example provided in the ‘org.cloudbus.cloudsim.example’ Package under the
example folder of the CloudSim project follows some standard steps to implement
the specified configuration to start a simulation. To understand the working of the
CloudSim simulation framework, knowledge about these steps is a must. This article
will help you to get an understanding of CloudsimExample1.java simulation workflow.
Before you start, It is essential that the cloudsim should already installed/setup on
your local computer machine. In case you are yet to install it, you may follow the
process of Cloudsim setup using Eclipse IDE
The main() method is the pointer from where the execution of this example starts
Set the Number of users for the current simulation. This user count is directly
proportional to a number of brokers in the current simulation.
Initialize the simulation, provided with the current time, number of users and
trace flag.
Create a Datacenter.
Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerTimeShared());
vmlist.add(vm);
broker.submitVmList(vmlist);
int id = 0;
long length = 400000;
long fileSize = 300;
long outputSize = 300;
UtilizationModel utilizationModel = new UtilizationModelFull();
cloudlet.setUserId(brokerId);
cloudlet.setVmId(vmid);
cloudletList.add(cloudlet);
broker.submitCloudletList(cloudletList);
CloudSim.startSimulation();
CloudSim.stopSimulation();
////////////////////////////////////////////////////
Beginners Guide to Cloudsim Project
Structure
https://www.cloudsimtutorials.online/beginners-guide-to-cloudsim-project-structure/
Let us first explore and understand the structure of this simulation project. I assume
that you have already set up the cloudsim using Ecplise if not you may follow my
previous article on “Cloudsim Setup using Eclipse“.
Let proceed further and your eclipse project explorer should contain 6 folders and 7
files.
Cloud
Sim Project Structure
The readme.txt file contains the necessary information about this project, like how to
install and run the cloudsim, what is the basic directory structure, if you are not using
any IDE then how to build the project source code.
Readme.txt file
Now, let us look at the directory structure in detail and understand the various
namespaces available in the “Source” folder
JRE system library: It is automatically created during the first build process
of the CloudSim by the eclipse.
Jars: This folder is supplied with the source zip file and contains the pre-
compiled build of the cloudsim 3.0.3. It can be used for creating custom
project scenarios whenever required. We will work on this in further blog
posts.
Build.xml is an ANT based XML file used during the console based builds.
Changelog.txt contains the history of the changes done to cloudsim during
various version releases.
License.xml contans GNU-GPL notification.
Pom.xml is a maven configuration file used during the setup of cloudsim
using eclipse.
Releasenotes.txt contains the note from the cloudsim development team.
////////////////////////////////////////////////////////////////////////////////
Cloud computing is a pay as you use model, which delivers infrastructure (IaaS),
platform (PaaS) and software (SaaS) as services to users as per their requirements.
Cloud computing exposes data centers capabilities as network virtual services,
which may include the set of required hardware, application with support of the
database as well as the user interface. This allows the users to deploy and access
applications across the internet which is based on demand and QoS requirements.
As Cloud computing is a new concept and is still in a very early stage of its
evolution, so researchers and system developers are working on improving
the technology to deliver better on processing, quality & cost parameters. But
most of the research is focused on improving the performance of provisioning
policies and to test such research on real cloud environment like Amazon EC2,
Microsoft Azure, Google App Engine for different applications models under variable
conditions is extremely challenging as:
1. Clouds exhibit varying demands, supply patterns, system sizes, and resources
(hardware, software, and network).
2. Users have heterogeneous, dynamic, and competing QoS requirements.
3. Applications have varying performance, workload, and dynamic application scaling
requirements.
Also, there are very few admin level configurations that a user/researcher could be
able to change. Hence, this makes the reproduction of results that can be relied
upon, an extremely difficult undertaking.
This simulation-based approach can provide various benefits across the researcher’s
community as it allows them to:
1. Test services in a repeatable and controllable environment.
2. Tuning the system bottlenecks (performance issues) before deploying on real clouds.
3. Simulating the required infrastructure(small or large scale) to evaluate different sets
of workload as well as resource performance, which facilitates for developing, testing
and deployment of adaptive application provisioning techniques.
This article provides a beginners guide to cloudsim simulation toolkit and helps then
to get an insight into the role of its various components.
All these features would help in accelerating the development, testing and
deployment of potential resource/application provisioning policies/algorithms for
Cloud Computing based systems.
CloudSim Architecture
The above diagram demonstrates the layered architecture of CloudSim Simulation
Toolkit. The CloudSim Core simulation engine provides support for modeling and
simulation of virtualized Cloud-based data center environments including queuing
and processing of events, creation of cloud system entities (like data center, host,
virtual machines, brokers, services, etc.) communication between components and
management of the simulation clock.
The User Code layer is a custom layer where the user writes their own code to
redefine the characteristics of the stimulating environment as per their new research
findings.
The description of all the major classes mentioned in the class diagram above is
described below:
a. type,
b. init time,
c. time at which the event should occur,
d. finish time,
e. time at which the event should be delivered to its destination entity,
f. IDs of the source and destination entities,
g. the tag of the event, and
h. Data that have to be passed to the destination entity.
2. CloudSimShutdown: This is an entity class that waits for the termination of all end-
user submitted cloudlets(tasks) and broker entities events, and once detected, then
signals the end of simulation to CIS.
Following is a very specific and important call hierarchy of classes which enables the
CloudSim Simulation Toolkit to simulate the cloud computing environment, as
demonstrated below:
////////////////////////////////////////////////////