From c38443de4c852e86fb9845777bd67657392835fc Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 28 May 2019 13:21:40 +0200 Subject: [PATCH] cinder: allow configuring the rbd app name Instead of hardcoding it, let us override it with custom values for normal volumes and backups Change-Id: I3abb343877abd0436c592a3371372f82ef581790 --- cinder/templates/bin/_backup-storage-init.sh.tpl | 2 +- cinder/templates/bin/_storage-init.sh.tpl | 2 +- cinder/templates/job-backup-storage-init.yaml | 2 ++ cinder/templates/job-storage-init.yaml | 2 ++ cinder/values.yaml | 4 ++++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cinder/templates/bin/_backup-storage-init.sh.tpl b/cinder/templates/bin/_backup-storage-init.sh.tpl index 52c8e6bf78..af9886ad8b 100644 --- a/cinder/templates/bin/_backup-storage-init.sh.tpl +++ b/cinder/templates/bin/_backup-storage-init.sh.tpl @@ -44,7 +44,7 @@ elif [ "x$STORAGE_BACKEND" == "xcinder.backup.drivers.ceph" ]; then ceph osd pool set $1 nosizechange ${size_protection} ceph osd pool set $1 crush_rule "${RBD_POOL_CRUSH_RULE}" } - ensure_pool ${RBD_POOL_NAME} ${RBD_POOL_CHUNK_SIZE} "cinder-backup" + ensure_pool ${RBD_POOL_NAME} ${RBD_POOL_CHUNK_SIZE} ${RBD_POOL_APP_NAME} if USERINFO=$(ceph auth get client.${RBD_POOL_USER}); then echo "Cephx user client.${RBD_POOL_USER} already exists" diff --git a/cinder/templates/bin/_storage-init.sh.tpl b/cinder/templates/bin/_storage-init.sh.tpl index 9288ec5fd5..bbc3193889 100644 --- a/cinder/templates/bin/_storage-init.sh.tpl +++ b/cinder/templates/bin/_storage-init.sh.tpl @@ -41,7 +41,7 @@ if [ "x$STORAGE_BACKEND" == "xcinder.volume.drivers.rbd.RBDDriver" ]; then ceph osd pool set $1 nosizechange ${size_protection} ceph osd pool set $1 crush_rule "${RBD_POOL_CRUSH_RULE}" } - ensure_pool ${RBD_POOL_NAME} ${RBD_POOL_CHUNK_SIZE} "cinder-volume" + ensure_pool ${RBD_POOL_NAME} ${RBD_POOL_CHUNK_SIZE} ${RBD_POOL_APP_NAME} if USERINFO=$(ceph auth get client.${RBD_POOL_USER}); then echo "Cephx user client.${RBD_POOL_USER} already exist." diff --git a/cinder/templates/job-backup-storage-init.yaml b/cinder/templates/job-backup-storage-init.yaml index dd833ba3f5..988aa9535c 100644 --- a/cinder/templates/job-backup-storage-init.yaml +++ b/cinder/templates/job-backup-storage-init.yaml @@ -111,6 +111,8 @@ spec: {{- if eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph" }} - name: RBD_POOL_NAME value: {{ .Values.conf.cinder.DEFAULT.backup_ceph_pool | quote }} + - name: RBD_POOL_APP_NAME + value: {{ .Values.conf.software.rbd.rbd_pool_app_name_backup | quote }} - name: RBD_POOL_USER value: {{ .Values.conf.cinder.DEFAULT.backup_ceph_user | quote }} - name: RBD_POOL_CRUSH_RULE diff --git a/cinder/templates/job-storage-init.yaml b/cinder/templates/job-storage-init.yaml index 796de5b3e5..7a0cae06bd 100644 --- a/cinder/templates/job-storage-init.yaml +++ b/cinder/templates/job-storage-init.yaml @@ -102,6 +102,8 @@ spec: value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "volume_driver" | quote }} - name: RBD_POOL_NAME value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "rbd_pool" | quote }} + - name: RBD_POOL_APP_NAME + value: {{ .Values.conf.software.rbd.rbd_pool_app_name | quote }} - name: RBD_POOL_USER value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "rbd_user" | quote }} - name: RBD_POOL_CRUSH_RULE diff --git a/cinder/values.yaml b/cinder/values.yaml index e05f2b17a2..ff571fa063 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -304,6 +304,10 @@ ceph_client: user_secret_name: pvc-ceph-client-key conf: + software: + rbd: + rbd_pool_app_name_backup: cinder-backup + rbd_pool_app_name: cinder-volume paste: composite:osapi_volume: use: call:cinder.api:root_app_factory