Unable to extend partition with gdisk on XenServer 6.5

Solution 1:

Let gdisk verify the disk for problems (key v).

In my case it identified:

The secondary header's self-pointer indicates that it doesn't reside at the end of the disk. If you've added a disk to a RAID array, use the 'e' option on the experts' menu to adjust the secondary header's and partition table's locations.

I used x e.

Then m(ain menu) p showed the "last usable sector" as expected.