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.
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.
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:
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.
OpenNebula does the following: