[Ceph-client] Add check of target osd value

The PS adds the check of target osd value. The expected amount of OSDs
should be always more or equal to existing OSDs. If there is more OSDs
than expected it means that the value is not correct.

Change-Id: I117a189a18dbb740585b343db9ac9b596a34b929
This commit is contained in:
Kabanov, Dmitrii 2020-07-27 10:44:04 -07:00 committed by Dmitrii Kabanov
parent 3ce0170da8
commit 47ce52a5cf

View File

@ -67,6 +67,11 @@ function check_osd_count() {
EXPECTED_OSDS={{.Values.conf.pool.target.osd}} EXPECTED_OSDS={{.Values.conf.pool.target.osd}}
REQUIRED_PERCENT_OF_OSDS={{.Values.conf.pool.target.required_percent_of_osds}} REQUIRED_PERCENT_OF_OSDS={{.Values.conf.pool.target.required_percent_of_osds}}
if [ ${num_up_osds} -gt ${EXPECTED_OSDS} ]; then
echo "The expected amount of OSDs (${EXPECTED_OSDS}) is less than available OSDs (${num_up_osds}). Please, correct the value (.Values.conf.pool.target.osd)."
exit 1
fi
MIN_OSDS=$(($EXPECTED_OSDS*$REQUIRED_PERCENT_OF_OSDS/100)) MIN_OSDS=$(($EXPECTED_OSDS*$REQUIRED_PERCENT_OF_OSDS/100))
if [ ${MIN_OSDS} -lt 1 ]; then if [ ${MIN_OSDS} -lt 1 ]; then
MIN_OSDS=1 MIN_OSDS=1