Bug 1300455 - RFE: allow pvmove to act on a pv tag or tags
RFE: allow pvmove to act on a pv tag or tags
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.2
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: David Teigland
cluster-qe@redhat.com
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-20 16:27 EST by Corey Marthaler
Modified: 2017-08-17 14:30 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Corey Marthaler 2016-01-20 16:27:08 EST
Description of problem:
[root@host-073 ~]# vgcreate VG /dev/sd[abcd]1
  Physical volume "/dev/sda1" successfully created
  Physical volume "/dev/sdc1" successfully created
  Physical volume "/dev/sdd1" successfully created
  Volume group "VG" successfully created

[root@host-073 ~]# pvchange --addtag FOO /dev/sda1
  Physical volume "/dev/sda1" changed
  1 physical volume changed / 0 physical volumes not changed
[root@host-073 ~]# pvchange --addtag BAR /dev/sdb1
  Physical volume "/dev/sdb1" changed
  1 physical volume changed / 0 physical volumes not changed

[root@host-073 ~]# pvs -a -o +pv_tags | grep VG
  PV                      VG            Fmt  Attr PSize  PFree  PV Tags
  /dev/sda1               VG            lvm2 a--  24.99g 24.99g FOO    
  /dev/sdb1               VG            lvm2 a--  24.99g 24.99g BAR    
  /dev/sdc1               VG            lvm2 a--  24.99g 24.99g        
  /dev/sdd1               VG            lvm2 a--  24.99g 24.99g        

[root@host-073 ~]# pvmove @FOO
  Physical volume @FOO not found
  Run `pvmove --help' for more information.

[root@host-073 ~]# pvmove /dev/sda1
  No data to move for VG


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

lvm2-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-libs-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-cluster-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015
cmirror-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
Comment 2 Peter Rajnoha 2016-06-03 09:53:29 EDT
pvmove now uses process_each_pv logic (since lvm2 v2.02.141) inside and as such, it recognizes PV tags now. So this scenario now works:

# vgcreate vg /dev/sda /dev/sdb
  Physical volume "/dev/sda" successfully created.
  Physical volume "/dev/sdb" successfully created.
  Volume group "vg" successfully created

# pvchange --addtag mytag /dev/sda
  Physical volume "/dev/sda" changed
  1 physical volume changed / 0 physical volumes not changed

# lvcreate -L100m vg /dev/sda
  Logical volume "lvol0" created.

# pvmove @mytag
  @mytag: Moved: 24.00%
  @mytag: Moved: 100.00%
Comment 3 Peter Rajnoha 2016-06-03 10:23:06 EDT
However, there are still issues in certain situations (I've filed that as upstream bug #1342564).
Comment 4 Peter Rajnoha 2016-06-06 07:02:40 EDT
Use of tags together with pvmove is disabled for now until we find complete solution for how this should work when a tag encompasses several devices.
I'm moving this back from POST.

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=b321d2b1b9a3b6a1f8d67888a04c7318aa3148c2

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