The Cinder program of OpenStack provides block storage to virtual machines. In this recipe, we will configure OpenStack Cinder to use Ceph as a storage backend. OpenStack Cinder requires a driver to interact with the Ceph block device. On the OpenStack node, edit the /etc/cinder/cinder.conf
configuration file by adding the code snippet given in the following section.
In the last recipe, we learned to configure glance to use Ceph. In this recipe, we will learn to use the Ceph RBD with the Cinder service of OpenStack:
enabled_backends
option from the /etc/cinder/cinder.conf
file:/etc/cinder/cinder.conf
file and add the following (replace the secret uuid
with your environments value):volume_driver = cinder.volume.drivers.rbd.RBDDriver rbd_pool = volumes rbd_user = cinder rbd_secret_uuid = bb90381e-a4c5-4db7-b410-3154c4af486e rbd_ceph_conf = /etc/ceph/ceph.conf rbd_flatten_volume_from_snapshot = false rbd_max_clone_depth = 5 rbd_store_chunk_size = 4 rados_connect_timeout = -1 glance_api_version = 2
# cat /etc/cinder/cinder.conf | egrep "rbd|rados|version" | grep -v "#"
# service openstack-cinder-volume restart
keystone_admin
files for OpenStack:# source /root/keystonerc_admin # cinder list
# cinder create --display-name ceph-volume01 --display-description "Cinder volume on CEPH storage" 2
# cinder list # rados -p volumes --name client.cinder --keyring ceph.client.cinder.keyring ls | grep -i id
3.137.217.95