From 575c2885dee5b1de0a51e46ab7f9a23d639bb6ae Mon Sep 17 00:00:00 2001 From: Stephen Taylor Date: Mon, 19 Dec 2022 14:35:58 -0700 Subject: [PATCH] [ceph-client] Fix OSD count checks in the ceph-rbd-pool job This change adjusts the minimum OSD count check to be based on the osd value, and the maxiumum OSD count check to be based on the final_osd value. This logic supports both full deployments and partial deployments, with the caveat that it may allow partial deployments to over-provision storage. Change-Id: I93aac65df850e686f92347d406cd5bb5a803659d --- ceph-client/Chart.yaml | 2 +- ceph-client/templates/bin/pool/_init.sh.tpl | 7 ++++--- releasenotes/notes/ceph-client.yaml | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ceph-client/Chart.yaml b/ceph-client/Chart.yaml index b2a1abce8c..9e5f3a2161 100644 --- a/ceph-client/Chart.yaml +++ b/ceph-client/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph Client name: ceph-client -version: 0.1.39 +version: 0.1.40 home: https://github.com/ceph/ceph-client ... diff --git a/ceph-client/templates/bin/pool/_init.sh.tpl b/ceph-client/templates/bin/pool/_init.sh.tpl index d450b21b61..5da21cee95 100644 --- a/ceph-client/templates/bin/pool/_init.sh.tpl +++ b/ceph-client/templates/bin/pool/_init.sh.tpl @@ -89,11 +89,12 @@ function check_osd_count() { num_in_osds=$(awk '/"num_in_osds"/{print $2}' <<< "$osd_stat" | cut -d, -f1) num_up_osds=$(awk '/"num_up_osds"/{print $2}' <<< "$osd_stat" | cut -d, -f1) - EXPECTED_OSDS={{.Values.conf.pool.target.final_osd}} + EXPECTED_OSDS={{.Values.conf.pool.target.osd}} + EXPECTED_FINAL_OSDS={{.Values.conf.pool.target.final_osd}} REQUIRED_PERCENT_OF_OSDS={{.Values.conf.pool.target.required_percent_of_osds}} - if [ ${num_up_osds} -gt ${EXPECTED_OSDS} ]; then - echo "More running OSDs (${num_up_osds}) than expected (${EXPECTED_OSDS}). Please correct the expected value (.Values.conf.pool.target.final_osd)." + if [ ${num_up_osds} -gt ${EXPECTED_FINAL_OSDS} ]; then + echo "More running OSDs (${num_up_osds}) than expected (${EXPECTED_FINAL_OSDS}). Please correct the expected value (.Values.conf.pool.target.final_osd)." exit 1 fi diff --git a/releasenotes/notes/ceph-client.yaml b/releasenotes/notes/ceph-client.yaml index 08eab937b8..08fbab0f17 100644 --- a/releasenotes/notes/ceph-client.yaml +++ b/releasenotes/notes/ceph-client.yaml @@ -40,4 +40,5 @@ ceph-client: - 0.1.37 Added OCI registry authentication - 0.1.38 Make use of noautoscale with Pacific - 0.1.39 Correct check for too many OSDs in the pool job + - 0.1.40 Fix OSD count checks in the ceph-rbd-pool job ...