From 1e740816a765d03d39b8aa82996b944afa9c6cd5 Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Thu, 18 Oct 2018 12:48:10 -0700 Subject: [PATCH] Allow pool size change when pools are protected Change-Id: I1ae4c0788288e3d05f009355fe0831259bbd969a --- cinder/templates/bin/_backup-storage-init.sh.tpl | 3 +++ cinder/templates/bin/_storage-init.sh.tpl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cinder/templates/bin/_backup-storage-init.sh.tpl b/cinder/templates/bin/_backup-storage-init.sh.tpl index a932ef39b9..40f3e50df5 100644 --- a/cinder/templates/bin/_backup-storage-init.sh.tpl +++ b/cinder/templates/bin/_backup-storage-init.sh.tpl @@ -38,7 +38,10 @@ elif [ "x$STORAGE_BACKEND" == "xcinder.backup.drivers.ceph" ]; then if [[ ${test_luminous} -gt 0 ]]; 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 ceph osd pool set $1 size ${RBD_POOL_REPLICATION} + 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" diff --git a/cinder/templates/bin/_storage-init.sh.tpl b/cinder/templates/bin/_storage-init.sh.tpl index 9bea1f9c02..bbce6d5401 100644 --- a/cinder/templates/bin/_storage-init.sh.tpl +++ b/cinder/templates/bin/_storage-init.sh.tpl @@ -35,7 +35,10 @@ if [ "x$STORAGE_BACKEND" == "xcinder.volume.drivers.rbd.RBDDriver" ]; then if [[ ${test_luminous} -gt 0 ]]; 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 ceph osd pool set $1 size ${RBD_POOL_REPLICATION} + 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"