The above two sets of instructions are helpful. Following them can almost get things right, except the following two things:
-
configuring cephx authentication
The
virsh
commands for setting up security key and value should be done withroot
. Running it just usingoneadmin
account will cause the error:error: internal error rbd username 'libvirt' specified but secret not found
-
The qemu-kvm package should be built to support rbd, one can check it with the command
$ qemu-img -h
and look at the very bottom of the output, mentioning the supported formats.
If the
rbd
format is not in the list, for CentOS systems, one could update theqemu-kvm
RPM package using the ovirt repository.
-
It seems that the VM image in ceph datastore has to be in 'raw' format.
When the image is imported from OpenNebula marketplace, it is set to use format qcow2. This may cause the VM initialization to fail with error:
could not open disk image rbd:one/one-17-56-0:id=libvirt:key=xxxxxxxxxxxxxxxxxxxxxx==:auth_supported=cephx\;none:mon_host=dccn-c005\:6789\;dccn-c035\:6789: Invalid argument
Sometimes, it's necessary to resize VM image.
-
shutdown the VMs that are using the image.
-
On the RBD level, use the following command to change the RBD size
$ rbd --pool one --image one-21 resize --size 524288
-
restart the VMs
Note that the image metadata in OpenNebula is not changed ... this due to the fact that the image resizing feature is not yet supported. See this post in which some community patches are available.
Through qemu-img
and virsh
commands, it's also possible to resize image size at the VM runtime.
See this wiki for the instructions.