This tutorial introduces a set of tools designed to automatically deploy and configure Infrastructure-as-a-Service Cloud frameworks on Grid'5000.

OpenNebula

OpenNebula is a fully open-source IaaS Cloud implementation designed to address the requirements of business use cases. It consists in a set of virtualization tools for managing local data centers, but
also for interconnecting multiple Cloud environments. The main design principles on which the OpenNebula project relies include a modular and extensible architecture, scalability for large-scale
infrastructures, interoperability with existing Cloud offerings, open-source implementation. OpenNebula aims at providing standardized interfaces for managing virtual machines and
data, such as the Amazon EC2 or OCCI API.

Deploying OpenNebula on Grid'5000

Making a reservation

In order to deploy OpenNebula on Grid'5000, we first have to make a reservation on one or multiple Grid'5000 sites.
Here is an example of an interactive reservation on the Rennes, Nancy and Sophia sites:

In addition to the number of needed nodes, the reservation has to specify the virtual subnet you plan to use for your experiments. In this tutorial we will use a /22 subnet (range of 1024 IPs) for each of the sites.
The reservation request will return a batch reservation ID for each Grid'5000 site, which we will further use to deploy the cloud framework:

Prerequisites

The OpenNebula deployment scripts have a set of Ruby gem dependencies.
To install them on a site's frontend, run the following commands:

frontend:

export GEM_HOME=$HOME/.gem

gem install gosen json net-ssh net-scp restfully

Deploying OpenNebula

The deployment scripts can be found on the Rennes site.

/home/acarpena/opennebula-deploy/openNebula3.4-v2

The OpenNebula deployment script supports multiple job reservations, provided by the user through a YAML file. Create a file named jobs.yml in your home directory with the following contents, replacing highlighted values by the ones corresponding to your job:

The script will deploy a Debian Squeeze environment on the reserved nodes, download the latest OpenNebula packages (currently the OpenNebula 3.4 release) and finally it will install and configure the OpenNebula cloud.
It will consist in a set of compute nodes that will host virtual machines and a frontend node, which will be used as the Cloud entry point.

After a successful deployment, the script will print the hostname of the frontend node:

Creating a virtual network for each Grid'5000 site is needed to ensure the VMs are assigned valid IP addresses, as each Grid'5000 site has a private pool of virtual IPs (more details here). When a VM is deployed, it has to be configured with a predefined virtual network, and it will receive an IP address specific to its virtual network. In order for the VM to be correctly deployed, the scheduler takes into account the cluster property of the compute nodes to deploy each VM on the Grid'5000 site that matches its IP address.

Defining and executing Virtual Machines

This section gives a short introduction to defining Virtual Machine templates and executing them as VM instances in OpenNebula. The full tutorial can be found on the OpenNebula website.

Datastores

The storage management in OpenNebula 3.4 relies on the concept of datastores (OpenNebula website).
These deployment scripts create a simple, non-shared file system datastore for the VM images, which uses ssh to distribute the images to the hosts.
Datastores can be accessed through the onedatastore command.

ONfrontend:

onedatastore list

The datastore created automatically by the scripts is called ONstore and it shoud be listed along with the two datastores predefined by OpenNebula:

Virtual Machine Images

Users can define disk images and store them in a Image Repository, as described in the OpenNebula documentation.
The following example provides a description for the most common type of image, that is an operating system image.

Note that the path to the image must be accessible from the OpenNebula frontend. In this example we used an image stored on the shared NFS home directory.

The Image Repository can be managed with the oneimage command.
To register the image in the repository, copy the previous image description to a new file and run the following command as the oneadmin user:

ONfrontend:

oneimage create /path/to/image/description --datastore ONstore

The image has to be stored in one of the existing datastores previously defined in OpenNebula. In this example, we used the ONstore repository we described at the previous step.

The oneimage command can also be used to access the list of already registered images:

ONfrontend:

oneimage list

The deployment scripts create a default VM image and add it to the Image Repository. Upon deployment, the list of images should be the following:

Details of any image in the list can be retrieved by issuing a show command for a specific image ID.

ONfrontend:

oneimage show ID

Virtual Machine Templates

Once an image has been registered into the system, the user can define a VM template that can be later used to deploy one or several VM instances.
The following example defines a VM with 512MB of memory and one CPU, along with a set of additional propertied needed for the Grid'5000 deployment:

To properly define a VM template that can be used in a multi-site Grid'5000 reservation, the user has to specify the following components:

the disk image, which needs to be previously registered in the Image Repository

the virtual network to which the VM will be attached. In our case, it has to be one of the predefined virtual networks already created by the deployment scripts.

contextualization information, which has to include the gateway, network mask and DNS values provided by the selected virtual network, as they are specific to each Grid'5000 site as well. A full tutorial for VM contextualization in OpenNebula can be found in the latest documentation.

The Template Repository can be managed with the onetemplate command.
To register the VM definition in the repository, copy the previous image description to a new file and run the following command as the oneadmin user:

ONfrontend:

onetemplate create /path/to/vm/template/description

The list of existing templates can be retrived with the same command:

ONfrontend:

onetemplate list

The repository should contain a set of predefined VM templates by default, each of them corresponding to a specific site in the user reservation forwarded to the deployment scripts.