RBD和OpenStack

OpenStack介绍

OpenStack开源的云平台,其中Nova提供虚拟机服务,Glance提供镜像服务,Cinder提供块设备服务。因为OpenStack是Python实现的,因此RBD与OpenStack集成需要安装下面的软件。

  1. apt-get install -y python-ceph

Nova与RBD

修改nova.conf配置文件。

  1. libvirt_images_type=rbd
  2. libvirt_images_rbd_pool=volumes
  3. libvirt_images_rbd_ceph_conf=/etc/ceph/ceph.conf
  4. rbd_user=cinder
  5. rbd_secret_uuid=457eb676-33da-42ec-9a8c-9293d545c337
  6. libvirt_inject_password=false
  7. libvirt_inject_key=false
  8. libvirt_inject_partition=-2

Glance与RBD

修改glance-api.conf配置文件。

  1. default_store=rbd
  2. rbd_store_user=glance
  3. rbd_store_pool=images
  4. show_image_direct_url=True

Cinder与RBD

修改cinder.conf配置文件。

  1. volume_driver=cinder.volume.drivers.rbd.RBDDriver
  2. rbd_pool=volumes
  3. rbd_ceph_conf=/etc/ceph/ceph.conf
  4. rbd_flatten_volume_from_snapshot=false
  5. rbd_max_clone_depth=5
  6. glance_api_version=2
  7. backup_driver=cinder.backup.drivers.ceph
  8. backup_ceph_conf=/etc/ceph/ceph.conf
  9. backup_ceph_user=cinder-backup
  10. backup_ceph_chunk_size=134217728
  11. backup_ceph_pool=backups
  12. backup_ceph_stripe_unit=0
  13. backup_ceph_stripe_count=0
  14. restore_discard_excess_bytes=true