1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-08 20:58:17 +03:00

Merge branch 'bug-1757'

This commit is contained in:
Ruben S. Montero 2013-11-14 18:47:00 +01:00
commit ce1a054214
2 changed files with 13 additions and 3 deletions

View File

@ -5,7 +5,12 @@ HYPERVISOR=$1
DATASTORE_LOCATION=${2:-"/var/lib/one/datastores"}
LVM_VG_PREFIX="vg-one-"
LVM_SIZE_CMD="sudo vgdisplay --separator : --units m -o vg_size,vg_free --nosuffix --noheadings -C"
PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin which vgdisplay &> /dev/null
if [ $? == 0 ]; then
LVM_SIZE_CMD="sudo vgdisplay --separator : --units m -o vg_size,vg_free --nosuffix --noheadings -C"
fi
USED_MB=$(du -sLm $DATASTORE_LOCATION 2>/dev/null | cut -f1)
TOTAL_MB=$(df -B1M -P $DATASTORE_LOCATION 2>/dev/null | tail -n 1 | awk '{print $2}')
@ -26,8 +31,12 @@ for ds in $dirs; do
TOTAL_MB=$(df -B1M -P $dir 2>/dev/null | tail -n 1 | awk '{print $2}')
FREE_MB=$(df -B1M -P $dir 2>/dev/null | tail -n 1 | awk '{print $4}')
LVM_SIZE=$($LVM_SIZE_CMD ${LVM_VG_PREFIX}${ds} 2>/dev/null)
LVM_STATUS=$?
if [ -n "$LVM_SIZE_CMD" ]; then
LVM_SIZE=$($LVM_SIZE_CMD ${LVM_VG_PREFIX}${ds} 2>/dev/null)
LVM_STATUS=$?
else
LVM_STATUS=255
fi
echo "DS = ["
echo " ID = $ds,"

View File

@ -454,6 +454,7 @@ int XenDriver::deployment_description(
goto error_vncdisplay;
}
file << ",vncunused=0";
file << ",vncdisplay=" << display - 5900;
}