Cinder Multiple Backends

Configure multiple Cinder storage backends by editing cinder.conf, creating volume types, and mapping them to specific drivers.

Cinder Multiple Backends

Cinder routes volume requests to specific storage backends by matching the volume_backend_name property of the requested volume type.

Prerequisites

  • OpenStack 2024.2 (Dalmatian) with Cinder services running.
  • LVM Volume Group cinder-volumes created on local SSD.
  • Ceph cluster running with volumes RBD pool and cinder user created.
  • NFS server exporting /export/cinder to the storage node subnet.
  • Ceph secret UUID generated and stored in /etc/cinder/ceph-secret.

Step 1: Configure Backends in cinder.conf

Edit /etc/cinder/cinder.conf on the storage node to define enabled_backends and driver sections.

[DEFAULT]
enabled_backends = lvm-ssd,ceph-rbd,nfs-bulk
default_volume_type = ceph
auth_strategy = keystone
scheduler_drivers = cinder.scheduler.drivers.WeightedScheduler

# ---- LVM SSD Backend ----
[lvm-ssd]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
target_protocol = iscsi
target_helper = lioadm
volume_backend_name = ssd-storage
volume_type_driver = cinder.volume.drivers.lvm.LVMVolumeTypeDriver

# ---- Ceph RBD Backend ----
[ceph-rbd]
volume_driver = cinder.volume.drivers.rbd.RBDDriver
rbd_pool = volumes
rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_user = cinder
rbd_secret_uuid = 457eb676-33da-42ec-9a8c-9293d545c337
rbd_flatten_volume_from_snapshot = false
rbd_max_clone_depth = 3
volume_backend_name = ceph-storage
rbd_clone_format = 2

# ---- NFS Backend ----
[nfs-bulk]
volume_driver = cinder.volume.drivers.nfs.NfsDriver
nfs_shares_config = /etc/cinder/nfs_shares
nfs_mount_point_base = /var/lib/cinder/nfs
nas_secure_file_operations = false
nas_secure_file_permissions = false
volume_backend_name = nfs-storage
enable_snapshot = false

Create the NFS shares configuration file:

echo "10.0.0.50:/export/cinder" | sudo tee /etc/cinder/nfs_shares
sudo chown cinder:cinder /etc/cinder/nfs_shares
sudo chmod 640 /etc/cinder/nfs_shares

Ensure the Ceph secret file exists and is readable by the cinder user:

sudo chown cinder:cinder /etc/cinder/ceph-secret
sudo chmod 640 /etc/cinder/ceph-secret

Step 2: Create and Associate Volume Types

Create volume types and bind them to the backend names defined in cinder.conf.

source openrc admin admin

# Create volume types
openstack volume type create ssd
openstack volume type create ceph
openstack volume type create nfs

# Associate types with backend names
openstack volume type set ssd --property volume_backend_name=ssd-storage
openstack volume type set ceph --property volume_backend_name=ceph-storage
openstack volume type set nfs --property volume_backend_name=nfs-storage

# Verify properties
openstack volume type show ssd

Step 3: Restart Cinder Services

Restart the volume service to load the new configuration and clear the scheduler cache.

sudo systemctl restart cinder-volume
sudo systemctl restart cinder-scheduler

Verify all backends are active and reporting:

openstack volume service list --host <storage-node>

Step 4: Test Volume Creation

Create volumes specifying the type to force placement on the correct backend.

# Create 10GB SSD volume
openstack volume create --size 10 --type ssd fast-vol

# Create 50GB Ceph volume
openstack volume create --size 50 --type ceph distributed-vol

# Create 100GB NFS volume
openstack volume create --size 100 --type nfs bulk-vol

# Verify status and backend assignment
openstack volume list

Check the cinder-volume logs to confirm the driver selected:

sudo journalctl -u cinder-volume -f | grep "Volume created"

Step 5: Set Default Volume Type

Mark the type as public and set it as the default via CLI.

# Mark the type as public (required for default)
openstack volume type set --property is_public=true ceph

# Set the default via CLI
cinder type-default ceph

Using QoS Policies

Apply I/O limits to specific volume types using QoS policies.

# Create a QoS policy
openstack volume qos create high-iops \
  --consumer front-end \
  --property total_iops_sec=5000 \
  --property total_bytes_sec=209715200

# Associate policy with the SSD volume type
openstack volume qos associate high-iops ssd

# Verify association
openstack volume qos show high-iops

Troubleshooting

  • Volume stuck in creating: Check cinder-volume logs: sudo journalctl -u cinder-volume -f for driver-specific errors.
  • Wrong backend selected: Verify volume_backend_name in cinder.conf matches the volume type property exactly.
  • NFS mount fails: Verify NFS exports (showmount -e 10.0.0.50) and check /var/log/messages for mount errors.
  • Ceph auth error: Ensure rbd_secret_uuid in cinder.conf matches the UUID in /etc/cinder/ceph-secret.
  • Scheduler ignores backend: Ensure enabled_backends in [DEFAULT] includes all backend names and restart cinder-scheduler.