Add a Hard Drive to XenServer
From thelinuxwiki
Version 6.2
adding a new hard drive i.e. /dev/sdb
1) verify the drive of interest is recognized
# cat /proc/partitions major minor #blocks name
7 0 52378 loop0 8 0 976762584 sda 8 1 4193297 sda1 8 2 4193297 sda2 8 3 968372935 sda3 8 16 1953514584 sdb 252 0 968359936 dm-0
sdb shows up so we are good...
2) Find the disk ID of the new device
# ll /dev/disk/by-id total 0 lrwxrwxrwx 1 root root 9 Jan 23 13:35 edd-int13_dev81 -> ../../sdb lrwxrwxrwx 1 root root 9 Jan 23 13:35 scsi-SATA_WDC_WD10EACS-00_WD-WCASJ1527948 -> ../../sda lrwxrwxrwx 1 root root 10 Jan 23 13:35 scsi-SATA_WDC_WD10EACS-00_WD-WCASJ1527948-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Jan 23 13:35 scsi-SATA_WDC_WD10EACS-00_WD-WCASJ1527948-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Jan 23 13:35 scsi-SATA_WDC_WD10EACS-00_WD-WCASJ1527948-part3 -> ../../sda3 lrwxrwxrwx 1 root root 9 Jan 23 13:35 scsi-SATA_WDC_WD20EARS-00_WD-WMAZA2044059 -> ../../sdb
3) Find out the 'host-uuid' in XenServer
# xe host-list uuid ( RO) : 89568def-9ecf-44e4-ae21-35e353c40c82 name-label ( RW): myxenbox name-description ( RW): Default install of XenServer
4) Create a Storage Repository (SR) using data from above:
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
example:
# xe sr-create content-type=user device-config:device=/dev/disk/by-id/scsi-SATA_WDC_WD20EARS-00_WD-WMAZA2044059 host-uuid=89568def-9ecf-44e4-ae21-35e353c40c82 name-label=datastore1 shared=false type=lvm