Ceph-Client: Wait for inactive pgs in ceph cluster

This is to add wait logic for inactive pgs after adjusting pgs in
manage pool job.

Change-Id: I3353262644ae649ed9f495ac83a2567d9da263ae
This commit is contained in:
Chinasubbareddy Mallavarapu 2019-06-25 10:54:11 -05:00
parent 3384d68c78
commit b69f393b54

View File

@ -31,6 +31,16 @@ if [[ ! -e ${ADMIN_KEYRING} ]]; then
exit 1
fi
function wait_for_inactive_pgs () {
echo "#### Start: Checking for inactive pgs ####"
# Loop until all pgs are active
while [[ `ceph --cluster ${CLUSTER} pg ls | tail -n +2 | grep -v "active+"` ]]
do
sleep 3
done
}
function create_crushrule () {
CRUSH_NAME=$1
CRUSH_RULE=$2
@ -151,3 +161,5 @@ manage_pool {{ .application }} {{ .name }} {{ .replication }} {{ .percent_total_
{{- if .Values.conf.pool.crush.tunables }}
ceph --cluster "${CLUSTER}" osd crush tunables {{ .Values.conf.pool.crush.tunables }}
{{- end }}
wait_for_inactive_pgs