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.

cloudsim_arch

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.

cloudsim-class

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

cloudsim-flowFrom 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.

clousim-work style Continue reading “FCFS Task Allocation in CloudSim”

CloudSim Setup and Running Simulation using Eclipse in Linux

Hi,

Today, I’m gonna explain how to setup CloudSim Environment in your Linux Machine using Eclipse IDE. CloudSim is actually a Library for Cloud Simulation written in Java Language, that can be added to our Source files. So, Essentially, Our Linux Computer should have Java Development Kit installed in it. It can be installed by typing the following command in your terminal. Skip the sections if Java an Eclipse Installations are already done.

Step 1. Installation & Verification of Java Compiler

sudo apt-get install openjdk-7-jdk

You can verify the installation of JDK, by typing the below command in your terminal.

javac -version               or            java -version

Step 2. Installation of Eclipse

On execution of the above commands, the version of the Java Compiler and/or the Java RunTime Environment will be displayed. If the JDK version is displayed, you are ready to go ahead and install Eclipse. Eclipse can be installed using the following command in your terminal.

sudo apt-get install eclipse

Note, that all the installations can also be done in a graphical way using Software Updater in Ubuntu.

Step 3. Creation of Project (for Complete Beginners)

Now that, we have installed Java Compiler and Eclipse, we can create a new project and add the Libraries to it. Create a new Project in Eclipse. This can be done using File->New->Project->Java Project; Give a name to your Project.  Now the screen will resemble the screen-shot shown below:

newPrj

Step 4: CloudSim Library Adding

Currently, there is no source file associated with it. Let’s firstly add the libraries to it. Right Click the Project and add folder named “libs” to it. Assuming you had already downloaded and extracted the CloudSim Library from the website http://cloudsim.googlecode.com/files/cloudsim-3.0.3.tar.gz

Go to the Extracted Folder and locate the jars in the “jars” folder. Copy the jar, cloudsim-3.03.jar and paste it inside the newly created folder in the project, as  shown below.

jarRight-Click the Jar Build Path -> Add to Build Path. Immediately the jars will be added in the Referenced Libraries.

Continue reading “CloudSim Setup and Running Simulation using Eclipse in Linux”