Hi,

this has been fixed upstream in v2.03.17.


As a workaround you can create the shared VG with an extent size that is
a) less or equals to 256M and b) a divisible of your target extent size.
Then extent the lvmlock LV so it is also a whole number of extents with
your target extent size. And finally change the extent size of the VG.
Obviously all the caveats of changing the extent size of a VG still apply.

root@node1:~# vgcreate --shared --physicalextentsize 256M my-shared-test-vg 
/dev/sdb1
  Enabling sanlock global lock
  Physical volume "/dev/sdb1" successfully created.
  Logical volume "lvmlock" created.
  Volume group "my-shared-test-vg" successfully created
  VG my-shared-test-vg starting sanlock lockspace
  Starting locking.  Waiting until locks are ready...
root@node1:~# vgs -o 
vg_name,vg_shared,vg_size,vg_extent_size,vg_extent_count,vg_free,vg_free_count
  VG                Shared  VSize Ext     #Ext VFree Free
  my-shared-test-vg  shared 4.00g 256.00m   16 3.75g   15

root@node1:~# lvextend --size 1G /dev/mapper/my--shared--test--vg-lvmlock
  Size of logical volume my-shared-test-vg/lvmlock changed from 256.00 MiB (1 
extents) to 1.00 GiB (4 extents).
  Logical volume my-shared-test-vg/lvmlock successfully resized.
root@node1:~# vgchange --physicalextentsize 1G my-shared-test-vg
  Volume group "my-shared-test-vg" successfully changed
root@node1:~# vgs -o 
vg_name,vg_shared,vg_size,vg_extent_size,vg_extent_count,vg_free,vg_free_count
  VG                Shared  VSize Ext   #Ext VFree Free
  my-shared-test-vg  shared 4.00g 1.00g    4 3.00g    3
root@node1:~# lvs -a
  LV        VG                Attr       LSize Pool Origin Data%  Meta%  Move 
Log Cpy%Sync Convert
  [lvmlock] my-shared-test-vg -wi-ao---- 1.00g

This can still be a bit finicky because you have to get the size of the
PV right, so the initial extent count is a multiple of the final extent
count. In the above example /dev/sdb1 is 4200MiB, which is 16 and 4
extents respectively. It does not work with 4300MiB, because that would
be 17 and 4; vgchange will show the error "New extent size is not a
perfect fit".


---
Greetings

Corubba

Reply via email to