Wednesday, December 11, 2013

FCFS Task Allocation in CloudSim

Hi All,
Today I'm going to write an Application in Java using CloudSim 3.0.3 Library, which simulates the Cloud and performs Tasks Allocation to the VMs on the basis of FCFS, First-Come-First-Served Scheduling Policy, in the Cloud. There are many ways to write this program. I'm writing in one of those ways. The Post is for all who know the basics of OOPs and Java Platform. Let's first see the architecture of CloudSim. It is shown below.

In CloudSim, UserCode forms the top layer, where the user creates specification and scheduling policies for the Cloud Environment. Below Diagram shows the Classes or Entities that form the CloudSim Library and their relationships.


Let's now see the sequence diagram of any Cloudsim Application.

 From all these diagrams, we must have understood the working of CloudSim Application. Finally, let's see the exact working style of Cloudsim Entities in the below diagram.

 


Ideas Got:
Our FCFS Application should have a Datacenter Broker that implements the FCFS Task Scheduling Policy. The different Entities in our application are:
  1. FCFS
  2. FCFS Broker
  3. Datacenter Creator
  4. Vms Creator
  5. Tasks or Cloudlet Creator
FCFS : This entity creates the Datacenter and Creates the Vms and Creates the Cloudlets or Tasks by calling respective other entities. Once all of them are created, Vms and Tasks are submitted to the FCFS Broker.

FCFS Broker : This is a Datacenter Broker and it schedules the tasks to the Vms on the basis of FCFS policy. The tasks are got from the FCFS Entity.

Datacenter Creator : This entity is used to create Datacenter(s).

Vms Creator : This entity creates the specified number of Vms given by the user.

Cloudlet Creator : This entity creates the specified number of tasks. Below figure shows the Class Diagram of the Application.




Thus, we can perform Tasks Allocation to the VMs on the basis of FCFS, First-Come-First-Served Scheduling Policy, in the Cloud. Sample Source Code is given in the link below:
Sample Source in BitBucket
  Happy Exploring :)

No comments:

Post a Comment