官术网_书友最值得收藏!

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:
主站蜘蛛池模板: 靖远县| 清镇市| 闵行区| 新蔡县| 信丰县| 磴口县| 巴南区| 天台县| 申扎县| 冷水江市| 富阳市| 伽师县| 郧西县| 临澧县| 宁强县| 南城县| 封丘县| 土默特右旗| 安龙县| 海伦市| 左贡县| 龙山县| 马公市| 五大连池市| 柘荣县| 大兴区| 宁德市| 滦南县| 金秀| 长武县| 柳江县| 阜阳市| 东山县| 凌源市| 讷河市| 临西县| 漾濞| 昌吉市| 山东省| 铜陵市| 时尚|