The Block LVM Datastore 4.4
The Block LVM datastore driver provides OpenNebula with the possibility of using LVM volumes instead of plain files to hold the Virtual Images.
It is assumed that the OpenNebula hosts using this datastore will be configured with CLVM, therefore modifying the OpenNebula Volume Group in one host will reflect in the others. There is a special list of hosts (BRIDGE_LIST) which belong to the LVM cluster, that will be the ones OpenNebula uses to speak to when doing LVM operations.
LVM must be available in the Hosts. The oneadmin
user should be able to execute several LVM related commands with sudo passwordlessly.
lvremove
, lvcreate
, lvs
, vgdisplay
and dd
.oneadmin
needs to belong to the disk
group (for KVM).
To use LVM drivers, the system datastore will work both with shared
or as ssh
. This sytem datastore will hold only the symbolic links to the block devices, so it will not take much space. See more details on the System Datastore Guide
It will also be used to hold context images and Disks created on the fly, they will be created as regular files.
The first step to create a LVM datastore is to set up a template file for it. In the following table you can see the supported configuration attributes. The datastore type is set by its drivers, in this case be sure to add DS_MAD=lvm
and TM_MAD=lvm
for the transfer mechanism, see below.
Attribute | Description |
---|---|
NAME | The name of the datastore |
DS_MAD | Must be lvm |
TM_MAD | Must be lvm |
DISK_TYPE | Must be block |
BRIDGE_LIST | List of LVM server hosts (any of them since it assumes they have CLVM). |
VG_NAME | The LVM volume group name. Defaults to vg-one |
BRIDGE_LIST | Mandatory space separated list of LVM frontends. |
RESTRICTED_DIRS | Paths that can not be used to register images. A space separated list of paths. |
SAFE_DIRS | If you need to un-block a directory under one of the RESTRICTED_DIRS. A space separated list of paths. |
NO_DECOMPRESS | Do not try to untar or decompress the file to be registered. Useful for specialized Transfer Managers |
LIMIT_TRANSFER_BW | Specify the maximum transfer rate in bytes/second when downloading images from a http/https URL. Suffixes K, M or G can be used. |
DATASTORE_CAPACITY_CHECK | If “yes”, the available capacity of the datastore is checked before creating a new image |
For example, the following examples illustrates the creation of an LVM datastore using a configuration file. In this case we will use the host host01
as one of our OpenNebula LVM-enabled hosts.
<xterm>
cat ds.conf
NAME = production DS_MAD = lvm TM_MAD = lvm VG_NAME = vg-one HOST = host01
onedatastore create ds.conf
ID: 100
onedatastore listID NAME CLUSTER IMAGES TYPE TM 0 system none 0 fs shared 1 default none 3 fs shared100 production none 0 lvm shared
</xterm>
The DS and TM MAD can be changed later using the onedatastore update
command. You can check more details of the datastore by issuing the onedatastore show
command.
The hosts must have LVM2 and have the Volume-Group used in the VG_NAME
attributed of the datastore template. CLVM must also be installed and active accross all the hosts that use this datastore.
It's also required to have password-less sudo permission for: lvremove
, lvcreate
, lvs
and dd
.
System administrators and integrators are encouraged to modify these drivers in order to integrate them with their datacenter:
Under /var/lib/one/remotes/
: