From 0fe8010c887550a41774ec57d3628c626a8eb3be Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Fri, 12 Aug 2022 17:42:59 +0100 Subject: [PATCH] Introduce variables for cinder backend names This allows you to use a more descriptive name if you desire. For example, when using cinder with multiple ceph backends, rbd-1, doesn't convey much information. You could include location, disk technology, etc. in the name. Change-Id: Icfdc2e5726fec8b645d6c2c63391a13c31f2ce9a --- ansible/roles/cinder/defaults/main.yml | 28 ++++++---- ansible/roles/cinder/templates/cinder.conf.j2 | 25 +++++---- doc/source/reference/storage/cinder-guide.rst | 52 +++++++++++++++++++ ...ckend-name-variables-edcc4a675ca06c0c.yaml | 8 +++ 4 files changed, 91 insertions(+), 22 deletions(-) create mode 100644 releasenotes/notes/add-cinder-backend-name-variables-edcc4a675ca06c0c.yaml diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index 48a46318fa..61b60f39b5 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -226,25 +226,35 @@ cinder_rpc_version_startup_delay: 30 # Cinder #################### cinder_backends: - - name: "rbd-1" + - name: "{{ cinder_backend_ceph_name }}" enabled: "{{ cinder_backend_ceph | bool }}" - - name: "lvm-1" + - name: "{{ cinder_backend_lvm_name }}" enabled: "{{ enable_cinder_backend_lvm | bool }}" - - name: "nfs-1" + - name: "{{ cinder_backend_nfs_name }}" enabled: "{{ enable_cinder_backend_nfs | bool }}" - - name: "hnas-nfs" + - name: "{{ cinder_backend_hnas_nfs_name }}" enabled: "{{ enable_cinder_backend_hnas_nfs | bool }}" - - name: "vmwarevc-vmdk" + - name: "{{ cinder_backend_vmwarevc_vmdk_name }}" enabled: "{{ cinder_backend_vmwarevc_vmdk | bool }}" - - name: "vmware-vstorage-object" + - name: "{{ cinder_backend_vmware_vstorage_object_name }}" enabled: "{{ cinder_backend_vmware_vstorage_object | bool }}" - - name: "QuobyteHD" + - name: "{{ cinder_backend_quobyte_name }}" enabled: "{{ enable_cinder_backend_quobyte | bool }}" - - name: "Pure-FlashArray-iscsi" + - name: "{{ cinder_backend_pure_iscsi_name }}" enabled: "{{ enable_cinder_backend_pure_iscsi | bool }}" - - name: "Pure-FlashArray-fc" + - name: "{{ cinder_backend_pure_fc_name }}" enabled: "{{ enable_cinder_backend_pure_fc | bool }}" +cinder_backend_ceph_name: "rbd-1" +cinder_backend_lvm_name: "lvm-1" +cinder_backend_nfs_name: "nfs-1" +cinder_backend_hnas_nfs_name: "hnas-nfs" +cinder_backend_vmwarevc_vmdk_name: "vmwarevc-vmdk" +cinder_backend_vmware_vstorage_object_name: "vmware-vstorage-object" +cinder_backend_quobyte_name: "QuobyteHD" +cinder_backend_pure_iscsi_name: "Pure-FlashArray-iscsi" +cinder_backend_pure_fc_name: "Pure-FlashArray-fc" + skip_cinder_backend_check: False cinder_enabled_backends: "{{ cinder_backends | selectattr('enabled', 'equalto', true) | list }}" diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 355b53696f..61019537ff 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -118,20 +118,19 @@ memcached_servers = {% for host in groups['memcached'] %}{{ 'api' | kolla_addres [oslo_concurrency] lock_path = /var/lib/cinder/tmp - {% if enable_cinder_backend_lvm | bool %} -[lvm-1] +[{{ cinder_backend_lvm_name }}] volume_group = {{ cinder_volume_group }} volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver -volume_backend_name = lvm-1 +volume_backend_name = {{ cinder_backend_lvm_name }} target_helper = {{ cinder_target_helper }} target_protocol = iscsi {% endif %} {% if cinder_backend_ceph | bool %} -[rbd-1] +[{{ cinder_backend_ceph_name }}] volume_driver = cinder.volume.drivers.rbd.RBDDriver -volume_backend_name = rbd-1 +volume_backend_name = {{ cinder_backend_ceph_name }} rbd_pool = {{ ceph_cinder_pool_name }} rbd_ceph_conf = /etc/ceph/ceph.conf rbd_flatten_volume_from_snapshot = false @@ -145,9 +144,9 @@ image_upload_use_cinder_backend = True {% endif %} {% if enable_cinder_backend_nfs | bool %} -[nfs-1] +[{{ cinder_backend_nfs_name }}] volume_driver = cinder.volume.drivers.nfs.NfsDriver -volume_backend_name = nfs-1 +volume_backend_name = {{ cinder_backend_nfs_name }} nfs_shares_config = /etc/cinder/nfs_shares nfs_snapshot_support = True nas_secure_file_permissions = False @@ -155,7 +154,7 @@ nas_secure_file_operations = False {% endif %} {% if enable_cinder_backend_hnas_nfs | bool %} -[hnas-nfs] +[{{ cinder_backend_hnas_nfs_name }}] volume_driver = cinder.volume.drivers.hitachi.hnas_nfs.HNASNFSDriver nfs_shares_config = /home/cinder/nfs_shares volume_backend_name = {{ hnas_nfs_backend }} @@ -168,7 +167,7 @@ hnas_svc0_hdp = {{ hnas_nfs_svc0_hdp }} {% endif %} {% if cinder_backend_vmwarevc_vmdk | bool %} -[vmwarevc-vmdk] +[{{ cinder_backend_vmwarevc_vmdk_name }}] volume_driver = cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver vmware_host_ip = {{ vmware_vcenter_host_ip }} vmware_host_username = {{ vmware_vcenter_host_username }} @@ -178,7 +177,7 @@ vmware_insecure = True {% endif %} {% if cinder_backend_vmware_vstorage_object | bool %} -[vmware-vstorage-object] +[{{ cinder_backend_vmware_vstorage_object_name }}] volume_driver = cinder.volume.drivers.vmware.fcd.VMwareVStorageObjectDriver vmware_host_ip = {{ vmware_vcenter_host_ip }} vmware_host_username = {{ vmware_vcenter_host_username }} @@ -188,13 +187,13 @@ vmware_insecure = True {% endif %} {% if enable_cinder_backend_quobyte | bool %} -[QuobyteHD] +[{{ cinder_backend_quobyte_name }}] volume_driver = cinder.volume.drivers.quobyte.QuobyteDriver quobyte_volume_url = quobyte://{{ quobyte_storage_host }}/{{ quobyte_storage_volume }} {% endif %} {% if enable_cinder_backend_pure_iscsi | bool %} -[Pure-FlashArray-iscsi] +[{{ cinder_backend_pure_iscsi_name }}] volume_backend_name = {{ pure_iscsi_backend }} volume_driver = cinder.volume.drivers.pure.PureISCSIDriver san_ip = {{ pure_san_ip }} @@ -202,7 +201,7 @@ pure_api_token = {{ pure_api_token }} {% endif %} {% if enable_cinder_backend_pure_fc | bool %} -[Pure-FlashArray-fc] +[{{ cinder_backend_pure_fc_name }}] volume_backend_name = {{ pure_fc_backend }} volume_driver = cinder.volume.drivers.pure.PureFCDriver san_ip = {{ pure_san_ip }} diff --git a/doc/source/reference/storage/cinder-guide.rst b/doc/source/reference/storage/cinder-guide.rst index 8181c764e4..56221d322f 100644 --- a/doc/source/reference/storage/cinder-guide.rst +++ b/doc/source/reference/storage/cinder-guide.rst @@ -200,3 +200,55 @@ in Kolla, the following parameter must be specified in ``globals.yml``: All configuration for custom NFS backend should be performed via ``cinder.conf`` in config overrides directory. + +Customizing backend names in cinder.conf +---------------------------------------- + +.. note:: + + This is an advanced configuration option. You cannot change these variables + if you already have volumes that use the old name without additional steps. + Sensible defaults exist out of the box. + +The following variables are available to customise the default backend name +that appears in cinder.conf: + +.. list-table:: Variables to customize backend name + :widths: 50 25 25 + :header-rows: 1 + + * - Driver + - Variable + - Default value + * - Ceph + - cinder_backend_ceph_name + - rbd-1 + * - Logical Volume Manager (LVM) + - cinder_backend_lvm_name + - lvm-1 + * - Network File System (NFS) + - cinder_backend_nfs_name + - nfs-1 + * - Hitachi NAS Platform NFS + - cinder_backend_hnas_nfs_name + - hnas-nfs + * - VMware Virtual Machine Disk File + - cinder_backend_vmwarevc_vmdk_name + - vmwarevc-vmdk + * - VMware VStorage (Object Storage) + - cinder_backend_vmware_vstorage_object_name + - vmware-vstorage-object + * - Quobyte Storage for OpenStack + - cinder_backend_quobyte_name + - QuobyteHD + * - Pure Storage FlashArray for OpenStack (iSCSI) + - cinder_backend_pure_iscsi_name + - Pure-FlashArray-iscsi + * - Pure Storage FlashArray for OpenStack + - cinder_backend_pure_fc_name + - Pure-FlashArray-fc + +These are the names you use when +`configuring `_ +``volume_backend_name`` on cinder volume types. It can sometimes be +useful to provide a more descriptive name. diff --git a/releasenotes/notes/add-cinder-backend-name-variables-edcc4a675ca06c0c.yaml b/releasenotes/notes/add-cinder-backend-name-variables-edcc4a675ca06c0c.yaml new file mode 100644 index 0000000000..308f4696c5 --- /dev/null +++ b/releasenotes/notes/add-cinder-backend-name-variables-edcc4a675ca06c0c.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Adds a set of variables to control the cinder backend name, as used in + cinder.conf. This is the name you use when setting the volume_backend_name + property on volume types. Details are in the + `cinder guide `_ + section of the documentation.