First: Install XenServer on first disk (/dev/sda) and NOT configure any local storage.
/dev/sda should contain three partitions, verify this with:
sgdisk -p /dev/sda
In some cases XenServer doesn’t create third partition, i.e. result of this command has only two partitions and looks like:
Number Start (sector) End (sector) Size Code Name
1 2048 8388641 4.0 GiB 0700
2 8390656 16777249 4.0 GiB 0700
In this case you need to create third partition manually:
sgdisk --new=3:16779264:DISK_SIZE-34 /dev/sda sgdisk --typecode=3:fd00
The second partition is used for backups during a XenServer upgrade. This partition won’t used in my XenServer upgrade method.
Now we are going to use /dev/sdb as the mirror disk. First clear the partition table.
sgdisk --zap-all /dev/sdb
and install a GPT table on it
sgdisk --mbrtogpt --clear /dev/sdb