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 687919 - Part II: Extend 'cling by tags' alloc policy to work everywhere
Summary: Part II: Extend 'cling by tags' alloc policy to work everywhere
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Alasdair Kergon
QA Contact: Corey Marthaler
URL:
Whiteboard:
: 684929 (view as bug list)
Depends On: 433768 504871 821007
Blocks: 756082 1268411
TreeView+ depends on / blocked
 
Reported: 2011-03-15 17:55 UTC by Corey Marthaler
Modified: 2019-04-16 13:59 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
The space allocated to each mirror leg can be taken from separate sets of Physical Volumes by adding tags to those volumes and making use of the so-called 'cling by tags' allocation policy. Prior to this release, this policy only had an effect when extending existing Logical Volumes. Now, it works in all operations that allocate space, which includes lvcreate and lvconvert that create or restructure Logical Volumes.
Clone Of: 504871
Environment:
Last Closed: 2016-01-20 18:02:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 1 Corey Marthaler 2011-03-15 17:57:16 UTC
*** Bug 684929 has been marked as a duplicate of this bug. ***

Comment 3 Alasdair Kergon 2012-01-05 02:42:54 UTC
Allocation policies are tried in order, allocating as much as possible before moving onto the next in the list.  The value of --alloc says when to stop.

The order is: contiguous, cling, normal, anywhere.

The default place to stop is 'normal'.

--alloc cling is always followed by an attempt to cling by tags if tags were defined.

The first part of this work went into 6.2 under Bug #504871 .

It was extended in upstream version 2.02.85 and it is this updated version that should go into 6.3.

The test cases that gave bad results before, will hopefully behave as expected now.

Comment 4 Corey Marthaler 2012-01-10 00:24:02 UTC
Adding QA ack for 6.3. 

Devel will need to provide unit testing results however before this bug can be
ultimately verified by QA.

Comment 6 Alasdair Kergon 2012-05-02 15:58:09 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The space allocated to each mirror leg can be taken from separate sets of Physical Volumes by adding tags to those volumes and making use of the so-called 'cling by tags' allocation policy.

Prior to this release, this policy only had an effect when extending existing Logical Volumes.  Now, it works in all operations that allocate space, which includes lvcreate and lvconvert that create or restructure Logical Volumes.

Comment 7 Corey Marthaler 2012-05-09 21:27:06 UTC
It still doesn't appear that creation works in the latest 6.3 rpms.
lvm2-2.02.95-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012


# lvm.conf:

     cling_tag_list = [ "@A", "@B" ]


[root@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p[1234567]
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  825.66g 825.66g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  825.66g 825.66g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  825.66g 825.66g B      
  /dev/etherd/e1.1p4 hayes lvm2 a--  825.66g 825.66g C      
  /dev/etherd/e1.1p5 hayes lvm2 a--  825.66g 825.66g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  825.66g 825.66g A      
  /dev/etherd/e1.1p7 hayes lvm2 a--  825.66g 825.66g A      

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

[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize    Log         Copy%   TAG Devices
  mirror            hayes  Mwl-a-m- 1000.00g mirror_mlog 100.00      mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 1000.00g                     A   /dev/etherd/e1.1p1(0)
  [mirror_mimage_0] hayes  iwl-aom- 1000.00g                     B   /dev/etherd/e1.1p3(0)
  [mirror_mimage_1] hayes  iwl-aom- 1000.00g                     B   /dev/etherd/e1.1p2(0)
  [mirror_mimage_1] hayes  iwl-aom- 1000.00g                     C   /dev/etherd/e1.1p4(0)
  [mirror_mlog]     hayes  lwl-aom-    4.00m                     A   /dev/etherd/e1.1p7(0)

Comment 8 Alasdair Kergon 2012-05-10 01:07:29 UTC
That example isn't even reaching the new cling by tags code!

It looks to be triggering a pre-existing problem with --alloc cling.

If you use lvcreate to create a simple linear device that is too large to fit on any single PV, the creation succeeds with --alloc cling.

Comment 9 Alasdair Kergon 2012-05-10 02:42:55 UTC
I have a fix for the old --alloc cling problem and the comment #7 test case now passes.  ('cling' sometimes got treated like 'normal')

Comment 10 Corey Marthaler 2012-05-10 21:27:47 UTC
I retried all the old 6.2 test cases for this feature and found no difference in bahavior from then to now. The extensions still appear to ignore PV tags.

Also, the cling creation and cling conversion mentioned in bug 684929 still doesn't exist in these rpms.

A condition of the QA ack for this feature was a better definition of what exactly was "fixed" or "added" along with development test results to prove that, but to date I see don't see either of those.

Marking this FailedQA.

2.6.32-269.el6.x86_64
lvm2-2.02.95-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012
lvm2-libs-2.02.95-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012
lvm2-cluster-2.02.95-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012
udev-147-2.41.el6    BUILT: Thu Mar  1 13:01:08 CST 2012
device-mapper-1.02.74-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012
device-mapper-libs-1.02.74-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012
device-mapper-event-1.02.74-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012
device-mapper-event-libs-1.02.74-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012
cmirror-2.02.95-8.el6    BUILT: Wed May  9 03:33:32 CDT 2012



### 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@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g A      
[root@hayes-01 ~]# lvcreate --alloc cling_by_tags -m 1 -n mirror -L 100G --nosync hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwl-a-m- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_1] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)
[root@hayes-01 ~]# lvextend --alloc cling_by_tags -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwl-a-m- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p6(0)
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p3(0)
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)

# CASE 2: Mirror created w/ --alloc flag and *not* enough PVs with tags for the extension to work
[root@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g C      
[root@hayes-01 ~]# lvcreate -m 1 -n mirror -L 100G --nosync --alloc cling hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwl-a-m- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_1] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)
[root@hayes-01 ~]# lvextend --alloc cling -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 33282 more required
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwl-a-m- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_1] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)
[root@hayes-01 ~]# lvextend --alloc cling_by_tags -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 33282 more required
[root@hayes-01 ~]# lvextend  -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 33282 more required

# CASE 3: Mirror created w/o --alloc flag and *not* enough PVs with tags for the extension to work
[root@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g C      
[root@hayes-01 ~]# lvcreate -m 1 -n mirror --nosync -L 100G hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]# 
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwi-a-m- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwi-aom- 100.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_1] hayes  iwi-aom- 100.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mlog]     hayes  lwi-aom-   4.00m                    /dev/etherd/e1.1p7(0)
[root@hayes-01 ~]# lvextend  -L +100G --alloc cling hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 33282 more required
[root@hayes-01 ~]# lvextend  -L +100G --alloc cling_by_tags hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Insufficient suitable allocatable extents for logical volume mirror: 33282 more required
[root@hayes-01 ~]# lvextend  -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwi-a-m- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_0] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p3(0)
  [mirror_mimage_1] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mimage_1] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p4(0)
  [mirror_mlog]     hayes  lwi-aom-   4.00m                    /dev/etherd/e1.1p7(0)

# CASE 5: Mirror created w/o --alloc flag and enough PVs with tags for the extension to work
[root@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g A      
[root@hayes-01 ~]# lvcreate -m 1 -n mirror --nosync -L 100G hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwi-a-m- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwi-aom- 100.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_1] hayes  iwi-aom- 100.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mlog]     hayes  lwi-aom-   4.00m                    /dev/etherd/e1.1p7(0)
[root@hayes-01 ~]# lvextend --alloc cling -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwi-a-m- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_0] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p6(0)
  [mirror_mimage_1] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mimage_1] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p3(0)
  [mirror_mlog]     hayes  lwi-aom-   4.00m                    /dev/etherd/e1.1p7(0)

# CASE 6: Simple creation w/ --alloc flag and enough PVs with tags for the creation to work
[root@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g A      
[root@hayes-01 ~]#  lvcreate -m 1 --alloc cling -L 200G --nosync -n mirror hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwl-a-m- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p3(0)
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p4(0)
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)
# Note that the PV tags were * STILL* ignored


# CASE 7: Simple creation w/ --alloc flag and enough PVs with tags for the creation to work
[root@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g A      
[root@hayes-01 ~]# lvcreate -m 1 --alloc cling_by_tags -L 200G --nosync -n mirror hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]#  lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices                              
  mirror            hayes  Mwl-a-m- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p1(0)                
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p3(0)                
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p2(0)                
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p4(0)                
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)                


### 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@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g A      
[root@hayes-01 ~]# lvcreate -m 1 -n mirror --nosync -L 100G hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwi-a-m- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwi-aom- 100.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_1] hayes  iwi-aom- 100.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mlog]     hayes  lwi-aom-   4.00m                    /dev/etherd/e1.1p7(0)
[root@hayes-01 ~]# lvextend --alloc cling_by_tags -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwi-a-m- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_0] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p3(0)
  [mirror_mimage_1] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mimage_1] hayes  iwi-aom- 200.00g                    /dev/etherd/e1.1p4(0)
  [mirror_mlog]     hayes  lwi-aom-   4.00m                    /dev/etherd/e1.1p7(0)

# CASE 9: Mirror created w/ --alloc flag and enough PVs with tags for the extension to work
[root@hayes-01 ~]# pvs -a -o +pv_tags /dev/etherd/e1.1p*
  PV                 VG    Fmt  Attr PSize   PFree   PV Tags
  /dev/etherd/e1.1p1 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p2 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p3 hayes lvm2 a--  135.00g 135.00g B      
  /dev/etherd/e1.1p4 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p5 hayes lvm2 a--  135.00g 135.00g C      
  /dev/etherd/e1.1p6 hayes lvm2 a--  135.00g 135.00g A      
  /dev/etherd/e1.1p7 hayes lvm2 a--  135.00g 135.00g A      
[root@hayes-01 ~]# lvcreate -m 1 -n mirror --alloc cling --nosync -L 100G hayes
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "mirror" created
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwl-a-m- 100.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_1] hayes  iwl-aom- 100.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)
[root@hayes-01 ~]# lvextend --alloc cling -L +100G hayes/mirror
  Extending 2 mirror images.
  Extending logical volume mirror to 200.00 GiB
  Logical volume mirror successfully resized
[root@hayes-01 ~]# lvs -a -o +devices
  LV                VG     Attr     LSize   Log         Copy%  Devices
  mirror            hayes  Mwl-a-m- 200.00g mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p1(0)
  [mirror_mimage_0] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p3(0)
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p2(0)
  [mirror_mimage_1] hayes  iwl-aom- 200.00g                    /dev/etherd/e1.1p4(0)
  [mirror_mlog]     hayes  lwl-aom-   4.00m                    /dev/etherd/e1.1p7(0)

Comment 12 Alasdair Kergon 2012-05-11 14:44:57 UTC
The underlying problem here is that the existing cling policy (before cling_by_tags) behaves like the normal policy when there is no preceding segment, which is wrong.  Bug 821007 opened for that problem, too late now for 6.3.

Comment 13 Alasdair Kergon 2012-05-11 23:41:33 UTC
First case (comment #7) is fixed upstream by bug 821007.
Will check later if the other cases raise any different issues.

Comment 15 Corey Marthaler 2012-08-15 22:10:12 UTC
Are any of the other cases in comment #10 expected to be fixed by this in 6.4?

Comment 19 Alasdair Kergon 2015-10-23 15:18:16 UTC
This is asking for comment #10 to be reviewed, to see whether everything is fixed now or not.  If any remaining problems are found, they should be forked off onto separate bugzillas like we did with the cases we already fixed, then this one can be closed.

Comment 20 Alasdair Kergon 2016-01-20 18:02:45 UTC
I can't spot any more cases that are failing so I'm closing this.

If any further cases that don't work are found, please open new bugs.


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