bug 8291: get physical vdi size before dd

status 8291: resolved fixed
This commit is contained in:
anthony 2011-02-02 14:13:08 -08:00
parent fe67fa851a
commit 36778f4e3c
1 changed files with 6 additions and 6 deletions

View File

@ -77,6 +77,12 @@ elif [ $type == "lvmoiscsi" -o $type == "lvm" ]; then
cleanup
exit 0
fi
lvsize=$(xe vdi-param-get uuid=$uuid param-name=physical-utilisation)
if [ $? -ne 0 ]; then
echo "12#failed to get physical size of vdi $uuid"
cleanup
exit 0
fi
lvchange -ay /dev/VG_XenStorage-$sruuid/VHD-$uuid
if [ $? -ne 0 ]; then
echo "10#lvm can not make VDI $uuid visiable"
@ -89,12 +95,6 @@ elif [ $type == "lvmoiscsi" -o $type == "lvm" ]; then
cleanup
exit 0
fi
lvsize=$(xe vdi-param-get uuid=$uuid param-name=physical-utilisation)
if [ $? -ne 0 ]; then
echo "12#failed to get physical size of vdi $uuid"
cleanup
exit 0
fi
vhd-util modify -s $lvsize -n /dev/VG_XenStorage-$sruuid/VHD-$uuid
if [ $? -ne 0 ]; then
echo "13#failed to set new vhd physical size for vdi vdi $uuid"