Bug 875930
| Summary: | vgsplit can not split two device mirrors where the log and a leg share the same device | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | Jonathan Earl Brassow <jbrassow> |
| lvm2 sub component: | Mirroring and RAID (RHEL6) | QA Contact: | Cluster QE <mspqa-list> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | medium | CC: | agk, dwysocha, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, thornber, zkabelac |
| Version: | 6.4 | ||
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.107-1.el6 | Doc Type: | Bug Fix |
| Doc Text: |
No Documentation needed - command now works as expected.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-10-14 08:23:36 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1075263 | ||
|
Description
Corey Marthaler
2012-11-12 20:48:19 UTC
Any similar problems with raid? If you use --alloc anywhere to force the 2-device raid lay out, then yes, the same issue occurs in raid volumes as well. [root@virt-020 ~]# lvcreate --type raid5 -n raid -i 2 -L 100M seven /dev/sdc1 /dev/sdd1 Using default stripesize 64.00 KiB Rounding size (25 extents) up to stripe boundary size (26 extents). Insufficient suitable allocatable extents for logical volume raid: 28 more required [root@virt-020 ~]# lvcreate --alloc anywhere --type raid5 -n raid -i 2 -L 100M seven /dev/sdc1 /dev/sdd1 Using default stripesize 64.00 KiB Rounding size (25 extents) up to stripe boundary size (26 extents). Logical volume "raid" created [root@virt-020 ~]# vgsplit -n raid seven ten Physical volume /dev/sdc1 not in volume group seven I thought this bug would affect thin-p also, since it is possible to put data and metadata on the same device. However, the code ignores the thin pool metadata device in that case and it works when everything is on the same device. However, when thin-p sub-LVs are on different devices (i.e. the normal case), it doesn't work: [root@bp-01 ~]# vgsplit -n thin_pool vg vg_new Can't split pool data and metadata thin_pool between two Volume Groups. [root@bp-01 ~]# vgsplit -n thin_lv vg vg_new Cannot split: Nowhere to store metadata for new Volume Group Probably a separate bug for that. I'm sure it works fine if just PVs are specified. Fix committed upstream:
commit 76687f4cacd6ca3f8953d4ee915efc159838cd91
Author: Jonathan Brassow <jbrassow>
Date: Fri Apr 25 14:55:32 2014 -0500
WHATS_NEW: Add message for commit 9ac858f
WHATS_NEW for commit:
9ac858f vgsplit: Make vgsplit work on mirrors with leg and log on same PV
commit 9ac858fe6b56318cee821e86e4a5edede75d5134
Author: Jonathan Brassow <jbrassow>
Date: Fri Apr 25 14:53:34 2014 -0500
vgsplit: Make vgsplit work on mirrors with leg and log on same PV
Given a named mirror LV, vgsplit will look for the PVs that compose it
and move them to a new VG. It does this by first looking at the log
and then the legs. If the log is on the same device as one of the mirror
images, a problem occurs. This is because the PV is moved to the new VG
as the log is processed and thus cannot be found in the current VG when
the image is processed. The solution is to check and see if the PV we are
looking for has already been moved to the new VG. If so, it is not an
error.
[root@virt-122 ~]# pvscan PV /dev/sdb VG seven lvm2 [15.00 GiB / 15.00 GiB free] PV /dev/sdc VG seven lvm2 [15.00 GiB / 15.00 GiB free] PV /dev/sdd VG seven lvm2 [15.00 GiB / 15.00 GiB free] PV /dev/sde VG seven lvm2 [15.00 GiB / 15.00 GiB free] PV /dev/sdf VG seven lvm2 [15.00 GiB / 15.00 GiB free] PV /dev/sdg VG seven lvm2 [15.00 GiB / 15.00 GiB free] PV /dev/sdh VG seven lvm2 [15.00 GiB / 15.00 GiB free] PV /dev/vda2 VG vg_virt122 lvm2 [7.51 GiB / 0 free] PV /dev/sda lvm2 [15.00 GiB] Total: 9 [127.48 GiB] / in use: 8 [112.48 GiB] / in no VG: 1 [15.00 GiB] [root@virt-122 ~]# lvcreate -m 1 -n mirror1 -L 100M seven /dev/sdb /dev/sdc /dev/sdd Logical volume "mirror1" created [root@virt-122 ~]# lvcreate -m 1 -n mirror2 -L 100M seven /dev/sde /dev/sdf Logical volume "mirror2" created [root@virt-122 ~]# vgsplit -n mirror1 seven ten Logical volume seven/mirror1_mimage_0 (part of mirror1) must be inactive. [root@virt-122 ~]# vgsplit -n mirror2 seven ten Logical volume seven/mirror2_mimage_0 (part of mirror2) must be inactive. [root@virt-122 ~]# lvchange -an seven/mirror2 [root@virt-122 ~]# vgsplit -n mirror2 seven ten New volume group "ten" successfully split from "seven" [root@virt-122 ~]# vgs VG #PV #LV #SN Attr VSize VFree seven 5 1 0 wz--n- 74.98g 74.78g ten 2 1 0 wz--n- 29.99g 29.79g vg_virt122 1 2 0 wz--n- 7.51g 0 [root@virt-122 ~]# lvs -a LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert mirror1 seven mwi-a-m--- 100.00m mirror1_mlog 100.00 [mirror1_mimage_0] seven iwi-aom--- 100.00m [mirror1_mimage_1] seven iwi-aom--- 100.00m [mirror1_mlog] seven lwi-aom--- 4.00m mirror2 ten mwi---m--- 100.00m mirror2_mlog [mirror2_mimage_0] ten Iwi---m--- 100.00m [mirror2_mimage_1] ten Iwi---m--- 100.00m [mirror2_mlog] ten lwi---m--- 4.00m lv_root vg_virt122 -wi-ao---- 6.71g lv_swap vg_virt122 -wi-ao---- 816.00m The split worked as expected. The naming of the LV displayed in the error message from vgsplit is covered by a separate bug (Bug 1115004) marking VERIFIED with: lvm2-2.02.107-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 lvm2-libs-2.02.107-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 lvm2-cluster-2.02.107-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 udev-147-2.55.el6 BUILT: Wed Jun 18 13:30:21 CEST 2014 device-mapper-1.02.86-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 device-mapper-libs-1.02.86-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 device-mapper-event-1.02.86-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 device-mapper-event-libs-1.02.86-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 device-mapper-persistent-data-0.3.2-1.el6 BUILT: Fri Apr 4 15:43:06 CEST 2014 cmirror-2.02.107-2.el6 BUILT: Fri Jul 11 15:47:33 CEST 2014 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1387.html |