Raw Device Mapping (RDM) Datastore¶
The RDM Datastore is an Image Datastore that enables raw access to node block devices.
The datastore should only be usable by the administrators. Letting users create images in this datastore will cause security problems. For example, register an image
/dev/sda and reading the host filesystem.
The RDM Datastore is used to register already existent block devices in the nodes. The devices should be already setup and available and, VMs using these devices must be fixed to run in the nodes ready for them. Additional virtual machine files, like deployment files or volatile disks are created as regular files.
No addtional setup is required.
The devices you want to attach to a VM should be accessible by the hypervisor. As KVM usually runs as oneadmin, make sure this user is in a group with access to the disk (like disk) and has read write permissions for the group.
Once the storage is setup, the OpenNebula configuration comprises two steps:
- Create a System Datastore
- Create an Image Datastore
Create a System Datastore¶
The RDM Datastore can work with the following System Datastores:
- Filesystem, shared transfer mode
- Filesystem, ssh transfer mode
Please refer to the Filesystem Datastore section for more details. Note that the System Datastore is only used for volatile disks and context devices.
Create an Image Datastore¶
To create an Image Datastore you just need to define the name, and set the following:
||The name of the datastore|
An example of datastore:
> cat rdm.conf NAME = rdm_datastore TYPE = "IMAGE_DS" DS_MAD = "dev" TM_MAD = "dev" DISK_TYPE = "BLOCK" > onedatastore create rdm.conf ID: 101
New images can be added as any other image specifying the path. If you are using the CLI do not use the shorthand parameters as the CLI check if the file exists and the device most provably won’t exist in the frontend. As an example here is an image template to add a node disk
NAME=scsi_device PATH=/dev/sdb PERSISTENT=YES
As this datastore does is just a container for existing devices images does not take any size from it. All devices registered will render size of 0 and the overall devices datastore will show up with 1MB of available space