lvm2: VG swaps to most recent disk if underlying PV has duplicate UUID and VG name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lvm2 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Won't Fix
|
Medium
|
Matthew Ruffell | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Undecided
|
Unassigned | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
On xenial with lvm2 2.02.133-1ubuntu10, if you say take a snapshot of a disk with an active VG, and attach that disk to the host, the VG will swap from the existing disk to the newly attached disk. This breaks mountpoints and directs writes to the wrong storage device.
Note this only happens in the edge case where the PV and VGs are absolute duplicates.
[Test]
Steps to reproduce:
1) Create a xenial instance.
2) Create a secondary disk and attach it.
3) Create a PV, VG and LV on the disk.
4) Run lsblk:
ubuntu@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vdb 253:16 0 2G 0 disk
└─test1-database 252:0 0 1.6G 0 lvm /mnt/database
5) Create a "snapshot" of this disk (cp -rp disk.qcow2 disk2.qcow2)
6) Attach disk2.qcow2. Check lsblk
ubuntu@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vdb 253:16 0 2G 0 disk
vdc 253:32 0 2G 0 disk
└─test1-database 252:0 0 1.6G 0 lvm
We can see the VG jumps from /dev/vdb to /dev/vdc, even though the system was
running at the time, and the VG was mounted.
[Regression Potential]
The risk of regression if we fix this issue is extreme.
The commits themselves are large and modify core LVM code, and change the behaviour of how disks are scanned and processed.
The commits introduce new configuration options.
The commits do not apply cleanly, and all of them require significant backporting, and quite a few dependencies.
Because of this, it would be far too risky to fix this for xenial, so I will mark this as wontfix.
[Other Info]
This was fixed in 2.02.153 by the following commits:
commit 49d9582bed338dc
Author: David Teigland <email address hidden>
Date: Tue Mar 29 13:29:39 2016 -0500
Subject: lvmcache: use active LVs and device sizes to choose between duplicates
Link: https:/
commit d4e434d1e6082ff
Author: David Teigland <email address hidden>
Date: Fri Apr 29 14:42:14 2016 -0500
Subject: pvs: new attr and field for unchosen duplicate device
Link: https:/
commit d3d13e134af1561
Author: David Teigland <email address hidden>
Date: Thu Feb 11 12:37:36 2016 -0600
Subject: lvmcache: process duplicate PVs directly
Link: https:/
commit 8b7a78c728be3b9
Author: David Teigland <email address hidden>
Date: Tue Feb 9 13:06:27 2016 -0600
Subject: lvmcache: improve duplicate PV handling
Link: https:/
commit 3d2fbfe243550b7
Author: David Teigland <email address hidden>
Date: Fri Jan 29 13:31:54 2016 -0600
Subject: lvmetad: set disabled flag when duplicate PVs are seen
Link: https:/
commit 9539ee809827a87
Author: David Teigland <email address hidden>
Date: Fri Jan 29 12:25:20 2016 -0600
Subject: lvmetad: set disabled flag in lvmetad if duplicate PVs are found
Link: https:/
The fixes are present in Ubuntu 16.10 and later, meaning xenial is the only impacted supported release.
Changed in lvm2 (Ubuntu Bionic): | |
status: | New → Fix Released |
Changed in lvm2 (Ubuntu Disco): | |
status: | New → Fix Released |
Changed in lvm2 (Ubuntu Eoan): | |
status: | New → Fix Released |
Changed in lvm2 (Ubuntu Focal): | |
status: | New → Fix Released |
Changed in lvm2 (Ubuntu Xenial): | |
status: | New → Won't Fix |
importance: | Undecided → Medium |
assignee: | nobody → Matthew Ruffell (mruffell) |
tags: | added: sts |