1. First, you have to determine the Storage-Repository-UUID:
xe sr-list
-> write down / take note of SR-UUID of the SR to delete
2. Find the corresponding Physical Block Device (PBD):
xe pbd-list sr-uuid=your-SR-uuid
-> write down / take note of PBD-UUID of the PBD to unplug and delete
3. Unplug the PBD:
xe pbd-unplug uuid=your-PBD-uuid
4. Delete PBD:
xe pbd-destroy uuid=your-PBD-uuid
5. Delete the association of your SR and the PBD:
xe sr-forget uuid=your-SR-uuid
Example
[root@XenXourceServer ~]# xe sr-list uuid ( RO) : 11af8e29-cbac-86fb-5178-c86c4818765f name-label ( RW): XenServer Tools name-description ( RW): XenServer Tools ISOs host ( RO): MacXen type ( RO): iso content-type ( RO): iso uuid ( RO) : c906b1e7-5a1f-0c76-2316-c9fee0b229e5 name-label ( RW): 500gbSSD name-description ( RW): host ( RO): MacXen type ( RO): lvm content-type ( RO): user uuid ( RO) : f3e98aa3-ddd7-b3b5-cbca-5e1b32d7b1c2 name-label ( RW): Removable storage name-description ( RW): host ( RO): MacXen type ( RO): udev content-type ( RO): disk [root@MacXen ~]# xe pbd-list sr-uuid=c906b1e7-5a1f-0c76-2316-c9fee0b229e5 uuid ( RO) : 9a6ca8dd-10f6-aa4b-afbc-548080067fd0 host-uuid ( RO): c796b938-0da0-4223-97bc-8e241f99b184 sr-uuid ( RO): c906b1e7-5a1f-0c76-2316-c9fee0b229e5 device-config (MRO): device: /dev/sdb currently-attached ( RO): false [root@MacXen ~]# xe pbd-unplug uuid=9a6ca8dd-10f6-aa4b-afbc-548080067fd0 [root@MacXen ~]# xe pbd-destroy uuid=9a6ca8dd-10f6-aa4b-afbc-548080067fd0 [root@MacXen ~]# xe sr-forget uuid=c906b1e7-5a1f-0c76-2316-c9fee0b229e5
To add a new Repository:
- Run the following command to find the disk ID of the new device:
# cat /proc/partitions A list of HDDs and partitions are displayed. Find out which device is your new local disk. Locate it by size. (This is probably “sdb” or “/cciss/c0d1p0”) # ll /dev/disk/by-id
- Find the disk ID of the “sdb” or “cciss/c0d1”disk. The “scsi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” or “cciss-xxxxxxxxxxxxxxxxxxxxxxxxxx”format is required.
- Run the following command to create an SR:
# xe sr-create content-type=user device-config:device=/dev/disk/by-id/<scsi-xxxxxxxxxxxxxxxxxxxxxxxxx> host-uuid=<host-uuid> name-label=”Local Storage 2” shared=false type=lvm
Or
# xe sr-create content-type=user device-config:device=/dev/disk/by-id/<cciss-xxxxxxxxxxxxxxxxxxxxxxxxx> host-uuid=<host-uuid> name-label=”Local Storage 2” shared=false type=lvm