Saturday 9 July 2011

Resizing LUNs for Xenserver SRs with Script

Here is another solution for re-sizing a LUN on a ISCSI Xenserver SR without rebooting.

First you need to resize the lun on the iscsi server, then use the following script:

SR_NAME=$1
#Get SR UUID
SR2GROW=$(xe sr-list params=uuid name-label=$SR_NAME | awk '{ print $NF }')
# find devices to resize
DEV2GROW=$(pvscan | grep $SR2GROW | awk '{ print $2 }')
# scan for resized devices
iscsiadm -m node -R
# do the resize
for dev in $DEV2GROW ; do
pvresize $dev
done
# tell xenapi to look for the new LVM size
xe sr-scan uuid=${SR2GROW}

Possibly Related Posts

No comments:

Post a Comment