Introduction to OpenNebula

OpenNebula is a fully open-source toolkit to build IaaS Private, Public and Hybrid Clouds. The first step is always to build a Private Cloud that can be subsequently extended as Hybrid Cloud by combining local resources in the Private Cloud with resources from remote Cloud providers or as Public Cloud by exposing Cloud interfaces to access the Private or Hybrid Cloud. This guide briefly describes how OpenNebula operates to build a Private Cloud. After reading this guide you may be interested in reading the guide describing how an hybrid cloud operates and the guide describing how a public cloud operates.

What is a Private Cloud?

The aim of a Private Cloud is not to expose to the world a cloud interface to sell capacity over the Internet, but to provide local cloud users and administraors with a flexible and agile private infrastructure to run virtualized service workloads within the administrative domain. OpenNebula virtual infrastructure interfaces expose user and administrator functionality for virtualization, networking, image and physical resource configuration, management, monitoring and accounting.

The User View

An OpenNebula Private Cloud provides infrastructure users with an elastic platform for fast delivery and scalability of services to meet dynamic demands of service end-users. Services are hosted in VMs, and then submitted, monitored and controlled in the Cloud by using the OpenNebula Operations Center or any of the OpenNebula interfaces:

  • Command Line Interface (CLI)
  • XML-RPC API
  • OpenNebula Cloud APIs
  • Libvirt virtualization API or any of its management tools

Lets do a sample session to illustrate the functionality provided by the OpenNebula CLI for Private Cloud Computing. First thing to do, check the hosts in the physical cluster:

<xterm> $ onehost list

ID NAME                      CLUSTER                   RVM   TCPU   FCPU   ACPU    TMEM    FMEM STAT
 0 host01                    default                     0    800    800    800 8194468 7867604   on
 1 host02                    default                     0    800    797    800 8387584 1438720   on

</xterm>

We can then register an image in OpenNebula, by using oneimage. We are going to build an image template to register the image file we had previously placed in the /home/cloud/images directory.

NAME          = "Ubuntu Desktop"
PATH          = /home/cloud/images/ubuntu-desktop/disk.0
PUBLIC        = YES
DESCRIPTION   = "Ubuntu 10.04 desktop for students."

<xterm> $ oneimage register ubuntu.oneimg $ oneimage list

ID     USER                 NAME TYPE              REGTIME PUB STAT  #VMS
 1 oneadmin       Ubuntu Desktop   OS   Jul 11, 2010 15:17 Yes  rdy     0

</xterm>

This image is now ready to be used in a virtual machine. We need to define a virtual machine template to be submitted using the onevm command.

CPU    = 1
MEMORY = 2056

DISK = [ image  = "Ubuntu Desktop" ]

DISK = [ type   = swap,
         size   = 1024 ]

NIC    = [ NETWORK = "Public network" ]

Once we have tailored the requirements to our needs (specially, CPU and MEMORY fields), ensuring that the VM fits into at least one of both hosts, let's submit the VM (assuming you are currently in your home folder):

<xterm> $ onevm create myfirstVM.template </xterm>

This should come back with an ID, that we can use to identify the VM for monitoring and controlling, again through the use of the onevm command:

<xterm> $ onevm list

ID     USER     NAME STAT CPU     MEM        HOSTNAME        TIME
 0 oneadmin    one-0 runn   0   65536          host01  00 0:00:02

</xterm>

The STAT field tells the state of the virtual machine. If there is an runn state, the virtual machine is up and running. Depending on how we set up the image, we may be aware of it's IP address. If that is the case we can try now and log into the VM.

To perform a migration, we use yet again the onevm command. Let's move the VM (with VID=0) to host02 (HID=1):

<xterm> $ onevm livemigrate 0 1 </xterm>

This will move the VM from host01 to host02. The onevm list shows something like the following:

<xterm> $ onevm list

ID     USER     NAME STAT CPU     MEM        HOSTNAME        TIME
 0 oneadmin    one-0 runn   0   65536          host02  00 0:00:06

</xterm>

You can also reproduce this sample session using the graphical interface provided by the OpenNebula Operations Center, that will simplify the typical management operations.

How the System Operates

OpenNebula does the following:

  • Management of the Network, Computing and Storage Capacity: Orchestration of storage, network and virtualization technologies to enable the dynamic placement of the multi-tier services on distributed infrastructures
  • Management of VM Life-cycle: Smooth execution of VMs by allocating the resources required for them to operate and by offering the functionality required to implement VM placement policies
  • Management of Workload Placement: Support for the definition of workload and resource-aware allocation policies such as consolidation for energy efficiency, load balancing, affinity-aware, capacity reservation…
  • Management of Virtual Networks. Support for the definition of virtual networks to interconnect VMs
  • Management of VM Images: Exposing of general mechanisms to transfer and clone VM images. Images can be registered before execution. When submited, VM images are transferred to the host and swap disk images are created. After execution, VM images may be copied back to the repository.
  • Management of Information and Accounting. Provision of indicators that can be used to diagnose the correct operation of the servers and VMs and to support the implementation of the dynamic VM placement policies
  • Management of Security: Definition of security policy on the users of the system, guaranteeing that the resources are used only by users with the relevant authorizations and isolation between workloads
  • Management of Remote Cloud Capacity: Dynamic extension of local capacity with resources from remote providers to build hybrid or federated cloud deployments
  • Management of Public Cloud Servers: Exposing of most common cloud interfaces to support public cloud computing deployments