From 2002b9368dc8f3f9d9737803c147534ae3e5258c Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Tue, 4 May 2021 11:45:07 +0000 Subject: [PATCH] [CEPH] Fix the ceph pool creations for openstack services This is to fix the ceph version checks for enabling the applications on newly created pools for openstack services like cinder and glance. Change-Id: I2c007f728180cf7753255463ebf2f8dc5dc6fa5b --- cinder/Chart.yaml | 2 +- cinder/templates/bin/_backup-storage-init.sh.tpl | 5 ++--- cinder/templates/bin/_storage-init.sh.tpl | 5 ++--- glance/Chart.yaml | 2 +- glance/templates/bin/_storage-init.sh.tpl | 5 ++--- releasenotes/notes/cinder.yaml | 1 + releasenotes/notes/glance.yaml | 1 + 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cinder/Chart.yaml b/cinder/Chart.yaml index 7c47173ee8..18cfb5ea49 100644 --- a/cinder/Chart.yaml +++ b/cinder/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Cinder name: cinder -version: 0.2.0 +version: 0.2.1 home: https://docs.openstack.org/cinder/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Cinder/OpenStack_Project_Cinder_vertical.png sources: diff --git a/cinder/templates/bin/_backup-storage-init.sh.tpl b/cinder/templates/bin/_backup-storage-init.sh.tpl index 9f30f0b14c..cd2389c211 100644 --- a/cinder/templates/bin/_backup-storage-init.sh.tpl +++ b/cinder/templates/bin/_backup-storage-init.sh.tpl @@ -32,9 +32,8 @@ elif [[ $STORAGE_BACKEND =~ 'cinder.backup.drivers.ceph' ]]; then ceph -s function ensure_pool () { ceph osd pool stats $1 || ceph osd pool create $1 $2 - local test_version=$(ceph tell osd.* version | egrep -c "nautilus|mimic|luminous" | xargs echo) - if [[ ${test_version} -gt 0 ]]; then - ceph osd pool application enable $1 $3 + if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 12 ]]; then + ceph osd pool application enable $1 $3 fi size_protection=$(ceph osd pool get $1 nosizechange | cut -f2 -d: | tr -d '[:space:]') ceph osd pool set $1 nosizechange 0 diff --git a/cinder/templates/bin/_storage-init.sh.tpl b/cinder/templates/bin/_storage-init.sh.tpl index fd315edb16..a43115e423 100644 --- a/cinder/templates/bin/_storage-init.sh.tpl +++ b/cinder/templates/bin/_storage-init.sh.tpl @@ -29,9 +29,8 @@ if [ "x$STORAGE_BACKEND" == "xcinder.volume.drivers.rbd.RBDDriver" ]; then ceph -s function ensure_pool () { ceph osd pool stats $1 || ceph osd pool create $1 $2 - local test_version=$(ceph tell osd.* version | egrep -c "nautilus|mimic|luminous" | xargs echo) - if [[ ${test_version} -gt 0 ]]; then - ceph osd pool application enable $1 $3 + if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 12 ]]; then + ceph osd pool application enable $1 $3 fi size_protection=$(ceph osd pool get $1 nosizechange | cut -f2 -d: | tr -d '[:space:]') ceph osd pool set $1 nosizechange 0 diff --git a/glance/Chart.yaml b/glance/Chart.yaml index 814af5ec49..de8f110ee8 100644 --- a/glance/Chart.yaml +++ b/glance/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Glance name: glance -version: 0.2.0 +version: 0.2.1 home: https://docs.openstack.org/glance/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Glance/OpenStack_Project_Glance_vertical.png sources: diff --git a/glance/templates/bin/_storage-init.sh.tpl b/glance/templates/bin/_storage-init.sh.tpl index 18fdf81d14..cf6fecbf13 100644 --- a/glance/templates/bin/_storage-init.sh.tpl +++ b/glance/templates/bin/_storage-init.sh.tpl @@ -46,9 +46,8 @@ elif [ "x$STORAGE_BACKEND" == "xrbd" ]; then function ensure_pool () { ceph osd pool stats "$1" || ceph osd pool create "$1" "$2" local test_version - test_version=$(ceph tell osd.* version | egrep -c "nautilus|mimic|luminous" | xargs echo) - if [[ ${test_version} -gt 0 ]]; then - ceph osd pool application enable "$1" "$3" + if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 12 ]]; then + ceph osd pool application enable $1 $3 fi ceph osd pool set "$1" size "${RBD_POOL_REPLICATION}" ceph osd pool set "$1" crush_rule "${RBD_POOL_CRUSH_RULE}" diff --git a/releasenotes/notes/cinder.yaml b/releasenotes/notes/cinder.yaml index fec4003543..0da9eeb55c 100644 --- a/releasenotes/notes/cinder.yaml +++ b/releasenotes/notes/cinder.yaml @@ -17,3 +17,4 @@ cinder: - 0.1.14 Add Multipathd support for ISCSI backed volumes - 0.1.15 Fix the problem in hostNetwork mode - 0.2.0 Remove support for releases before T + - 0.2.1 Fix the ceph pool creations for openstack services diff --git a/releasenotes/notes/glance.yaml b/releasenotes/notes/glance.yaml index 5d7f0bcb39..93f6692cd6 100644 --- a/releasenotes/notes/glance.yaml +++ b/releasenotes/notes/glance.yaml @@ -10,3 +10,4 @@ glance: - 0.1.7 Update storage init script with cacert - 0.1.8 Update glance default policy values - 0.2.0 Remove support for releases before T + - 0.2.1 Fix the ceph pool creations for openstack services