Hide Forgot
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
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%
However, there are still issues in certain situations (I've filed that as upstream bug #1342564).
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