Red Hat Bugzilla – Bug 1512075
thin volumes can now be used as origin volumes in snap conversion operations
Last modified: 2018-04-10 11:23:08 EDT
Description of problem: Is this expected? Before 7.5 this was never allowed and we didn't see an RFE to enable and test this. # RHEL7.5 3.10.0-772.el7.x86_64 lvm2-2.02.176-2.el7 BUILT: Fri Nov 3 07:46:53 CDT 2017 Making origin volume lvcreate --virtualsize 1G -T snapper_thinp/POOL -n origin Making a linear volume lvcreate -n snap_to_convert -L 100M snapper_thinp [root@host-115 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Devices POOL snapper_thinp twi-aot--- 1.00g 0.00 1.56 POOL_tdata(0) [POOL_tdata] snapper_thinp Twi-ao---- 1.00g /dev/sdh1(1) [POOL_tmeta] snapper_thinp ewi-ao---- 4.00m /dev/sde1(0) [lvol0_pmspare] snapper_thinp ewi------- 4.00m /dev/sdh1(0) origin snapper_thinp Vwi-a-t--- 1.00g POOL 0.00 snap_to_convert snapper_thinp -wi-a----- 100.00m /dev/sdh1(257) [root@host-115 ~]# lvconvert -s snapper_thinp/origin snapper_thinp/snap_to_convert --yes WARNING: Converting logical volume snapper_thinp/snap_to_convert to snapshot exception store. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) Logical volume snapper_thinp/origin converted to snapshot. [root@host-115 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Devices root rhel_host-115 -wi-ao---- <6.20g /dev/vda2(205) swap rhel_host-115 -wi-ao---- 820.00m /dev/vda2(0) POOL snapper_thinp twi-aot--- 1.00g 0.00 1.56 POOL_tdata(0) [POOL_tdata] snapper_thinp Twi-ao---- 1.00g /dev/sdh1(1) [POOL_tmeta] snapper_thinp ewi-ao---- 4.00m /dev/sde1(0) [lvol0_pmspare] snapper_thinp ewi------- 4.00m /dev/sdh1(0) origin snapper_thinp owi-a-t--- 1.00g POOL 0.00 other1 snapper_thinp Vwi-a-t--- 1.00g POOL 0.00 other2 snapper_thinp Vwi-a-t--- 1.00g POOL 0.00 other3 snapper_thinp Vwi-a-t--- 1.00g POOL 0.00 other4 snapper_thinp Vwi-a-t--- 1.00g POOL 0.00 other5 snapper_thinp Vwi-a-t--- 1.00g POOL 0.00 snap_to_convert snapper_thinp swi-a-s--- 100.00m origin 0.00 /dev/sdh1(257) # RHEL7.4 3.10.0-693.5.2.el7.x86_64 lvm2-2.02.171-8.el7 BUILT: Wed Jun 28 13:28:58 CDT 2017 Making origin volume lvcreate --virtualsize 1G -T snapper_thinp/POOL -n origin Making a linear volume lvcreate -n snap_to_convert -L 100M snapper_thinp [root@host-121 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Devices POOL snapper_thinp twi-aot--- 1.00g 0.00 1.56 POOL_tdata(0) [POOL_tdata] snapper_thinp Twi-ao---- 1.00g /dev/sde1(1) [POOL_tmeta] snapper_thinp ewi-ao---- 4.00m /dev/sdb1(0) [lvol0_pmspare] snapper_thinp ewi------- 4.00m /dev/sde1(0) origin snapper_thinp Vwi-a-t--- 1.00g POOL 0.00d$ snap_to_convert snapper_thinp -wi-a----- 100.00m /dev/sde1(257) [root@host-121 ~]# lvconvert -s snapper_thinp/origin snapper_thinp/snap_to_convert --yes Unable to use LV snapper_thinp/snap_to_convert as snapshot origin: invald LV type.
Yep - it's been just missed piece in cmdline API. lvm2 supports 'old thick snapshot' of thin LV. with lvconvert user can 'split' such snapshot - and you should be also to recombine this back i.e.: # Create thick snapshot of thin LV lvcreate -s -L10 vg/thinLV -n thickSNAP # Split origin and COW lvconvert --splitsnapshot vg/thickSNAP # Recombine back (optionally without zeroing COW with -Zn) lvconvert -s vg/thinLV thickSNAP Is there any more info needed ?
Yeah, we're going to need to disallow (or fix) this in exclusively activated thins on cluster/shared VGs. lvconvert -s snapper_thinp/origin snapper_thinp/snap_to_convert --yes WARNING: Converting logical volume snapper_thinp/snap_to_convert to snapshot exception store. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) Internal error: LV snapper_thinp/snap_to_convert shouldn't have lock_args
Created attachment 1356878 [details] lvconvert -vvvv of thin on shared VG
Actually, this work in clvmd mode. Needs to be fixed in lockd mode (see comment #3). # CLVM [root@host-034 ~]# vgs VG #PV #LV #SN Attr VSize VFree snapper_thinp 5 8 0 wz--nc 124.98g <123.88g [root@host-034 ~]# lvconvert -s snapper_thinp/origin snapper_thinp/snap_to_convert --yes WARNING: Converting logical volume snapper_thinp/snap_to_convert to snapshot exception store. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) Logical volume snapper_thinp/snap_to_convert converted to snapshot.
disallowed combining split snapshots in shared VG: https://sourceware.org/git/?p=lvm2.git;a=commit;h=175d06a92940dda5de3a7631e3d27cd6828a16be
Marking verified with latest rpms. Added snap fs checks to this scenario. SCENARIO - [convert_vol_to_thin_snap] Convert the linear to snapshot of the origin volume Making pool volume lvcreate --thinpool POOL -L 1G --zero n --poolmetadatasize 4M snapper_thinp Sanity checking pool device (POOL) metadata thin_check /dev/mapper/snapper_thinp-meta_swap.481 examining superblock examining devices tree examining mapping tree checking space map counts Making origin volume lvcreate --virtualsize 1G -T snapper_thinp/POOL -n origin lvcreate -V 1G -T snapper_thinp/POOL -n other1 WARNING: Sum of all thin volume sizes (2.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate --virtualsize 1G -T snapper_thinp/POOL -n other2 WARNING: Sum of all thin volume sizes (3.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate -V 1G -T snapper_thinp/POOL -n other3 WARNING: Sum of all thin volume sizes (4.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate --virtualsize 1G -T snapper_thinp/POOL -n other4 WARNING: Sum of all thin volume sizes (5.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate --virtualsize 1G -T snapper_thinp/POOL -n other5 WARNING: Sum of all thin volume sizes (6.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). Making a linear volume lvcreate -n snap_to_convert -L 1G snapper_thinp WARNING: Sum of all thin volume sizes (6.00 GiB) exceeds the size of thin pools (1.00 GiB). Converting the linear to be an "oldstyle" snapshot of the origin volume (This should now work post rhel7.5 ?) lvconvert -s snapper_thinp/origin snapper_thinp/snap_to_convert --yes WARNING: Converting logical volume snapper_thinp/snap_to_convert to snapshot exception store. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) Placing an xfs filesystem on snapshot volume Mounting origin volume Writing files to /mnt/snap_to_convert Checking files on /mnt/snap_to_convert Removing snap volume snapper_thinp/snap_to_convert lvremove -f /dev/snapper_thinp/snap_to_convert Removing thin origin and other virtual thin volumes Removing pool snapper_thinp/POOL ========================================= NOTE: This feature is still not yet implemented for lvmlockd using sanlock: #lvconvert -s snapper_thinp/origin snapper_thinp/snap_to_convert --yes Unable to combine split snapshots in VG with lock_type sanlock 3.10.0-811.el7.x86_64 lvm2-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 lvm2-libs-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 lvm2-cluster-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 lvm2-python-boom-0.8.1-5.el7 BUILT: Wed Dec 6 11:15:40 CET 2017 cmirror-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 device-mapper-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 device-mapper-libs-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 device-mapper-event-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 device-mapper-event-libs-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017 device-mapper-persistent-data-0.7.3-3.el7 BUILT: Tue Nov 14 12:07:18 CET 2017 vdo-6.1.0.72-12 BUILT: Sat Dec 2 01:01:22 CET 2017 kmod-kvdo-6.1.0.55-9.el7 BUILT: Fri Nov 17 22:48:23 CET 2017
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0853