1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #4249: CEPH monitors store attr might be missing (#4254)

This commit is contained in:
Jan Orel 2020-02-25 11:46:45 +01:00 committed by GitHub
parent 926ec70a29
commit 5235aa8323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,7 +208,8 @@ rbd_rm_r() {
#--------------------------------------------------------------------------------
rbd_df_monitor() {
local monitor_data i j xpath_elements pool_name stored quota_bytes free
local monitor_data i j xpath_elements pool_name
local quota_bytes free bytes_used stored
monitor_data=$1
pool_name=$2
@ -216,13 +217,19 @@ rbd_df_monitor() {
while IFS= read -r -d '' element; do
xpath_elements[i++]="$element"
done < <(echo $monitor_data | $XPATH \
"/stats/pools/pool[name = \"${pool_name}\"]/stats/stored" \
"/stats/pools/pool[name = \"${pool_name}\"]/stats/quota_bytes" \
"/stats/pools/pool[name = \"${pool_name}\"]/stats/max_avail")
"/stats/pools/pool[name = \"${pool_name}\"]/stats/max_avail" \
"/stats/pools/pool[name = \"${pool_name}\"]/stats/bytes_used" \
"/stats/pools/pool[name = \"${pool_name}\"]/stats/stored")
stored="${xpath_elements[j++]:-0}"
quota_bytes="${xpath_elements[j++]:-0}"
free="${xpath_elements[j++]:-0}"
bytes_used="${xpath_elements[j++]:-0}"
stored="${xpath_elements[j++]:-0}"
# https://docs.ceph.com/docs/master/releases/nautilus/
# BYTES USED column renamed to STORED. Represents amount of data stored by the user.
[ $stored = "0" ] && stored=$bytes_used
if [ $quota_bytes -ne 0 ]; then
if [ $quota_bytes -lt $free ]; then