From 92b54f8352de062eff59b9407f866ae5b95621b0 Mon Sep 17 00:00:00 2001 From: Irina Mihai Date: Mon, 4 Feb 2019 19:53:32 +0000 Subject: [PATCH] Support rbd pool replication and crush ruleset for glance - pass new pool replication&crush ruleset parameter to the storage init script - set images pool replication&crush ruleset in the storage init script Change-Id: Idd883d4348a292c0de54c7ee47da98f11f36306f Story: 2004921 Task: 29282 Signed-off-by: Irina Mihai --- glance/templates/bin/_storage-init.sh.tpl | 2 ++ glance/templates/job-storage-init.yaml | 4 ++++ glance/values.yaml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/glance/templates/bin/_storage-init.sh.tpl b/glance/templates/bin/_storage-init.sh.tpl index 4b6de3c85d..5a9572faf0 100644 --- a/glance/templates/bin/_storage-init.sh.tpl +++ b/glance/templates/bin/_storage-init.sh.tpl @@ -47,6 +47,8 @@ elif [ "x$STORAGE_BACKEND" == "xrbd" ]; then if [[ ${test_version} -gt 0 ]]; 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}" } ensure_pool "${RBD_POOL_NAME}" "${RBD_POOL_CHUNK_SIZE}" "glance-image" diff --git a/glance/templates/job-storage-init.yaml b/glance/templates/job-storage-init.yaml index f6e767dc20..f9e1123951 100644 --- a/glance/templates/job-storage-init.yaml +++ b/glance/templates/job-storage-init.yaml @@ -104,6 +104,10 @@ spec: value: {{ .Values.conf.glance.glance_store.rbd_store_pool | quote }} - name: RBD_POOL_USER value: {{ .Values.conf.glance.glance_store.rbd_store_user | quote }} + - name: RBD_POOL_REPLICATION + value: {{ .Values.conf.glance.glance_store.rbd_store_replication | quote }} + - name: RBD_POOL_CRUSH_RULE + value: {{ .Values.conf.glance.glance_store.rbd_store_crush_rule | quote }} - name: RBD_POOL_CHUNK_SIZE value: {{ .Values.conf.glance.glance_store.rbd_store_chunk_size | quote }} - name: RBD_POOL_SECRET diff --git a/glance/values.yaml b/glance/values.yaml index 1951557a34..1069f61fa8 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -275,6 +275,8 @@ conf: memcache_security_strategy: ENCRYPT glance_store: rbd_store_chunk_size: 8 + rbd_store_replication: 3 + rbd_store_crush_rule: replicated_rule rbd_store_pool: glance.images rbd_store_user: glance rbd_store_ceph_conf: /etc/ceph/ceph.conf