Xen: New SR with Thin Provisioning

  XenServer

Identify partition using:

# fdisk -l

Disk /dev/sdb: 999.7 GB, 999653638144 bytes, 1952448512 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Use parted to create the partition

parted /dev/sdb
unit TB
mkpart primary 0 100%
print
quit

Create Physical LVM Volume

# pvcreate /dev/sdb1 --config global{metadata_read_only=0}
  Physical volume "/dev/sdb1" successfully created

Create Volume Group

# vgcreate ssd_volume /dev/sdb1 --config global{metadata_read_only=0}
  Volume group "ssd_volume" successfully created

Create Volume(s)

]# lvcreate --name ssd_vol1 --size 900G ssd_volume --config global{metadata_read_only=0}
  Logical volume "ssd_vol1" created.

use 100%

lvextend -l +100%FREE ssd_volume/ssd_vol1 --config global{metadata_read_only=0}

Format Volume(s)

# mkfs.ext3 /dev/ssd_volume/ssd_vol1 

Lookup host uuid

# xe host-list 

Create new SR

#xe sr-create host-uuid=UUID content-type=user name-label="SSD" shared=false device-config:device=/dev/ssd_volume/ssd_vol1 type=ext

Had issue was broken SR ran this:

vgchange -a y --config global{metadata_read_only=0}

Also see – http://stackoverflow.com/questions/39563993/logical-volume-show-as-not-available-on-xenserver-7-local-drive-lvm