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.
To contribute bug patches or new features, you can use the github Pull Request model. It is assumed that code and documentation are contributed under the Apache License 2.0.
More info:
- How to Contribute
- Support: OpenNebula user forum
- Development: OpenNebula developers forum
- Issues Tracking: Github issues (https://github.com/OpenNebula/addon-lvm/issues)
- Leader: Javier Fontan (jfontan@opennebula.org)
This add-on is compatible with OpenNebula >= 4.6.
- Password-less ssh access to an OpenNebula LVM-enabled host.
LVM must be available in the Hosts. The oneadmin
user should be able to execute several LVM related commands with sudo passwordlessly.
- Password-less sudo permission for:
lvremove
,lvcreate
,lvs
,vgdisplay
anddd
. - LVM2
oneadmin
needs to belong to thedisk
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 <system_ds>
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.
The specific attributes for this datastore driver are listed in the following table, you will also need to complete with the common datastore attributes <sm_common_attributes>:
Attribute | Description |
---|---|
DS_MAD |
Must be lvm |
TM_MAD |
Must be lvm |
DISK_TYPE |
Must be block |
VG_NAME |
The LVM volume group name. Defaults to vg-one |
BRIDGE_LIST |
Mandatory space separated list of LVM frontends. |
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.
> cat ds.conf
NAME = production
DS_MAD = lvm
TM_MAD = lvm
VG_NAME = vg-one
BRIDGE_LIST = "host01 host02"
> onedatastore create ds.conf
ID: 100
> onedatastore list
ID NAME CLUSTER IMAGES TYPE TM
0 system none 0 fs shared
1 default none 3 fs shared
100 production none 0 lvm shared
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.
warning
Note that datastores are not associated to any cluster by default, and they are supposed to be accessible by every single host. If you need to configure datastores for just a subset of the hosts take a look to the Cluster guide <cluster_guide>.
After creating a new datastore the LN_TARGET and CLONE_TARGET parameters will be added to the template. These values should not be changed since they define the datastore behaviour. The default values for these parameters are defined in oned.conf <oned_conf> for each driver.
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/
:
- datastore/lvm/lvm.conf: Default values for LVM parameters
- VG_NAME: Default volume group
- DEFAULT_SIZE: Default size of the snapshots
- datastore/lvm/cp: Registers a new image. Creates a new logical volume in LVM.
- datastore/lvm/mkfs: Makes a new empty image. Creates a new logical volume in LVM.
- datastore/lvm/rm: Removes the LVM logical volume.
- tm/lvm/ln: Links to the LVM logical volume.
- tm/lvm/clone: Clones the image by creating a snapshot.
- tm/lvm/mvds: Saves the image in a new LV for SAVE_AS.