LVM 3.2
The LVM TM driver is an alternative to tm_shared
and tm_ssh
driver. It features instantaneous image deployment through LVM snapshots.
LVM must be available in the Hosts. The oneadmin
user should be able to execute several LVM related commands with sudo passwordlessly.
The oneadmin Unix account must be able to ssh passwordlessly between the front-end and the hosts, and also from the hosts to the front-end,
The easiest way to have this kind of configuration is the one explained in the installation guide, to copy the ~/.ssh
directory to all the machines.
The idea behind this TM driver is not to provide a full-blown LVM solution, but a basic example which can be tailored to fit a more specific scenario.
This driver assumes that all clonable images (block devices) already exist in all the Hosts. See the Usage section for more information.
Saving disk images is supported by dumping the device to a file and scp'ing the disk image back to the frontend.
The 'onevm saveas' functionality works as expected, see the considerations above.
This driver does not support these operations since the depend strongly on each particular environment.
lvremove
, lvcreate
, lvs
and dd
.The LVM TM driver is named “tm_lvm”. It is not enabled by default, and has to be uncommented in oned.conf. After that, OpenNebula has to be restarted.
TM_MAD = [ name = "tm_lvm", executable = "one_tm", arguments = "tm_lvm/tm_lvm.conf" ]
Before using this driver the administrator must set the proper VG_NAME that will hold all the source LVM block devices that will be cloned by the Virtual Machines.
VG_NAME=<The LVM Volume Group>
When deploying a new Virtual Machine, this driver will create a new snapshot if the PATH parameter of the DISK section is set to a block device (/dev/*
). Consider the scenario where the DISK section is:
DISK = [ SOURCE="/dev/vg-one/ubuntu-10.04", ...]
The following command will run in the OpenNebula Host.
<xterm>
$ lvcreate -L20G -n lv-one-<vm_id>-<disk_id> /dev/vg-one/ubuntu-10.04
</xterm>
This commands creates a new block device lv-<one-vm_id>-<disk_id>
as a 20G snapshot of /dev/vg-one/ubuntu-10.04
. For this command to work /dev/vg-one/ubuntu-10.04
MUST
exist in the OpenNebula Host. In other words, this driver requires that every LVM block device that will be cloned should exist in all the OpenNebula Hosts. This must be achieved outside of OpenNebula, either by a custom script that syncs all the LVM block devices, or by specific tools such as CLVM.
Depending on your scenario you might want to reimplement specific TM actions to enable features like stopping, resuming and migrating: