Description of problem:
When a thin pool is prevented from being activated, the creation fails (as expected) but a non-expected side effects happen. There are two abort messages, and a leftover of a linear 4 MB LV (a failed pool metadata LV creation attempt) is present on the system.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Edit volume_list in such a way that a new pool cannot be activated.
2. Create (or attempt to) a new thin pool:
lvcreate -T vg/thin_pool2 -L1G
Two "Aborting.." messages displayed:
[root@virt-147 ~]# lvcreate -T vg/thin_pool2 -L1G
Volume "vg/thin_pool2" is not active locally.
Aborting. Failed to wipe pool metadata thin_pool2.
Aborting. Could not deactivate pool thin_pool2.
[root@virt-147 ~]# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data vg Vwi---tz-- 1.00g thin_pool
[lvol0_pmspare] vg ewi------- 4.00m
newpool vg -wi------- 4.00m
other vg -wi-a----- 1.00g
thin_pool vg twi---tz-- 1.00g
thin_pool2 vg -wi------- 4.00m
[thin_pool_tdata] vg Twi------- 1.00g
[thin_pool_tmeta] vg ewi------- 4.00m
lv_root vg_virt147 -wi-ao---- 6.71g
lv_swap vg_virt147 -wi-ao---- 816.00m
Pool creation fails and a linear LV is there with its name instead.
If a thin pool creation fails, or is not permitted by configuration any leftover devices should be removed, especially the ones which hold the name of a thin pool which was expected to be created in the first place.
This may not be an isolated case to thin pools though, maybe other parts of LV creation are affected, but it is easiest to reproduce with thin pools.
Yep - Just needs another test for active device after activation - easy to fix in this particular place - it's just how many other cases needs the similar test
Fix verified in the latest rpms.
lvm2-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
lvm2-libs-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
lvm2-cluster-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
udev-147-2.61.el6 BUILT: Mon Mar 2 05:08:11 CST 2015
device-mapper-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-libs-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-event-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-event-libs-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-persistent-data-0.3.2-1.el6 BUILT: Fri Apr 4 08:43:06 CDT 2014
cmirror-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015
SCENARIO - [aborted_create_attempt]
Aborted thin pool creation check
Editing volume_list tag section
Making origin volume
lvcreate --thinpool POOL --zero n -L 1G snapper_thinp
Volume "snapper_thinp/lvol0" is not active locally.
Aborting. Failed to wipe start of new LV.
couldn't create thinpool
Check for left over devices...
Restoring default volume_list section
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.