Description of problem: The lvcreate --addtag option does not work when creating a mirrored logical volume. [root@blx12ah01 ~]# grep "volume_list =" /etc/lvm/lvm.conf volume_list = [ "intvg00", "intvg01", "@blx12ah01e" ] [root@blx12ah01 ~]# lvcreate --addtag blx12ah01e -m 1 -L 2g -n yylv00 yyvg00 Aborting. Failed to activate mirror log. Remove new LVs and retry. Failed to create mirror log. [root@blx12ah01 ~]# lvs -a -o +tags | grep yylv00 yylv00_mlog yyvg00 -wi--- 4.00M Version-Release number of selected component (if applicable): lvm2-2.02.21-1.el4 How reproducible: Always
CREATES ======= We should at least be able to create the mirror if the tag is not present (even if it cannot be activated); and create and activate if the tag is present. The following commands illustrate the point: [root@kool ~]# grep volume_list /etc/lvm/lvm.conf # If volume_list is defined, each LV is only activated if there is a volume_list = [ "@kool" ] # Creates, but does not activate [as expected] [root@kool ~]# lvcreate -L 500M -n lv vg Failed to activate new LV. [root@kool ~]# lvremove -ff vg Logical volume "lv" successfully removed # Creates and activates [as expected] [root@kool ~]# lvcreate --addtag kool -L 500M -n lv vg Logical volume "lv" created [root@kool ~]# lvremove -ff vg Logical volume "lv" successfully removed # should create, but not activate [Fails to create] [root@kool ~]# lvcreate -m1 -L 500M -n lv vg Aborting. Failed to activate mirror log. Remove new LVs and retry. Failed to create mirror log. [root@kool ~]# lvremove -ff vg Logical volume "lv_mlog" successfully removed # should create, and activate [Fails both] [root@kool ~]# lvcreate --addtag kool -m1 -L 500M -n lv vg Aborting. Failed to activate mirror log. Remove new LVs and retry. Failed to create mirror log.
CONVERTS ======== Here we see that creation of transient log mirrors works as expected, but the conversion to a persistent log mirror fails. # Creates, but does not activate [as expected] [root@kool ~]# lvcreate --corelog -m1 -L 500M -n lv vg Failed to activate new LV. [root@kool ~]# lvremove -ff vg Logical volume "lv" successfully removed # Creates and activates [as expected] [root@kool ~]# lvcreate --addtag kool --corelog -m1 -L 500M -n lv vg Logical volume "lv" created # Should convert to persistent log [fails] [root@kool ~]# lvconvert -m1 vg/lv Aborting. Failed to activate mirror log. Remove new LVs and retry. Failed to create mirror log.
The above failure cases are a result of the fact that we create the sub-device (lv_mlog) without a tag and then try to activate it in order to initialize it - outside of its mirror context - before adding it to the mirror. It should be noted that you can successfully activate/deactivate a mirror with a persistent log once it has been created (with the proper tag) even though the sub-devices are not tagged.
*** Bug 228839 has been marked as a duplicate of this bug. ***
Fixed upstream. Fixed in 2.02.21-5.el4.rpm.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2007-0287.html
The lvm2-2.02.21-5.el4 RPM has only fixed half the problem. I can now create a mirrored logical volume if I use the --addtag flag: [root@clx12ah01 up2date]# grep volume_list /etc/lvm/lvm.conf # If volume_list is defined, each LV is only activated if there is a volume_list = [ "intvg00", "intvg01", "@clx12ah01" ] # # CREATE VOLUME WITH CORRECT TAG WORKS OK # [root@clx12ah01 up2date]# lvcreate --addtag clx12ah01 -m 1 -L 1g -n tagtest yyvg00 Logical volume "tagtest" created # # CREATE VOLUME WITHOUT SPECIFYING TAG STILL DOES NOT WORK # [root@clx12ah01 up2date]# lvcreate -m 1 -L 1g -n notagtest yyvg00 Aborting. Failed to activate mirror log. Remove new LVs and retry. Failed to create mirror log. Is it reasonable to expect that the untagged volume is created but not activated? If this is not possible due to mirror initialisation, shouldn't it fail more gracefully without leaving an orphaned mlog on the system?
An errata was filed for this issue and shipped live. If further issues are found, please open a new bugzilla. Moving back to CLOSED/ERRATA.