How to do it…

This recipe deals with configuring Nova to store the entire virtual machines on the Ceph RBD:

  1. Navigate to the [libvirt] section and add the following:
        inject_partition=-2
images_type=rbd
images_rbd_pool=vms
images_rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=cinder
rbd_secret_uuid= e279566e-bc97-46d0-bd90-68080a2a0ad8
  1. Verify your changes:
        # cat /etc/nova/nova.conf|egrep "rbd|partition" | grep -v "#"
  1. Restart the OpenStack Nova services:
        # service openstack-nova-compute restart
  1. To boot a virtual machine in Ceph, the Glance image format must be RAW. We will use the same cirros image that we downloaded earlier in this chapter and convert this image from the QCOW to the RAW format (this is important). You can also use any other image, as long as it's in the RAW format:
# qemu-img convert -f qcow2 -O raw cirros-0.3.1-x86_64-disk.img cirros-0.3.1-x86_64-disk.raw
  1. Create a Glance image using a RAW image:
        # glance image-create --name cirros_raw_image 
--is-public=true --disk-format=raw
--container-format=bare < cirros-0.3.1-x86_64-disk.raw
  1. To test the boot from the Ceph volume feature, create a bootable volume:
        # nova image-list
# cinder create --image-id 78e1fd35-aa65-447b-954e-1b072e9a17ec
--display-name cirros-ceph-boot-volume 1
  1. List Cinder volumes to check if the bootable field is true:
        # cinder list
  1. Now, we have a bootable volume, which is stored on Ceph, so let's launch an instance with this volume:
    1. We have a known issue with qemu-kvm package which is causing nova boot to fail:
                Log - "libvirtError: internal error: process exited
while connecting to monitor: ... Unknown protocol"
    1. We have the following packages installed in the os-node1 VM which have this issue:
                qemu-kvm-1.5.3-60.el7_0.11.x86_64
qemu-kvm-common-1.5.3-60.el7_0.11.x86_64
qemu-img-1.5.3-60.el7_0.11.x86_64
    1. Please upgrade the qemu-kvm, qemu-kvm-common and qemu-img packages:
                $ yum update qemu-kvm qemu-img -y
    1. It will install the following packages:
                qemu-kvm-common-1.5.3-141.el7_4.2.x86_64
qemu-kvm-1.5.3-141.el7_4.2.x86_64
qemu-img-1.5.3-141.el7_4.2.x86_64

                # nova boot --flavor 1 --block_device_mapping
vda=d3a3eb50-6b3a-4a93-b90c-b17d01e10b64::0
--image 78e1fd35-aa65-447b-954e-1b072e9a17ec
vm2_on_ceph
--block_device_mapping vda = <cinder bootable
volume id >
--image = <Glance image associated with the bootable
volume>
  1. Finally, check the instance status:
        # nova list
  1. At this point, we have an instance running from a Ceph volume. Let's do a boot from image:
        # nova boot --flavor 1 
--image 78e1fd35-aa65-447b-954e-1b072e9a17ec
vm1_on_ceph
  1. Finally, check the instance status:
        # nova list
  1. Check if the instance is stored in Ceph:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset