Archive for March, 2009

XenServer: Adding Additional Storage to the Local Storage Repository

Posted in HowTo, Work on March 25th, 2009 by Ryan – Be the first to comment

So we are in the process of migrating from RHEL 5 XEN in various patched states to XenServer w/CentOS 5.2

For some of our testing we do not have direct access to our current SAN and are still waiting for a new SAN to arrive. In the meanwhile we are using the Local Storage Repository (LSR) with a nice USB drive hanging off the front.

A little upfront about Citrix’s XenServer, it’s RHEL derived. When doing the default install it creates everything as LVMs this has its benefits and drawbacks. This makes it really easy to add storage capacity but makes it easy to corrupt data if the underlying structure is not on a hardware raid (yep, not following best practices on the dev system – but that’s why you backup and backup often)

Anyway on to the meat of the post – Quick little trick to get the new disk in to the LSR.

First, turn the new disk in to a Physical Volume (PV) that can be used by the LVM:
pvcreate /dev/sdX

You’ll then need to extend the Volume Group (VG) by adding the new PV to it:
vgextend "VG Name" "/dev/sdX or path/to/physical/device"

To get the VG name:
vgdisplay
It will list all the Volume Groups on the server.

Now the LVM has been extended to the new size but you have to tell Xen that there is an update as well to do this you’ll need to do a few things.
We have to know the UUID of the Storage Repository (SR) that we want XenServer to re-scan and update its information about. The UUID can be found from running “vgdisplay” and dropping the “VG_XenStorage-” from the “VG Name”.

xe sr-scan uuid=SRUUID

And bam! We have increased the LSR size. Just don’t forget to keep regular backups!


Bad Behavior has blocked 148 access attempts in the last 7 days.