Twice now, I have had the (dis)pleasure of expanding our local storage on a couple of XenServer boxes. In a nutshell, here is how it works:
1. Expand physical disk (add more RAID members, ect). Use the procedure specific to your RAID card.
2. Use fdisk to expand the partition your Local Storage resides on:
[root@vps1a ~]# pvscan
PV /dev/sda3 VG VG_XenStorage-4c69467e-0352-5bd4-3dee-e17cc18aee08 lvm2 [923.64 GB / 380.14 GB free]
Total: 1 [923.64 GB] / in use: 1 [923.64 GB] / in no VG: 0 [0 ]
Note the bold type to the left, /dev/sda3 is the partition we want to expand by deleting and re-adding to the maximum size in fdisk. After you do this, you need to reboot so the OS will recognize the larger partition. The bold type to the right is the UUID we need later.
3. After rebooting, now we can expand the physical LVM volume:
pvresize /dev/sda3
4. Now we tell XenServer that we increased the size, so you can actually use your extra space:
xe sr-scan uuid=4c69467e-0352-5bd4-3dee-e17cc18aee08
Note: The UUID was discovered in step 2.
5. All done!
Notes: Rebooting the XenServer host is a real pain. It can be avoided by adding your extra space as a separate partition or disk, then using vgextend to join the LVM physical volumes, instead of fdisk to expand an existing partition. Using the vgextend method at step 2, you don’t have to reboot, but you lose the redundancy of having RAID5 or RAID10 backing your whole volume.