cinder: Allow configuring backend_name for Ceph backends

This commit introduces the ability to configure `backend_name` for Ceph
backends in Cinder. Previously, `volume_backend_name` was directly set
to `name`, but in some cases, it is necessary to use a different backend name.

Benefits of this change:
- Provides flexibility in naming backends without modifying `name`.
- Allows uniform configuration in environments with multiple Ceph clusters.
- Maintains backward compatibility – if `backend_name` is not defined,
  it defaults to `name`, ensuring the same behavior as before.

This change is particularly useful in multi-AZ deployments where backend
names may differ, but Cinder scheduling requires a consistent identifier.

Additionally, this separation between `name` and `backend_name` is useful when
the same storage type is shared across multiple zones, as it allows defining a
common backend name while keeping distinct configurations for each AZ.

Change-Id: I6ea35de42abf7e865337e85dc1807dd2ee6afe25
This commit is contained in:
Michal Arbet 2025-02-03 12:28:16 +01:00
parent 3300fb7010
commit e39e46a86b
3 changed files with 8 additions and 1 deletions
ansible/roles/cinder
defaults
templates
releasenotes/notes

@ -270,6 +270,7 @@ cinder_backend_pure_nvme_tcp_name: "Pure-FlashArray-nvme-tcp"
cinder_ceph_backends:
- name: "{{ cinder_backend_ceph_name }}"
backend_name: "{{ cinder_backend_ceph_name }}"
cluster: "{{ ceph_cluster }}"
user: "{{ ceph_cinder_user }}"
pool: "{{ ceph_cinder_pool_name }}"

@ -156,7 +156,7 @@ target_protocol = iscsi
{% for backend in cinder_ceph_backends %}
[{{ backend.name }}]
volume_driver = cinder.volume.drivers.rbd.RBDDriver
volume_backend_name = {{ backend.name }}
volume_backend_name = {{ backend.backend_name | default(backend.name) }}
rbd_pool = {{ backend.pool }}
rbd_ceph_conf = /etc/ceph/{{ backend.cluster }}.conf
rados_connect_timeout = 5

@ -0,0 +1,6 @@
---
features:
- |
Added support for explicitly setting ``volume_backend_name`` for
Cinder Ceph backends by the new variable ``backend_name`` in
the ``cinder_ceph_backends`` dictionary configuration.