The VMware Datastore 3.4
The VMware datastore lets you store VM images to be used with the VMware hypervisor family. The VMware datastore is an specialized version of the Filesystem datastore that deals with the vmdk
format. Considerations are also need to be taken into account regarding the system datastore, since compatibility must be ensured between the system datastore and all the registered datastores.
Most of the datastore operations are performed remotely on the ESX servers, but there are some actions that are performed in the OpenNebula front-end. Most of these operations use standard filesystem commands, with the exception of:
In order to use the VMware datastore, the ESX servers need to have the SSH access configured for the oneadmin account. There are no other requirements for any of the transfer methods described below.
There are two possible choices of transfer drivers for the system datastore:
/var/lib/one/datastores/0
), under the name “0”. onedatastore update 0
) to set the TM_MAD drivers to ssh
. The ESX nodes need to mount a local datastore with the name “0”.
If the system datastore wants to be mounted under any other name, this must be changed in /etc/one/vmm_exec/vmm_exec_vmware.conf
. More details in the System Datastore Guide.
The first step to create a VMware 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=vmware
.
The other important attribute to configure the datastore is the transfer drivers. These drivers determine how the images are accessed in the hosts. The VMware datastore can use shared, ssh and vmware. See below for more details.
Attribute | Description |
---|---|
NAME | The name of the datastore |
DS_MAD | The DS type, use vmware for the VMware datastore |
TM_MAD | Transfer drivers for the datastore: shared , ssh or vmware , see below |
DISK_TYPE | Type for the VM disks using images from this datastore. Supported values are: block , file |
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. |
UMASK | Default mask for the files created in the datastore. Defaults to 0007 |
For example, the following illustrates the creation of a VMware datastore using the shared transfer drivers. <xterm>
cat ds.conf
NAME = production DS_MAD = vmware TM_MAD = shared
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 vmware shared
</xterm>
You can check more details of the datastore by issuing the onedatastore show
command.
Finally, you have to prepare the storage for the datastore and configure the hosts to access it. This depends on the transfer mechanism you have chosen for your datastore.
For a general description of how this transfer mechanism works, please refer to the Filesystem Datastore guide.
The datastore should be exported with the appropriate flags so the files created by the VMware hypervisor can be managed by OpenNebula. An example of a configuration line in /etc/exports
of the NFS server:
/var/lib/one 192.168.1.0/24(rw,sync,no_subtree_check,root_squash,anonuid=9001,anongid=9001)
where 9001 is the UID and GID of “oneadmin” user in the front-end.
Each ESX server has to register an NFS datastore using the <datastore_id> as datastore name. For example to make use of the VMware datastore 100, exported by the server san.opennebula.org
you should add network filesystem as:
You also have to mount the datastore in the front-end in /var/lib/one/datastores/<datastore_id>
.
Since the VMware virtualization drivers require passwordless ssh connection from the front-end to the ESX nodes using the oneadmin user (see this for more information), using a SSH Transfer Driver based VMware Datastore.
The vmware driver is a specialization of the shared drivers to work with the VMware vmdk filesystem tools. The same features/restrictions and configuration applies so be sure to read the shared driver section.
The difference with the shared drivers is that the “vmkfstool” command is used, which specializes in VMFS. This comes with a number of advantages, like FS locking, easier VMDK cloning, format management, etc.
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>