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

Configuring Nova to boot instances from Ceph RBD

In order to boot all OpenStack instances into Ceph, that is, for the boot-from-volume feature, we should configure an ephemeral backend for nova. To do this, edit /etc/nova/nova.conf on the OpenStack node and perform the following changes.

How to do it…

This recipe deals with configuring Nova to store 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
  2. Verify your changes:
    # cat /etc/nova/nova.conf|egrep "rbd|partition" | grep -v "#"
    
  3. Restart the OpenStack nova services:
    # service openstack-nova-compute restart
    
  4. 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 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
    
  5. 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
  6. To test the boot from the Ceph volume feature, create a bootable volume:
    # nova image-list
    # cinder create --image-id ff8d9729-5505-4d2a-94ad-7154c6085c97 --display-name cirros-ceph-boot-volume 1
    
  7. List cinder volumes to check if the bootable field is true:
    # cinder list
    
  8. Now, we have a bootable volume, which is stored on Ceph, so let's launch an instance with this volume:
    # nova boot --flavor 1 --block_device_mapping vda=fd56314b-e19b-4129-af77-e6adf229c536::0 --image 964bd077-7b43-46eb-8fe1-cd979a3370df vm2_on_ceph
    --block_device_mapping vda = <cinder bootable volume id >
    --image = <Glance image associated with the bootable volume>
    
  9. Finally, check the instance status:
    # nova list
    
  10. At this point, we have an instance running from a Ceph volume. Try to log in to the instance from the horizon dashboard:
主站蜘蛛池模板: 永定县| 雅安市| 雅江县| 二手房| 马边| 廊坊市| 邢台市| 杭锦后旗| 河曲县| 海晏县| 天水市| 德格县| 永嘉县| 收藏| 汉川市| 绥中县| 疏勒县| 东山县| 镇康县| 集贤县| 大悟县| 伊吾县| 昭通市| 额济纳旗| 平顶山市| 昌平区| 岳阳县| 金昌市| 额敏县| 乐亭县| 二连浩特市| 华阴市| 宣威市| 新疆| 吉水县| 德昌县| 苍溪县| 依兰县| 林西县| 伊宁县| 天门市|