1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

feature #3335: Better compute of TOTAL. Cluster total cannot be used as it does not consider placement rules in the crushmap

This commit is contained in:
Ruben S. Montero 2015-02-25 17:30:35 +01:00
parent 4873ee4284
commit c1a798ae7e

View File

@ -82,16 +82,12 @@ to_mb() {
echo "\$value"
}
REPSIZE=\$($CEPH osd pool get "$POOL_NAME" size | cut -d':' -f2)
MAXAVAIL=\$($CEPH df | grep "$POOL_NAME" | awk '{print \$5}')
USED=\$($CEPH df | grep "$POOL_NAME" | awk '{print \$3}')
TOTAL=\$($RADOS df | grep 'total space' | awk '{print \$3}')
USED_MB=\$(to_mb \$USED)
FREE_MB=\$(to_mb \$MAX_AVAIL)
TOTAL_MB=\$(expr \$TOTAL / 1024 / \$REPSIZE)
if [ \$FREE_MB -eq 0 ] ; then FREE_MB=\$(expr \$TOTAL_MB - \$USED_MB) ; fi
TOTAL_MB=\$(expr \$USED_MB + \$FREE_MB)
echo "USED_MB=\$USED_MB"
echo "FREE_MB=\$FREE_MB"