Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2061800

Summary: vdo pool test conversion should not be writing out vdo signature; can lead to looping wipe attempts
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: VDO QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, awalsh, cluster-qe, heinzm, jbrassow, lvm-team, mcsontos, prajnoha, zkabelac
Version: 8.6Keywords: Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.03.14-7.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2061610 Environment:
Last Closed: 2023-05-16 09:11:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2061610    
Bug Blocks:    

Description Corey Marthaler 2022-03-08 15:09:36 UTC
+++ This bug was initially created as a clone of Bug #2061610 +++

Description of problem:

[root@hayes-02 ~]# lvcreate --yes --type linear -n vdo_pool -L 25G vdo_sanity
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Logical volume "vdo_pool" created.

[root@hayes-02 ~]# lvs
  LV       VG         Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vdo_pool vdo_sanity -wi-a----- 25.00g    

# VDO signature wiped from prior attempt through lvcreate

[root@hayes-02 ~]# lvconvert --test --yes --type vdo-pool --name vdo_lv --virtualsize 5G vdo_sanity/vdo_pool
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Converting logical volume vdo_sanity/vdo_pool to VDO pool volume with formating.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
    The VDO volume can address 22 GB in 11 data slabs, each 2 GB.
    It can grow to address at most 16 TB of physical storage in 8192 slabs.
    If a larger maximum size might be needed, use bigger slabs.
  Logical volume "vdo_lv" created.
  Converted vdo_sanity/vdo_pool to VDO pool volume and created virtual vdo_sanity/vdo_lv VDO volume.

# This --test lvconvert attempt appears to place that vdo signature back on the device and as a result an additional conversion attempt will spin attempting to wipe it.

[root@hayes-02 ~]# lvs
  LV       VG         Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vdo_pool vdo_sanity -wi-a----- 25.00g    


[root@hayes-02 ~]# lvconvert --test --yes --type vdo-pool --name vdo_lv --virtualsize 5G vdo_sanity/vdo_pool
  [...]
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.Killed



Version-Release number of selected component (if applicable):
kernel-5.14.0-58.el9    BUILT: Thu Feb 10 11:18:21 AM CST 2022
lvm2-2.03.14-4.el9    BUILT: Wed Feb 16 06:01:21 AM CST 2022
lvm2-libs-2.03.14-4.el9    BUILT: Wed Feb 16 06:01:21 AM CST 2022


How reproducible:
Every time

Comment 1 Corey Marthaler 2022-03-08 15:10:52 UTC
This exists in rhel8.6 as well.

kernel-4.18.0-367.el8    BUILT: Thu Feb 10 14:33:16 CST 2022
lvm2-2.03.14-3.el8    BUILT: Tue Jan  4 14:54:16 CST 2022
lvm2-libs-2.03.14-3.el8    BUILT: Tue Jan  4 14:54:16 CST 2022

Comment 2 Zdenek Kabelac 2022-08-15 14:16:27 UTC
Nice catch.

Fixed with this small patch for --test:

https://listman.redhat.com/archives/lvm-devel/2022-August/024267.html

Comment 5 Corey Marthaler 2022-12-13 19:31:22 UTC
Marking Verified:Tested in the latest 8.8 rpms.

kernel-4.18.0-442.el8.v2    BUILT: Mon Dec  5 21:06:21 CET 2022
lvm2-2.03.14-9.el8    BUILT: Thu Dec  8 17:40:55 CET 2022
lvm2-libs-2.03.14-9.el8    BUILT: Thu Dec  8 17:40:55 CET 2022


SCENARIO - test_vdo_create_and_convert_attempts:  Attempt to use the --test cmd varieties to create or convert a vdo pool volume (bug 2061610|2061800) 
adding entry to the devices file for /dev/sda
creating PV on virt-131.cluster-qe.lab.eng.brq.redhat.com using device /dev/sda
pvcreate --yes -ff   /dev/sda
  Physical volume "/dev/sda" successfully created.
adding entry to the devices file for /dev/sdb
creating PV on virt-131.cluster-qe.lab.eng.brq.redhat.com using device /dev/sdb
pvcreate --yes -ff   /dev/sdb
  Physical volume "/dev/sdb" successfully created.
adding entry to the devices file for /dev/sdc
creating PV on virt-131.cluster-qe.lab.eng.brq.redhat.com using device /dev/sdc
pvcreate --yes -ff   /dev/sdc
  Physical volume "/dev/sdc" successfully created.
adding entry to the devices file for /dev/sdd
creating PV on virt-131.cluster-qe.lab.eng.brq.redhat.com using device /dev/sdd
pvcreate --yes -ff   /dev/sdd
  Physical volume "/dev/sdd" successfully created.
adding entry to the devices file for /dev/sde
creating PV on virt-131.cluster-qe.lab.eng.brq.redhat.com using device /dev/sde
pvcreate --yes -ff   /dev/sde
  Physical volume "/dev/sde" successfully created.
creating VG on virt-131.cluster-qe.lab.eng.brq.redhat.com using PV(s) /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde
vgcreate    vdo_sanity /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde
  Volume group "vdo_sanity" successfully created

Test that vdo pool and virt creation works with '--test'
lvcreate --test --yes --type vdo --name vdo_lv --vdopool vdo_pool -L 6G --virtualsize 6G -ay vdo_sanity
TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.

lvcreate --yes --type linear -n vdo_pool  -L 25G vdo_sanity  
Logical volume "vdo_pool" created.

Test that vdo pool conversion of existing pool works with '--test'
lvconvert --test --yes --type vdo-pool --name vdo_lv --virtualsize 5G vdo_sanity/vdo_pool
TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Converting logical volume vdo_sanity/vdo_pool to VDO pool volume with formating.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)

Repeat the above --test vdo convserion to ensure no signature had been written (a deadlock here is likely bug 2061610|2061800)
lvconvert --test --yes --type vdo-pool --name vdo_lv --virtualsize 5G vdo_sanity/vdo_pool

lvremove  -f vdo_sanity/vdo_pool
Logical volume "vdo_pool" successfully removed.

removing vg vdo_sanity from virt-131.cluster-qe.lab.eng.brq.redhat.com
  Volume group "vdo_sanity" successfully removed
removing pv /dev/sda on virt-131.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sda" successfully wiped.
removing entry from the devices file for /dev/sda
removing pv /dev/sdb on virt-131.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sdb" successfully wiped.
removing entry from the devices file for /dev/sdb
removing pv /dev/sdc on virt-131.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sdc" successfully wiped.
removing entry from the devices file for /dev/sdc
removing pv /dev/sdd on virt-131.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sdd" successfully wiped.
removing entry from the devices file for /dev/sdd
removing pv /dev/sde on virt-131.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sde" successfully wiped.
removing entry from the devices file for /dev/sde

Comment 10 errata-xmlrpc 2023-05-16 09:11:54 UTC
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 (lvm2 bug fix and enhancement update), 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/RHBA-2023:3048