ElasticHosts Driver Guide 1.4

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.

ElasticHosts Configuration

You will need the following:

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

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.

Configuration

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       = "xml" ]
#-------------------------------------------------------------------------------
  • 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:

<xterm> $ onehost create eh im_eh vmm_eh tm_dummy </xterm>

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

ElasticHosts Specific Template Attributes

  • CPUMHZ: Minimum speed of the CPU requested.
  • MEMORY: Memory in MB requested for the VM.
  • SMP: Number of virtual processors or 'auto' to calculate based on cpu.
  • DRIVE: Comma separated list of previously uploaded drives to conform the VM.
  • NIC: Comma separated list of network interfaces.
  • BOOT: Which drive to boot from.

Testing

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

<xterm> $ cat ElasticHostsVM.one NAME=ElasticHosts

EH=[CPUMHZ=2000,

  MEMORY=1024,
  DRIVE="ide:0:0=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  NIC="nic:0:model=e1000,nic:0:dhcp=auto",
  BOOT="ide:0:0" 
 ]

</xterm>

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