Since a while, i’m using OpenFiler 2.x and Xen 4.01 Enterprise.
I use the iSCSI capabilities of OpenFiler for my Storage Repositories (SR) in Xen.

Last week i had a space problem for one of my VMs in XEN: The (virtual) Harddrive was only 30GB and i wanted to add another drive of 60GB. However, my Storage Repository (SR) was only 30GB!

I logged in to my OpenFiler machine with Putty and resized the iSCSI Volume with “lvextend -L +60G /dev/<MyGroup>/<MyiSCSIVolume>“.

In Xen i still saw that the Storage Repository was only 30GB, after restarting the OpenFiler iSCSI Target Service (using the GUI) and rebooting the XEN Server, the SR was still 30GB.

I logged in to the Xen Console (using Putty, but you can also use the XenCenter) and did a “xe sr-scan <my-sr-uuid>” and it was still 30GB, even after removing the SR and re-adding it.

After one night reading forums and Google’ing around I found the pvresize command, i red a lot of threads were people say it doesn’t work, well, it does work but you need to do the following:

xe sr-list name-label=<your SR name you want to resize>
Note the uuid of the SR.

pvscan | grep “<the uuid you noted in the previous step>
Note the device name (eg: PV /dev/sdj )

pvresize <device name>  (eg: pvresize /dev/sdj )

xe sr-scan <the uuid you noted in the previous step>

Now you see (check it using the XenCenter ;) ) that the SR is resized ! You can do the above while the VM is running in VM.
Most problems occur when people do “pvresize /dev/sda” (like most examples are), but when you have several (iSCSI) Storage Repositories, it could be /dev/sdc of /dev/sdj or whatever.

I’d add my new (virtual) Harddive and i had plenty of space again!