The System Datastore 3.4
The system datastore holds images for running VMs. There is only one system datastore in an OpenNebula installation and it cannot be used to manually register images. OpenNebula automatically copies, moves and deletes images from it as the VMs need them.
The system datastore has always ID 0, and it is located in /var/lib/one/datastores/0
. For each running or stopped VM there is a directory /var/lib/one/datastores/0/<vm_id>
that stores the VM images as disk.0, disk.1… For example the structure of the system datastore with 3 VMs (VM 0 and 2 running, and VM 7 stopped) is:
<xterm>
datastores
</xterm>
There are two steps to configure the system datastore:
/var/lib/one/datastores/0
, e.g. mount the storage device at that location or link it there. The actual size needed for the system datastore depends on the transfer mechanism, see below.
By default the system datastore is configured to use this driver, so you do not need to modify it. The shared transfer driver requires the front-end and hosts to share the system datastore directory. Typically these storage areas are shared using a distributed FS like NFS, GlusterFS, Lustre, etc.
A shared system datastore usually reduces VM deployment times and enables live-migration, but it can also become a bottleneck in your infrastructure and degrade your VMs performance if the virtualized services perform disk-intensive workloads. Usually this limitation may be overcome by:
Each host has to mount the system datastore under $DATASTORE_LOCATION/0
. The value of the DATASTORE_LOCATION
variable is the same for all the hosts and can be defined in oned.conf
file. By default, DATASTORE_LOCATION
points to /var/lib/one/datastores/0
.
In small installations the front-end can be also used to export the system datastore directory to the hosts. Although this deployment is not recommended for medium-large size deployments.
/var/lib/one/datastores/0
In this case the system datastore is distributed among the hosts. The ssh transfer driver uses the hosts' local storage to place the images of running VMs (as opposed to a shared FS in the shared driver). All the operations are then performed locally but images have to be copied always to the hosts, which in turn can be a very resource demanding operation. Also this driver prevents the use of live-migrations between hosts.
To use this driver, you need to update the system datastore: <xterm>
onedatastore update 0
#Edit the file to read as: TM_MAD=ssh </xterm>
There is no special configuration needed to take place to use the ssh drivers for the system datastore. Just be sure that there is enough space under $DATASTORE_LOCATION/0
to hold the images of the VMs that will run in each particular host.
Also be sure that there is space in the frontend under /var/lib/one/datastores/0
to hold the images of the stopped VMs.
Drivers can be easily customized please refer to the specific guide for each datastore driver or to the Storage substystem developer's guide.
However you may find the files you need to modify here:
<DS_DRIVER>
<TM_DRIVER>