For my new job I have to learn how to deal with Citrix XenServer (yeah, because of a mixed workload of CentOS domU's and Windows TSE servers, for which XenServer has been optimized). I liked the fact that I'm directly feeling "like home" , as Citrix XenServer dom0 is based on CentOS (still 5.3 at this time though). One of the things i had to do was to extend a Storage Repository served from an IBM DS3200 through dual HBAs, and using mpp/rdac (the default on XenServer 5.5 when it sees a rdac disk storage backend). Great, I've never had problem doing this on plain RHEL or CentOS machines, so after having extended the LUN on the IBM DS3200, I was back on the XenServer side. I always like to read the official documention before doing something (and it's even faster when you know what you're searching for) and I found this on the Citrix XenServer documentation : "How to resize a Storage repository after changing the size of an LVM-base storage" . Hmmm, WTF ? Their recipe is : "live migrate the guests, restart the host and proceed for each host"! . No, it has to work without a reboot, we're not Windows admins, right ? Here is what i did : (that was tested on a test machine !)
We have first to list the current status/size :
[root@xen1 \~]# xe sr-list
uuid ( RO) : c945d1bb-2432-36ac-2766-ebd2bc7f2e81
name-label ( RW): Hardware HBA virtual disk storage
name-description ( RW): Hardware HBA SR [IBM - /dev/sdb]
host ( RO): xen1
type ( RO): lvmohba
content-type ( RO):
[root@xen1 \~]# xe sr-param-list uuid=c945d1bb-2432-36ac-2766-ebd2bc7f2e81|grep physical-size
physical-size ( RO): 85886763008
[root@xen1 \~]# pvscan|grep c945d1bb-2432-36ac-2766-ebd2bc7f2e81
PV /dev/sdb VG VG_XenStorage-c945d1bb-2432-36ac-2766-ebd2bc7f2e81 lvm2 [79.99 GB / 16.12 GB free]
Now we'll extend with the IBM DS StorageManager script editor : "set logicalDrive ["XenPool1"] addcapacity=139 GB;"
Back on the xen host we have to rescan for the new size (using a MPP device presented as /dev/sdb on the xen host) and confirm with dmesg|tail
[root@xen1 device]# echo 1 >/sys/block/sdb/device/rescan ; dmesg|tail
sdb: detected capacity change from 85899345920 to 235149459456
[root@xen1 device]# pvresize /dev/sdb
Physical volume "/dev/sdb" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@sicxen1 device]# pvscan
PV /dev/sdb VG VG_XenStorage-c945d1bb-2432-36ac-2766-ebd2bc7f2e81 lvm2 [218.99 GB / 155.12 GB free]
PV /dev/sda3 VG VG_XenStorage-9c1e7a2a-2fc0-83eb-3e32-7cea2c9e9d93 lvm2 [60.59 GB / 60.59 GB free]
Total: 2 [279.58 GB] / in use: 2 [279.58 GB] / in no VG: 0 [0 ]
Rescan now that SR :
[root@xen1 device]# xe sr-scan uuid=c945d1bb-2432-36ac-2766-ebd2bc7f2e81
[root@xen1 device]# xe sr-param-list uuid=c945d1bb-2432-36ac-2766-ebd2bc7f2e81|grep physical-size
physical-size ( RO): 235136876544
Done ! and i confirm that the CentOS domU's were still running after that ... ;-)
PS : while talking about Citrix XenServer, I have to add that I used only ssh/xe to manage it, as their XenCenter gui app is a Windows only GUI (relying on .Net). But I found several days ago an interesting GPL project: OpenXenCenter, something to keep an eye on as it's still alpha but quickly involving ...