Showing posts with label iscsi. Show all posts
Showing posts with label iscsi. Show all posts

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

Friday, 8 July 2011

Resizing LUNs for Xenserver SRs

Perform steps 2-7 on the Pool Master:

1. Extend the volume/LUN from the SAN management console

2.Execute the following command and note the uuid of the SR.
xe sr-list name-label=<your SR name you want to resize>
3.To get the device name (eg: PV /dev/sdj ) use:
pvscan | grep <the uuid you noted in the previous step>
4.Tell the serve to refresh the iscsi connection:
echo 1 > /sys/block/device/device/rescan (e.g. echo 1 > /sys/block/sdj/device/rescan)
5.Resize the volume
pvresize <device name> (eg: pvresize /dev/sdj )
6. Rescan the SR:
xe sr-scan <the uuid you noted in the previous step>
7. Verify that the XE host sees the larger physical disk:
pvscan | grep <the uuid you noted in step 2>

References: http://blogs.citrix.com/2011/03/07/live-lun-resize-on-xenserver/

Possibly Related Posts