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

  • Ceph Cookbook
  • Karan Singh
  • 212字
  • 2021-07-16 13:01:21

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:
主站蜘蛛池模板: 定襄县| 望城县| 右玉县| 平果县| 普定县| 汝城县| 葵青区| 元朗区| 阳江市| 景德镇市| 江北区| 周口市| 南陵县| 尚志市| 玉树县| 昭觉县| 宝丰县| 桑日县| 团风县| 巴彦淖尔市| 张家港市| 安图县| 邵阳市| 扬州市| 高雄市| 江源县| 阳新县| 韩城市| 杨浦区| 龙南县| 海原县| 鄯善县| 怀远县| 辽源市| 平度市| 济宁市| 寿光市| 武夷山市| 河源市| 佛山市| 鄂州市|