Adding and Removing Local Storage From XenServer

Adding and Removing Local Storage From XenServer

To add local storage XenServer 6.x

get your device id’s with:

ll /dev/disk/by-id

The host uuid can be copied and pasted from the general tab of your host in XenCenter.

Create your storage:

xe sr-create content-type=user device-config:device=/dev/sdb host-uuid=<Place the host’s UUID here> name-label=”<Name your local storage here>” shared=false type=lvm

NOTE: Make sure that “shared=” is false. If you have shared storage on a hypervisor, you won’t be able to add it to a pool. When a hypervisor is added to a pool, its local storage is automatically shared in that pool.

NOTE: Replace sdb in the above command with the device that you’re adding.

To Remove local storage XenServer 6.x

Go to console in XenCenter or log in to your xenserver host via ssh

List your storage repositories.

xe sr-list

You will see something like this:

uuid ( RO) : <The uuid number you want is here>
name-label ( RW): Local storage
name-description ( RW):
host ( RO):
type ( RO): lvm
content-type ( RO): user

uuid string is the Storage Repository uuid (SR-uuid) that you need to be able to do the next step.

Get the Physical Block Device UUID.

xe pbd-list sr-uuid=Your-UUID

uuid ( RO) This is the PBD-uuid

Unplug the local storage.

xe pbd-unplug uuid=Your-PBD-uuid

Delete the PBD:

xe pbd-destroy uuid=your-PBD-uuid

Forget ( remove ) the Local storage from showing up as detached.

xe sr-forget uuid=your-SR-uuid

Now check your XenCenter that it’s removed.