This article mainly introduces me in the use of Cloudsim, translation, collation and understanding of some of the information, as well as my experience in the use of the hope that the need to help friends!
1. I translate and understand some of the information:
April 8, 2009, the University of Melbourne, Australia's grid laboratory and Gridbus Project announced the launch of cloud computing simulation software, known as Cloudsim. It is a library of functions developed on discrete event simulation package Simjava that can run across platforms on Windows and Linux systems, Cloudsim inherits the Gridsim programming model, supports the research and development of cloud computing, and offers the following new features: (1) Modeling and simulation of infrastructure supporting large-scale cloud computing; (2) a self-contained platform that supports data centers, service agents, scheduling, and distribution policies. One of the unique features of Cloudsim is to provide a virtualization engine designed to help build and manage multiple, independent, and collaborative virtualization services on data center nodes, and to flexibly switch between time sharing and spatial sharing when assigning processing cores to virtualization services. The Cloudsim platform helps accelerate the development of algorithms, methodologies, and specifications for cloud computing. Cloudsim's component tools are open source. Cloudsim's software Architecture framework and architecture components include the Simjava, Gridsim, Cloudsim, and Usercode four levels.
Cloudsim is developed on the basis of the Gridsim model, which provides the characteristics of cloud computing and supports the resource management and scheduling simulation of cloud computing. A significant difference between cloud computing and grid computing is that cloud computing uses a mature virtualization technology to virtualize data center resources into resource pools, and to package external services to users, Cloudsim embodies this feature, extending the implementation of a series of interfaces that provide data center-based virtualization technology, Modeling and simulation capabilities for virtualized clouds. Typically, the resources of a single host in the datacenter can be mapped to multiple virtual machines based on the user's needs, so there is a competitive relationship between the virtual machines and the host resources. Cloudsim provides resource monitoring, host-to-virtual-machine mapping capabilities. Cloudsim's CIS (Cloud information Service) and Datacenterbroker realize resource discovery and information interaction, which is the core of the simulation scheduling. The scheduling algorithm developed by the user can be implemented in the Datacenterbroker method, thus realizing the simulation of the scheduling algorithm.
Several core classes are introduced according to Cloudsim source code:
(1) Cloudlet class: Build tasks in a cloud environment.
(2) Datacenter Class: Data center, providing virtualized grid resources, processing virtual machine information query, including virtual machine to resource allocation strategy, cloud computing uses Vmprovisioner processing virtual machine.
(3) Datacenterbroker class: Hides the management of virtual machines, such as creation, task submission, virtual machine destruction, and so on.
(4) Host class: Extends the machine to the virtual machine in addition to the processing unit (PE) parameter assignment policy, such as bandwidth, storage space, memory, etc., one host can correspond to multiple virtual machines.
(5) Virtualmachine Class: Virtual Machine class, run on host, share resources with other virtual machines, each virtual machine is owned by one owner, can submit task, and be customized by Vmscheduler class scheduling policy of the virtual machine.
(6) Vmscheduler class: The scheduling policy of the virtual machine, which is used to manage the execution task and realizes the task interface.
(7) Vmcharacteristics class: Provides a description of the virtual machine.
(8) Vmmallocationpolicy class: A Virtual machine monitor policy class that describes a policy for sharing resources on multiple virtual machines on the same host.
(9) Vmprovisioner class: Implements a host-to-virtual-machine mapping for a datacenter.
2, Cloudsim environment configuration
(1) JDK Installation and configuration
Download the latest version of the JDK from http://java.sun.com/Jdk1.6.0_13,cloudsim needs to run above the JDK1.6 version. Install the downloaded JDK and set the environment variables. Add path in path: C:/Program Files/java/jdk1.6.0_13/bin; Classpath added path: C:/Program Files/java/jdk1.6.0_13/lib/dt.jar; C:/Program Files/java/jdk1.6.0_13/lib/tools.jar;.
(2) Cloudsim Configuration
Download Cloudsim 1.0 beta version from http://www.gridbus.org/cloudsim/, download a zip package, unzip the package. Set environment variables, add path in classpath: C:/cloudsim/jars/cloudsim.jar; C:/cloudsim/jars/gridsim.jar; C:/cloudsim/jars/simjava2.jar;.
3. Expansion of Cloudsim
Cloudsim is open source, can be run on Windows XP and Linux, the user can expand Cloudsim according to their own research content, add their own code, need to recompile and publish the platform. Here's how to compile and build the platform:
Download Ant tool from http://ant.apache.org/, extract to Directory d:/apache-ant-1.7.1, set environment variable, add: D:/apache-ant-1.7.1/bin in Path;. Switch the command line to the extended Cloudsim path (the directory where build.xml resides), type command d:/cloudsim>ant at the command line, bulk compile Cloudsim source files, The resulting file is stored in the specified location according to Build.xml settings, and after compilation succeeds, type the D:/cloudsim>ant makejar command at the command line to package the build New_cloudsim.jar. The extended Cloudsim platform builds successfully. To reset the environment variable, add the path in Classpath: d:/cloudsim/jars/new_cloudsim.jar;d:/cloudsim/jars/cloudsim.jar;d:/cloudsim/jars/ G-ridsim.jar; D:/cloudsim/jars/simjava2.jar, the next step is to write your own simulation verifier under the new platform.
4, the use of Cloudsim simulation of the general steps
(1) Initializing the Gridsim library
Gridsim.init (Num_user, Calendar, Trace_flag, exclude_from_file,exclude_from_processing, report_name);
(2) Create a data center, in the Cloudsim simulation platform, a data center consists of one or more machine, a machine is composed of one or more PES or CPUs.
DataCenter Datacenter0 = Createdatacenter ("Datacenter_0");
(3) Create broker Broker
Datacenterbroker broker = Createbroker ();
int brokerid = broker.get_id ();
(4) Create a virtual machine
Vmlist = new Virtualmachinelist ();
Specify broker for virtual machine at creation time
Virtualmachine vm1 = new Virtualmachine (
New Vmcharacteristics (VMID,BROKERID,SIZE,MEMORY,BW,VCPUS,PRIORITY,VMM,
New Timesharedvmscheduler ()));
To join a virtual machine to a list of virtual machines
Vmlist.add (VM1);
Submit a list of virtual machines to the appropriate agent broker
Broker.submitvmlist (vmlist);
(5) Create a cloud task
Cloudletlist = new Cloudletlist ();
User Id,brokerid the specified task at creation time
Cloudlet Cloudlet1 = new Cloudlet (id, length, file_size, output_size);
Cloudlet1.setuserid (Brokerid);
......
Adding tasks to the Task list
Cloudletlist.add (CLOUDLET1);
......
Submit a task list to broker broker
Broker.submitcloudletlist (cloudletlist);
(6) Start simulation
Gridsim.startgridsimulation ();
(7) Statistical results after simulation is completed
Cloudletlist NewList = Broker.getcloudletlist ();
Gridsim.stopgridsimulation ();
Printcloudletlist (NewList);
Datacenter0.printdebts ();
If the platform is expanded according to its own research, the platform can be reborn into a program that calls its own classes, methods, member variables, and so on.
Reprint Please specify, thank you for your cooperation!
Rolin
2009-7-21
Cloudsim Introduction and use