Overview

ElasticHosts offers KVM based virtualized hosts in a cloud like fashion, i.e., à la Amazon EC2. This set of drivers speaks with the neat RESTful ElasticHosts API enabling cloudbursting if needed.

As seen in the figure, OpenNebula can be used to manage a virtual infrastructure on top of physical local infrastructure. In particular, we are using dedicated physical servers to provide the fabric for the flexible virtual infrastructure, which can be dynamically increased or decreased driven by its demand. If the local fabric is not enough to provide the demanded virtual infrastructure capacity (that is, we need to keep growing the cluster), we can spawn more nodes from a cloud provider, in this case the KVM based ElasticHosts. This guide shows how to configure OpenNebula to be able to interface this cloud provider.

In order to get hold of the ElasticHosts drivers code, you will need to clone the git repository:

$ git clone git://opennebula.org/one-elastichosts.git

Drivers Installation

There are two different OpenNebula components that needs to be modified: the core and the new drivers.

Core patch installation (for v2.0)

On an OpenNebula v2.0 source code directory ($SRC_ONE_LOCATION), copy the following files from the ElasticHosts drivers repository ($EH_REPO) to the OpenNebula source code folder:

  • $EH_REPO/include/EHDriver.h --> $SRC_ONE_LOCATION/include
  • $EH_REPO/src/vmm/{EHDriver.cc,SConstruct, VirtualMachineManager.cc} --> $SRC_ONE_LOCATION/src/vmm

Afterwards, recompile and install OpenNebula again.

Drivers installation

In order to install the OpenNebula ElasticHosts drivers, run the following from the $EH_REPO after OpenNebula is installed and $ONE_LOCATION properly set:

$ ./install.sh

Drivers will be added to the OpenNebula install.

Configuration

ElasticHosts Configuration

You will need the following:

  • An ElasticHosts account, with a valid EHAUTH
  • An updated OpenNebula installation.
  • The elastichosts script installed and accessible in your PATH

OpenNebula configuration

OpenNebula needs to know if it is going to use the ElasticHosts Driver. To achieve this, two lines have to be placed within ''$ONE_LOCATION/etc/oned.conf'', one for the VM driver and other for the information (IM) driver:

#-------------------------------------------------------------------------------
#  ElasticHost Information Driver Manager sample configuration
#-------------------------------------------------------------------------------
  IM_MAD = [
      name       = "im_eh",
      executable = "one_im_eh",
      arguments  = "im_eh/im_eh.conf",
      default    = "im_eh/im_eh.conf" ]
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  ElasticHost Virtualization Driver Manager sample configuration
#-------------------------------------------------------------------------------
   VM_MAD = [
      name       = "vmm_eh",
      executable = "one_vmm_eh",
      default    = "vmm_eh/vmm_eh.conf",
      type       = "eh" ]
#-------------------------------------------------------------------------------
  • The name of the driver needs to be provided at the time of adding a new host to OpenNebula.
  • executable points to the path of the driver executable file. It can be an absolute path or relative to ''$ONE_LOCATION/lib/mads''.
  • The default points to the configuration file for the driver. It can be an absolute path or relative to ''$ONE_LOCATION/etc''.
  • type identifies this driver as using XML messages.

Additionally, the tm_dummy section needs to be uncommented.

Once the configuration, OpenNebula needs to be restarted. Afterwards, you need to add ElasticHosts to the host list to be able to submit virtual machines, like the following:

$ onehost create eh im_eh vmm_eh tm_dummy

Driver configuration

  • The EHAUTH can be grabbed from the environment or can be set in ''$ONE_LOCATION/etc/vmm_eh/vmm_ehrc'
  • ''$ONE_LOCATION/etc/im_eh/im_ehrc'' holds the default capacity for the ElasticHosts provider. By default, this is set to a very low value, change it at your will.
TOTAL_MEMORY=2048
TOTAL_CPU=2

Driver Files

The driver consists of the following files:

  • $ONE_LOCATION/lib/mads/one_vmm_eh : Shell script wrapper to the virtualization ElasticHosts driver. Sets the environment and other bootstrap tasks.
  • $ONE_LOCATION/lib/mads/one_vmm_eh.rb : The actual ElasticHosts virtualization driver.
  • $ONE_LOCATION/etc/vmm_eh/vmm_ehrc : environment setup and bootstrap instructions for the ElasticHosts virtualization driver.
  • $ONE_LOCATION/etc/vmm_eh/vmm_eh.conf : set here default values for ElasticHosts domain definitions, useful for the ElasticHosts virtualization driver.
  • $ONE_LOCATION/lib/mads/one_im_eh : Shell script wrapper to the ElasticHosts information driver. Sets the environment and other bootstrap tasks.
  • $ONE_LOCATION/lib/mads/one_im_eh.rb : The actual ElasticHosts information driver.
  • $ONE_LOCATION/etc/im_eh/im_ehrc : environment setup and bootstrap instructions for the ElasticHosts information driver
  • $ONE_LOCATION/etc/im_eh/im_eh.conf : set here default values for ElasticHosts domain definitions, useful for the ElasticHosts information driver.

Note: If OpenNebula was installed in system wide mode these directories become ''/usr/lib/one/mads'' and ''/etc/one'', respectively. The rest of this guide refers to the $ONE_LOCATION paths (corresponding to self contained mode) and omits the equivalent system wide locations. More information on installation modes can be found here.

ElasticHosts Specific Template Attributes

  • NAME: Name of the VM requested
  • CPUMHZ: Minimum speed of the CPU requested.
  • MEMORY: Memory in MB requested for the VM.
  • DRIVE: Comma separated list of previously uploaded drives to conform the VM.
  • NICMODEL: Comma separated list of network interfaces.
  • NICDHCP: The IP address offered by DHCP to the network interface.
  • BOOT: Which drive to boot from.
  • VNCIP: IP address for overlay VNC access on port 5900.
  • VNCPASSWORD: Password for VNC access.

More information on the specific template attributes can be found here

Usage

In order to test the ElasticHosts driver, the following template can be instantiated with appropriate values and sent to a ElasticHosts resource:

$ cat ElasticHostsVM.one
EH=[NAME="bitrot",
   CPUMHZ="500",
   MEMORY="500",
   DRIVE="ide:0:0 xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
   NICMODEL="nic:0:model e1000",
   NICDHCP="nic:0:dhcp auto",
   VNCIP="vnc:ip auto",
   VNCPASSWORD="vnc:password password",
   BOOT="ide:0:0" 
  ]

The big number after DRIVE="ide:0:0= is the uuid of a drive previously uploaded to ElasticHosts. See this for details.

eh.png (79.6 kB) Tino Vázquez, 09/20/2010 04:34 pm