This page is meant to describe ways to prepare a Debian VM image ready to be used to deploy VM instances in OpenNebula.


The first step needed is to install a Debian system onto a system image which will be later run with the virtualizer of OpenNebula, typically kvm.

The easiest way to do this is to perform a Debian install inside qemu/kvm on a machine which may not be the OpenNebula execution host.

Attention : if the target is supposed to run a i686 VM, be careful to install from an i386 installer, and likewise for amd64.

After installation, the system will need to be personalized to include some scripts needed by OpenNebula. These scripts are executed upon boot, and to the contextualization of the VM : when OpenNebula deploys a VM, it will boot its image providing it with an iso9660 CD image which it will have prepared so that it contains a context definition file. The personalization you'll add to the VM image is the means to load that context file upon boot.


Preparing a Debian stable/wheezy amd64 image

Preparing an old Debian squeeze amd64 image

Customize the booted image to add contextualization boot scripts

Note: cloud-init supports OpenNebula contextualisation since v0.7.5. This version, at the time of the writing, is not yet available in Debian. Once available, simply add cloud-init package to your image and configure it (see cloud-init documentation) for OpenNebula.

Note: for OpenNebula 4.2 there is no need to modify rc.local file. Instead, launch your image and install image contextualization package. See Generic Contextualisation documentation.

A package is available in Debian repository (opennebula-context, from Jessie). The package does the same as described in OpenNebula documentation except that udev persistency rules on net and cdrom are not deleted (as forbids Debian Policy). This means that one need to manually delete generated rules (/etc/udev/rules.d/70-persistent-net.rules) before saving the image. The package adds also a script to copy all key ".pub" files present in mounted CDROM in root authorized_keys files.

Note: the following assumes that you want to proceed to Generic Contextualization (as opposed to another mechanism proposed in OpenNebula, see the docs above).

If you install the package, you can skip the following (for manual contextualization).

You may now shutdown the VM, and copy its .img file to the OpenNebula monitor host, and create an image that will be registered in the available images for VM instanciation.

See OpenNebula/PreparingDebianVmTemplate for hints on how to prepare the Debian VM template that will be booted off the image.