To re-attach existing storage e.g. when you've done a destructive upgrade of XenServer and have the OS on one drive and some VMs on another one, or when you need to create it
To Create a Repository
- List the paritions:
cat /proc/partitions - List the disks by id and match your parition to the scsi-<some UUID>
ll /dev/disk/by-id - Create the storage repository
- Get the host id
xe host-list - Create the SR:
xe sr-create content-type=user device-config:device=/dev/disk/by-id/<scsi...> host-uuid=<host-uuid> name-label=”Local Storage 2” shared=false type=lvm
To Connect a Storage Repository
- Find the state of the physical drives:
pvdisplay
or: cat /proc/partitions - Use the returned 'VG Name' to introduce it to XenServer:
xe sr-introduce uuid=<VG Name UUID> type=lvm name-label="Local storage 2" content-type=user - Connect the physical block device (PBD) with the SR:
- Get the host's UUID
xe host-list - Get the device name:
ls -l /dev/disk/by-id
You need one ending -part1,2 etc - Connect the device:
xe pbd-create host-uuid=<host UUID> sr-uuid=<VG Name UUID> \ device-config:device=/dev/disk/by-id/<device name> - Plug in the new disk
xe pbd-plug uuid=<UUID>
To Remove a Repository
- Find the UUID
xe pbd-list - Remove it
xe pbd-unplug uuid=<device UUID> - Remove it:
xe sr-forget uuid=<sr-UUID>
NB: this is the sr-uuid not the uuid
No comments:
Post a Comment