Here, I will explain the Cinder – multi back-end functionality using Ceph as storage back-end.
On Ceph node:
Create a new pool on ceph node using the below commands (more detail how to create a pool -please ref: http://docs.ceph.com/docs/master/rados/operations/placement-groups/
ceph osd pool create volumes1 256
Create a new user with the appropriate rights for cinder to be able to access Ceph’s storage using the following commands on a Ceph node:
ceph auth get-or-create client.volumes1 mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes1, allow rx pool=images'
A keyring file can be created with the following command on a Ceph node and copy the above keyring to cinder-volume nodes.
ceph auth get-or-create client.volumes1 > ceph.client.volumes1.keyring
On Cinder node:
The keyring file created above should be copied on the cinder nodes, in the /etc/ceph/ directory:
Now, update the cinder configuration file
/etc/cinder/cinder.conf by adding the new back-end details. A new back-end as “volumes1” will be added to the
enabled_backends configuration flag:
enabled_backends = former-backend,volumes1
volume_driver = cinder.volume.drivers.rbd.RBDDriver
volume_backend_name = volumes1
rbd_pool = volumes1
glance_api_version = 2
rbd_user = volumes1
rbd_secret_uuid = uuid_of_secret
scheduler_driver parameter is not set to FilterScheduler, it has to be updated:
scheduler_driver = cinder.scheduler.filter_scheduler.FilterScheduler
After updating the configuration file, restart the cinder-volume service, to load the updated configurations:
sudo service cinder-volume restart
Now, create a new volume-type to Cinder, using the below command:
Use ‘admin’ credentials (OS_USERNAME, OS_TENANT_NAME and OS_PASSWORD):
cinder type-create volumes1
cinder type-key volumes1 set volume_backend_name=volumes1
The above command will show all volume types list.
Now, we should be able to create new cinder volumes using new volume type as “volumes1” using “volume1” as a back-end:
cinder create --volume-type volumes1 --display-name test-vol1 1
Note: Misplacing the settings can have dangerous side effects. All settings below the
enabled_backends parameter are actually in some section (eg. [former-volume]) of the conf file rather than [DEFAULT]. Make sure to move the [former-volume] and [volume1] settings to the bottom of the file and so that all other settings are in the [DEFAULT] section.