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 504871 - Add 'cling by tags' alloc policy so mirrored LV legs are not extended onto devices in different datacentres
Summary: Add 'cling by tags' alloc policy so mirrored LV legs are not extended onto de...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Alasdair Kergon
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On: 433768
Blocks: 687919
TreeView+ depends on / blocked
 
Reported: 2009-06-09 20:15 UTC by Issue Tracker
Modified: 2018-11-14 20:01 UTC (History)
11 users (show)

Fixed In Version: lvm2-2.02.82-1.el6
Doc Type: Enhancement
Doc Text:
Clone Of:
: 687919 (view as bug list)
Environment:
Last Closed: 2011-05-19 14:25:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0772 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2011-05-18 18:08:31 UTC

Description Issue Tracker 2009-06-09 20:15:21 UTC
Administrative overhead is big when mirroring in LVM. 
In the scenario of resizing a mirror solution it is possible that one
switches sides when extending.
So a volume can be existing of 
a) initial mirror on  1) PV datacenter 1 (leg 1)
                      2) PV datacenter 2 (leg 2)

when extending by adding new PV it might be that the setup looks like this

b) lvm-mirror  1) PV datacenter 1 (leg 1) - new PV datacenter (leg 2)
               2) PV datacenter 2 (leg 2) - new PV datacenter (leg 1)

This might with one datacenter and its disc arrays going down screw the whole
LV. This in principle should be checked and warned for at the resizing /
extending of mirrored LVM.
Also there should be a good best-practices guide in the documentation of
automating such tasks by naming of multipath devices ...

Rebuilding LVM Mirrors costs a lot of admin time (half day per cluster) 
and attention. This is very expensive and complex for all customers using
LVM based mirror. 

Have sanity checks for the extension and recreation of LVM mirrors consisting
of more then one PV per leg.

Comment 5 Alasdair Kergon 2009-06-09 22:31:48 UTC
Firstly we added '--alloc cling' which attempts to keep the allocations on the same PVs before looking on different ones.  It attempts this by default before trying other allocation modes, but if you use this on the cmdline it will fail to proceed if it cannot allocate in this fashion.

A pre-requisite for any solution is to tell LVM which PVs are in which datacentres.  pvchange --addtag provides a mechanism for this - add tag A to PVs in datacentre A and tag B to ones in datacentre B.

Then a solution would be for us to provide an extended 'cling' policy that checks for matching tags too.  Since tags can be used for many different things, we should probably have an lvm.conf setting providing a list of tag patterns to match against for this purpose.

So let's call this alloc policy cling_by_tags, insert it between ALLOC_CLING and ALLOC_NORMAL in the hierarchy, and have an lvm.conf pattern list metadata/cling_tags.

A quick little coding exercise for someone:-)

Comment 6 Alasdair Kergon 2009-06-09 22:52:31 UTC
Technical pointers: _check_cling() can still be used, but add a parameter to switch to use a new function _is_same_tag() in place of _is_same_pv().  This function can work through the lvm.conf tag list one-by-one and check for a match against both PVs simultaneously.

In _find_parallel_space() cling is set in both old and new cases, but when calling _check_cling, if ALLOC_CLING_BY_TAGS (or whatever better name we choose) is set this new parameter is set to invoke the new code.

Then just to add it to cmdline, doc/example.conf and relevant man pages.

Comment 10 Alasdair Kergon 2010-11-09 12:47:20 UTC
Code committed upstream for 2.02.77.

To test, divide the PVs into groups and use pvchange --addtag to add tags to them.  Define allocation/cling_tag_list in lvm.conf.  Create some LVs (striped or mirrored) that are split between the groups of PVs.  Use vgchange --alloc cling to tell the allocator to consider only PVs with matching tags.  Then check lvextend always allocates from the right tagged PVs.  Use -vvvv to watch the allocator in action, or pvs --segments -v  or lvs -o+devices to check the allocations that were made.

Comment 13 Alasdair Kergon 2010-11-09 13:09:31 UTC
See also bug 433768.

(Some of the implementation details differ from the ideas in comment #5 and comment #6 .)

Comment 20 Corey Marthaler 2011-03-14 21:35:40 UTC
[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g  35.66g A
  /dev/sdc1  taft lvm2 a-   135.66g  35.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g B
  /dev/sde1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g A

[root@taft-03 ~]# lvcreate -m 1 -n mirror -L 100G --nosync taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

# The 1st extend works as expected, only pvs with similar tags are matched
#  with existing leg PVs
[root@taft-03 ~]# lvextend -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized
[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 200.00g mirror_mlog  50.10 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdg1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

# The 2nd extend adds PVs that have different tags as there is not enough 
# space with matching tags. Is this expected or is the cmd supposed to fail?
[root@taft-03 ~]# lvextend -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 300.00 GiB
  Logical volume mirror successfully resized
[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 300.00g mirror_mlog  33.84 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      Iwi-ao 300.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      Iwi-ao 300.00g                    /dev/sdg1(0)
  [mirror_mimage_0] taft      Iwi-ao 300.00g                    /dev/sde1(0)
  [mirror_mimage_1] taft      Iwi-ao 300.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      Iwi-ao 300.00g                    /dev/sdd1(0)
  [mirror_mimage_1] taft      Iwi-ao 300.00g                    /dev/sdf1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

Comment 21 Corey Marthaler 2011-03-15 17:49:54 UTC
Here is a list of 9 cling/cling_by_tags cases that I tested and their results. I do not however know if the results are what's expected or not. Based on comment #19, further development for this feature is to be done for rhel6.2 (like adding lvconverts and lvcreates).

### Cases 1-7 were done with the following cling tag list in lvm.conf:
     cling_tag_list = [ "@A", "@B" ]

### Case 1. Mirror created w/ --alloc flag and enough PVs with tags for the extension to work

[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdc1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g B
  /dev/sde1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g A

[root@taft-03 ~]# lvcreate --alloc cling_by_tags -m 1 -n mirror -L 100G --nosync taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdh1(0)

[root@taft-03 ~]# lvextend --alloc cling_by_tags -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 200.00g mirror_mlog  50.12 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdg1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdh1(0)



### Case 2. Mirror created w/ --alloc flag and *not* enough PVs with tags for the extension to work

[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdc1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g C
  /dev/sde1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g C

[root@taft-03 ~]# lvcreate -m 1 -n mirror -L 100G --nosync --alloc cling taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdh1(0)

[root@taft-03 ~]# lvextend --alloc cling -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 32940 more required

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdh1(0)

[root@taft-03 ~]# lvextend --alloc cling_by_tags -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 32940 more required

[root@taft-03 ~]# lvextend  -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 32940 more required



### Case 3. Mirror created w/o --alloc flag and *not* enough PVs with tags for the extension to work

[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdc1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g C
  /dev/sde1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g C

[root@taft-03 ~]# lvcreate -m 1 -n mirror --nosync -L 100G taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

[root@taft-03 ~]# lvextend  -L +100G --alloc cling taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 32940 more required

[root@taft-03 ~]# lvextend  -L +100G --alloc cling_by_tags taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 32940 more required

[root@taft-03 ~]# lvextend  -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 200.00g mirror_mlog  51.03 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sde1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)



### Case 4. Mirror created w/ --alloc flag and enough PVs with tags for the extension to work

[root@taft-03 ~]# lvcreate --alloc cling -n mirror -L 100G --nosync -m 1 taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdh1(0)
  lv_home           vg_taft03 -wi-ao  25.64g                    /dev/sda2(8269)
  lv_root           vg_taft03 -wi-ao  32.30g                    /dev/sda2(0)
  lv_swap           vg_taft03 -wi-ao   9.81g                    /dev/sda2(14832)

[root@taft-03 ~]# lvextend  -L +100G --alloc cling taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 32940 more required

[root@taft-03 ~]# lvextend  -L +100G --alloc cling_by_tags taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 32940 more required



### Case 5. Mirror created w/o --alloc flag and enough PVs with tags for the extension to work

[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdc1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g B
  /dev/sde1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g A

[root@taft-03 ~]# lvcreate -m 1 -n mirror --nosync -L 100G taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

### Should this cling command have worked?
[root@taft-03 ~]# lvextend --alloc cling -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 200.00g mirror_mlog  50.16 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdg1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)


### Case 6. Simple creation w/ --alloc flag and enough PVs with tags for the creation to work
[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdc1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g C
  /dev/sde1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g A

[root@taft-03 ~]# lvcreate -m 1 --alloc cling -L 200G --nosync -n mirror taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

# Note that the PV tags were ignored
[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mimage_1] taft      iwi-ao 200.00g                    /dev/sde1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdc1(16470)

[root@taft-03 ~]# vgchange -an taft
  0 logical volume(s) in volume group "taft" now active
[root@taft-03 ~]# lvremove taft
  Logical volume "mirror" successfully removed

### Case 7. Simple creation w/ --alloc flag and enough PVs with tags for the creation to work
[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdc1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g C
  /dev/sde1  taft lvm2 a-   135.66g 135.66g B
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g A

[root@taft-03 ~]# lvcreate -m 1 --alloc cling_by_tags -L 200G --nosync -n mirror taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

# Note that the PV tags were ignored
[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mimage_1] taft      iwi-ao 200.00g                    /dev/sde1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdc1(16470)


### Cases 8-9 were done with *no* cling tag list in lvm.conf:

### Case 8. Mirror created w/o --alloc flag and enough PVs with tags for the extension to work

[root@taft-03 ~]# lvcreate -m 1 -n mirror --nosync -L 100G taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

# Should this have worked without matching tagged legs?
[root@taft-03 ~]# lvextend --alloc cling_by_tags -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwi-a- 200.00g mirror_mlog  50.05 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sde1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g      0  A
  /dev/sdc1  taft lvm2 a-   135.66g      0  B
  /dev/sdd1  taft lvm2 a-   135.66g  71.33g B
  /dev/sde1  taft lvm2 a-   135.66g  71.33g C
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g A


### Case 9. Mirror created w/ --alloc flag and enough PVs with tags for the extension to work

[root@taft-03 ~]# lvcreate -m 1 -n mirror --alloc cling --nosync -L 100G taft
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      iwi-ao 100.00g                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00g                    /dev/sdc1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdh1(0)

[root@taft-03 ~]# pvs -a -o +pv_tags /dev/sd[bcdefgh]1
  PV         VG   Fmt  Attr PSize   PFree   PV Tags
  /dev/sdb1  taft lvm2 a-   135.66g  35.66g A
  /dev/sdc1  taft lvm2 a-   135.66g  35.66g B
  /dev/sdd1  taft lvm2 a-   135.66g 135.66g B
  /dev/sde1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdf1  taft lvm2 a-   135.66g 135.66g C
  /dev/sdg1  taft lvm2 a-   135.66g 135.66g A
  /dev/sdh1  taft lvm2 a-   135.66g 135.66g A

# Should this have worked?
[root@taft-03 ~]# lvextend --alloc cling -L +100G taft/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized

[root@taft-03 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      Mwl-a- 200.00g mirror_mlog 50.05  mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdb1(0)
  [mirror_mimage_0] taft      Iwi-ao 200.00g                    /dev/sdd1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sdc1(0)
  [mirror_mimage_1] taft      Iwi-ao 200.00g                    /dev/sde1(0)
  [mirror_mlog]     taft      lwl-ao   4.00m                    /dev/sdh1(0)

Comment 22 errata-xmlrpc 2011-05-19 14:25:26 UTC
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 therefore 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-2011-0772.html


Note You need to log in before you can comment on or make changes to this bug.