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 1161347

Summary: When raid creation is aborted, left-over devices appear
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, cluster-qe, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, rbednar, zkabelac
Version: 7.1   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.178-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1201856 (view as bug list) Environment:
Last Closed: 2018-10-30 11:02:16 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:    
Bug Blocks: 1201856    
Attachments:
Description Flags
-vvvv of the lvcreate none

Description Corey Marthaler 2014-11-07 00:18:49 UTC
Description of problem:
This is basically bug 1140128 but for raid volumes

# edit volume_list, and then attempt creates
    volume_list = [ "rhel_host-118", "@host-118.virt.lab.msp.redhat.com" ]


# linear leaves nothing
[root@host-118 ~]# lvcreate -n foo -L 100M vg
  Volume "vg/foo" is not active locally.
  Aborting. Failed to wipe start of new LV.
[root@host-118 ~]# lvs -a -o +devices
  LV   VG  Attr       LSize   Devices       

# stripe leaves nothing
[root@host-118 ~]# lvcreate -n foo -i 2 -L 100M vg
  Using default stripesize 64.00 KiB
  Rounding size (25 extents) up to stripe boundary size (26 extents).
  Volume "vg/foo" is not active locally.
  Aborting. Failed to wipe start of new LV.
[root@host-118 ~]# lvs -a -o +devices
  LV   VG  Attr       LSize   Devices       

# raids do leave devices
[root@host-118 ~]# lvcreate -n foo -m 1 -L 100M vg
  Volume "vg/foo_rmeta_0" is not active locally.
  Failed to zero vg/foo_rmeta_0
[root@host-118 ~]# lvs -a -o +devices
  LV             VG  Attr       LSize   Devices                        
  foo            vg  rwi---r---      0  foo_rimage_0(0),foo_rimage_1(0)
  [foo_rimage_0] vg  Iwi---r--- 100.00m /dev/sda1(1)                   
  [foo_rimage_1] vg  Iwi---r--- 100.00m /dev/sdb1(1)                   
  foo_rmeta_0    vg  ewi---r---   4.00m /dev/sda1(0)                   
  foo_rmeta_1    vg  ewi---r---   4.00m /dev/sdb1(0)                   

# mirrors leaves nothing
[root@host-118 ~]# lvcreate -n foo2 --type mirror -m 1 -L 100M vg
  Volume "vg/foo2_mlog" is not active locally.
  Aborting. Failed to wipe mirror log.
  Failed to initialise mirror log.
[root@host-118 ~]# lvs -a -o +devices
  LV             VG  Attr       LSize   Devices                        
  foo            vg  rwi---r---      0  foo_rimage_0(0),foo_rimage_1(0)
  [foo_rimage_0] vg  Iwi---r--- 100.00m /dev/sda1(1)                   
  [foo_rimage_1] vg  Iwi---r--- 100.00m /dev/sdb1(1)                   
  foo_rmeta_0    vg  ewi---r---   4.00m /dev/sda1(0)                   
  foo_rmeta_1    vg  ewi---r---   4.00m /dev/sdb1(0)                   

# removal attempt doesn't get the left over image devices
[root@host-118 ~]# lvremove vg/foo
  Logical volume "foo" successfully removed
[root@host-118 ~]# lvs -a -o +devices
  LV             VG  Attr       LSize   Devices       
  [foo_rimage_0] vg  -wi------- 100.00m /dev/sda1(1)  
  [foo_rimage_1] vg  -wi------- 100.00m /dev/sdb1(1)  
  foo_rmeta_0    vg  -wi-------   4.00m /dev/sda1(0)  
  foo_rmeta_1    vg  -wi-------   4.00m /dev/sdb1(0)  


Version-Release number of selected component (if applicable):
3.10.0-184.el7.x86_64

lvm2-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
lvm2-libs-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
lvm2-cluster-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-libs-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-event-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-event-libs-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-persistent-data-0.3.2-1.el7    BUILT: Thu Apr  3 09:58:51 CDT 2014
cmirror-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014

Comment 1 Corey Marthaler 2014-11-07 00:22:51 UTC
Created attachment 954716 [details]
-vvvv of the lvcreate

Comment 3 Corey Marthaler 2014-11-07 19:33:24 UTC
More...

[root@host-110 ~]# lvs -a -o +devices
  LV              VG            Attr       LSize   Devices
  meta            snapper_thinp rwi---r---      0  meta_rimage_0(0),meta_rimage_1(0)
  [meta_rimage_0] snapper_thinp Iwi---r--- 100.00m /dev/sdf1(1)
  [meta_rimage_1] snapper_thinp Iwi---r--- 100.00m /dev/sdc1(1)
  meta_rmeta_0    snapper_thinp ewi---r---   4.00m /dev/sdf1(0)
  meta_rmeta_1    snapper_thinp ewi---r---   4.00m /dev/sdc1(0)

[root@host-110 ~]# lvremove snapper_thinp/meta
  Logical volume "meta" successfully removed
[root@host-110 ~]# lvremove snapper_thinp/meta_rmeta_1
  Logical volume "meta_rmeta_1" successfully removed
[root@host-110 ~]# lvremove snapper_thinp/meta_rmeta_0
  Logical volume "meta_rmeta_0" successfully removed

[root@host-110 ~]# lvs -a -o +devices
  LV              VG            Attr       LSize   Devices
  [meta_rimage_0] snapper_thinp -wi------- 100.00m /dev/sdf1(1)
  [meta_rimage_1] snapper_thinp -wi------- 100.00m /dev/sdc1(1)

[root@host-110 ~]# lvremove snapper_thinp/meta_rimage_0
[root@host-110 ~]# lvs -a -o +devices
  LV              VG            Attr       LSize   Devices
  [meta_rimage_1] snapper_thinp -wi------- 100.00m /dev/sdc1(1)

# If you don't manually clean up that last left over image, the vgremove will fail

[root@host-110 ~]# vgremove snapper_thinp
  Assertion failed: can't _pv_write non-orphan PV (in VG )
  Failed to remove physical volume "/dev/sdc1" from volume group "snapper_thinp"
  Volume group "snapper_thinp" not properly removed

Comment 5 Heinz Mauelshagen 2018-03-16 14:59:02 UTC
Upstream commit d68d71013fb261c87f1d3a26ebf098644055c6d1

Comment 7 Heinz Mauelshagen 2018-04-06 13:35:15 UTC
Corey,

with commit d68d71013fb261c87f1d3a26ebf098644055c6d1, creation of any raid type with metadata devices (raid0_meta,raid1/4/5/6/10) shall fail when not listed in activation/volume_list and no (SubLV)s may persist:

# vg=nvm;for type in raid0_meta raid1 raid4 raid5 raid6 raid10;do lvcreate --config "activation/volume_list = [ \"vg_not_exist\" ]" --yes --type $type --size 2 --name will_fail_creation $vg;lvs -ao+devices $vg;done
  Using default stripesize 64.00 KiB.
  Rounding up size to full physical extent 4.00 MiB
  Rounding size 4.00 MiB (1 extents) up to stripe boundary size 8.00 MiB(2 extents).
  Volume "nvm/will_fail_creation_rmeta_0" is not active locally (volume_list activation filter?).
  Rounding up size to full physical extent 4.00 MiB
  Volume "nvm/will_fail_creation_rmeta_0" is not active locally (volume_list activation filter?).
  Using default stripesize 64.00 KiB.
  Rounding up size to full physical extent 4.00 MiB
  Rounding size 4.00 MiB (1 extents) up to stripe boundary size 8.00 MiB(2 extents).
  Volume "nvm/will_fail_creation_rmeta_0" is not active locally (volume_list activation filter?).
  Using default stripesize 64.00 KiB.
  Rounding up size to full physical extent 4.00 MiB
  Rounding size 4.00 MiB (1 extents) up to stripe boundary size 8.00 MiB(2 extents).
  Volume "nvm/will_fail_creation_rmeta_0" is not active locally (volume_list activation filter?).
  Using default stripesize 64.00 KiB.
  Rounding up size to full physical extent 4.00 MiB
  Rounding size 4.00 MiB (1 extents) up to stripe boundary size 12.00 MiB(3 extents).
  Volume "nvm/will_fail_creation_rmeta_0" is not active locally (volume_list activation filter?).
  Using default stripesize 64.00 KiB.
  Rounding up size to full physical extent 4.00 MiB
  Rounding size 4.00 MiB (1 extents) up to stripe boundary size 8.00 MiB(2 extents).
  Volume "nvm/will_fail_creation_rmeta_0" is not active locally (volume_list activation filter?).

Comment 11 Roman Bednář 2018-08-07 11:12:56 UTC
Verified.


lvcreate --config activation/volume_list = ["test"] --type raid0_meta -L1G -n test vg
  Using default stripesize 64.00 KiB.
  Volume "vg/test_rmeta_0" is not active locally (volume_list activation filter?).


lvcreate --config activation/volume_list = ["test"] --type raid1 -L1G -n test vg
  Volume "vg/test_rmeta_0" is not active locally (volume_list activation filter?).


lvcreate --config activation/volume_list = ["test"] --type raid4 -L1G -n test vg
  Using default stripesize 64.00 KiB.
  Volume "vg/test_rmeta_0" is not active locally (volume_list activation filter?).


lvcreate --config activation/volume_list = ["test"] --type raid5 -L1G -n test vg
  Using default stripesize 64.00 KiB.
  Volume "vg/test_rmeta_0" is not active locally (volume_list activation filter?).


lvcreate --config activation/volume_list = ["test"] --type raid6 -L1G -n test vg
  Using default stripesize 64.00 KiB.
  Rounding size 1.00 GiB (256 extents) up to stripe boundary size <1.01 GiB(258 extents).
  Volume "vg/test_rmeta_0" is not active locally (volume_list activation filter?).


lvcreate --config activation/volume_list = ["test"] --type raid10 -L1G -n test vg
  Using default stripesize 64.00 KiB.
  Volume "vg/test_rmeta_0" is not active locally (volume_list activation filter?).



3.10.0-926.el7.x86_64

lvm2-2.02.180-2.el7    BUILT: Wed Aug  1 18:22:48 CEST 2018

Comment 13 errata-xmlrpc 2018-10-30 11:02:16 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, 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-2018:3193