Friday, 31 January 2014

Cloudsim Setup and running simulation on ubuntu 12.04

Cloudsim Setup with Eclipse on ubuntu 12.04 (Simulation of cloudsim with eclipse)

Prerequisites to run Cloudsim

1) Install Java 1.6 or 1.7 or latest 

   sudo apt-get install openjdk-7-jdk

2)  Installing Eclipse

   sudo apt-get install eclipse 
  
or 

 Goto ubuntu software center

  write eclipse on search box and click on install option to install eclipse

3) Download the latest cloudsim using below link

http://cloudsim.googlecode.com/files/cloudsim-3.0.3.tar.gz 

 4) extract all

   $tar -xvf   cloudsim-3.0.3.tar.gz

5)  Go-to eclipse and create a new Java project

   i)  eclipse=> New=>Java Project

   ii) uncheck the default location and browse to cloudsim folder.


browse to cloudsim folder
   iii) click finish

Run an Example to feel the cloudsim Simulation

1) Click on cloudsim(above created project) project and go to examples folder

2) click on CloudSimExample1.java file and click on run (Ctrl+F11)

   


    
  3)  Output of the program is shown in the console

      
output of CloudSimExample1






Thursday, 30 January 2014

compile and install libvirt

Compile and Install libvirt on Ubuntu 12.04 

( $virsh -c esx://example.com/ error: invalid argument in libvirt was built without the 'esx' driver)

libvirt uses the standard configure/make/install steps:

Compiling from source

1) Download the libvirt-1.0.3.tar.gz from libvirt.org
    or
    use wget http://libvirt.org/source/ libvirt-1.0.3.tar.gz
2) extract all

$tar -xvf  libvirt-1.0.3.tar.gz

3) $cd libvirt-1.0.3

4) Install the dependencies such as  

sudo apt-get install gcc make pkg-config libxml2-dev libgnutls-dev libdevmapper-dev libcurl4-gnutls-dev python-dev libpciaccess-dev libxen-dev libnl-dev
       
5) ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-esx=yes --with-xen=yes

6) make
    sudo make install
7) Check whether libvirt and virsh were installed

virsh  --version
libvirt --libvirt

It displays 1.0.3 for libvirt


Try connecting to esx hypervios  using virsh commands

$virsh -c esx://example.com?no_verify=1
(replace example.com with ip or url)

enter the username and password of the node(hypervisor)

after authentication it will redirect to virsh mode:
#virsh

Now start using virsh commands to create, start, suspend, resume virtual machines.