How to change a XenServer's local storage repository from LVM to EXT

Last updated on October 2, 2012 by Dan Nanni

By default, XenServer (now renamed "Citrix Hypervisor") create LVM-type local storage repository (SR). The LVM-type local SR does not support VHD-formatted virtual hard disks, and hence may not be an ideal option when you are using XenServer along with OpenStack which requires access to individual VHD files for VM snapshot and migration. With EXT-type local SR, you can get direct access to VHD files.

If you want to change local storage repository from LVM to EXT, you can follow the steps below.

First, find out the partition for XenServer's local SR from /etc/xensource-inventory.

$ cat /etc/xensource-inventory
. . . .
DEFAULT_SR_PHYSDEVS='dev/sda3'
. . . .

Like above, the default XenServer installation with a single hard disk creates local SR in /dev/sda3. Make the note of this information as it's needed when you create an EXT-type SR.

Now go ahead and remove the existing LVM-type local SR as follows.

Find out the UUID of the existing local SR:

$ xe sr-list name-label="Local storage" type=lvm

Find out the UUID of physical block device associated with the local SR:

$ xe pbd-list sr-uuid=[local_storage_uuid]

Remove the physical block device and purge the local SR:

$ xe pbd-unplug uuid=[pbd_uuid]
$ xe pbd-destroy uuid=[pbd_uuid]
$ xe sr-forget uuid=[local_storage_uuid]

Finally, create a new EXT-type local SR as follows.

$ xe sr-create content-type="Local SR" host-uuid=(press tab to enter it automatically) type=ext device-config-device=/dev/sda3 shared=false name-label="Local File SR"

In the above command, replace /dev/sda3 with the information you find out from /dev/xensource-inventory. This command will take a few minutes to run, depending on the size of the partition. If successfully completed, it will print out the UUID of the new EXT-type local SR created.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean