From 1ad5857957935cc6198a78e27a3ffd58d0913239 Mon Sep 17 00:00:00 2001 From: "Venkata, Krishna (kv988c)" Date: Tue, 21 May 2019 15:34:48 -0500 Subject: [PATCH] Fetch Total_OSD value from ceph-client/values.yaml Change-Id: I6af79af0627f85550655f5066dd6278bf0b5365a --- ceph-client/templates/bin/pool/_init.sh.tpl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ceph-client/templates/bin/pool/_init.sh.tpl b/ceph-client/templates/bin/pool/_init.sh.tpl index 8212c0034..9e4b7ff25 100644 --- a/ceph-client/templates/bin/pool/_init.sh.tpl +++ b/ceph-client/templates/bin/pool/_init.sh.tpl @@ -115,12 +115,7 @@ function manage_pool () { TARGET_PG_PER_OSD=$5 POOL_CRUSH_RULE=$6 POOL_PROTECTION=$7 - TOTAL_OSDS=$(ceph --cluster "${CLUSTER}" osd ls | wc -l) - if (ceph --cluster "${CLUSTER}" osd crush rule dump "${POOL_CRUSH_RULE}" | awk '/item_name/' | grep -q ssd); then - TOTAL_OSDS=$(ceph --cluster "${CLUSTER}" osd tree | grep "ssd" | wc -l) - elif (ceph --cluster "${CLUSTER}" osd crush rule dump "${POOL_CRUSH_RULE}" | awk '/item_name/' | grep -q hdd); then - TOTAL_OSDS=$(ceph --cluster "${CLUSTER}" osd tree | grep "hdd" | wc -l) - fi + TOTAL_OSDS={{.Values.conf.pool.target.osd}} POOL_PLACEMENT_GROUPS=$(/tmp/pool-calc.py ${POOL_REPLICATION} ${TOTAL_OSDS} ${TOTAL_DATA_PERCENT} ${TARGET_PG_PER_OSD}) create_pool "${POOL_APPLICATION}" "${POOL_NAME}" "${POOL_REPLICATION}" "${POOL_PLACEMENT_GROUPS}" "${POOL_CRUSH_RULE}" "${POOL_PROTECTION}" }