Public bug reported:

[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 49d9582bed338dc555b616bcc9de20fafd00ce2d
Author: David Teigland <teigl...@redhat.com>
Date: Tue Mar 29 13:29:39 2016 -0500
Subject: lvmcache: use active LVs and device sizes to choose between duplicates
Link: 
https://github.com/lvmteam/lvm2/commit/49d9582bed338dc555b616bcc9de20fafd00ce2d

commit d4e434d1e6082ff4d448f4fbc03962c6f0926da4
Author: David Teigland <teigl...@redhat.com>
Date: Fri Apr 29 14:42:14 2016 -0500
Subject: pvs: new attr and field for unchosen duplicate device
Link: 
https://github.com/lvmteam/lvm2/commit/d4e434d1e6082ff4d448f4fbc03962c6f0926da4

commit d3d13e134af15611c3f12107aa1627b12110a974
Author: David Teigland <teigl...@redhat.com>
Date: Thu Feb 11 12:37:36 2016 -0600
Subject: lvmcache: process duplicate PVs directly
Link: 
https://github.com/lvmteam/lvm2/commit/d3d13e134af15611c3f12107aa1627b12110a974

commit 8b7a78c728be3b9af698dae9344d01752c4cf615
Author: David Teigland <teigl...@redhat.com>
Date: Tue Feb 9 13:06:27 2016 -0600
Subject: lvmcache: improve duplicate PV handling
Link: 
https://github.com/lvmteam/lvm2/commit/8b7a78c728be3b9af698dae9344d01752c4cf615

commit 3d2fbfe243550b7801165f393d27e35044c1a56d
Author: David Teigland <teigl...@redhat.com>
Date: Fri Jan 29 13:31:54 2016 -0600
Subject: lvmetad: set disabled flag when duplicate PVs are seen
Link: 
https://github.com/lvmteam/lvm2/commit/3d2fbfe243550b7801165f393d27e35044c1a56d

commit 9539ee809827a870c88d02cfb2d0dc1e3eaac0d0
Author: David Teigland <teigl...@redhat.com>
Date: Fri Jan 29 12:25:20 2016 -0600
Subject: lvmetad: set disabled flag in lvmetad if duplicate PVs are found
Link: 
https://github.com/lvmteam/lvm2/commit/9539ee809827a870c88d02cfb2d0dc1e3eaac0d0 

The fixes are present in Ubuntu 16.10 and later, meaning xenial is the
only impacted supported release.

** Affects: lvm2 (Ubuntu)
     Importance: Undecided
         Status: Fix Released

** Affects: lvm2 (Ubuntu Xenial)
     Importance: Medium
     Assignee: Matthew Ruffell (mruffell)
         Status: Won't Fix

** Affects: lvm2 (Ubuntu Bionic)
     Importance: Undecided
         Status: Fix Released

** Affects: lvm2 (Ubuntu Disco)
     Importance: Undecided
         Status: Fix Released

** Affects: lvm2 (Ubuntu Eoan)
     Importance: Undecided
         Status: Fix Released

** Affects: lvm2 (Ubuntu Focal)
     Importance: Undecided
         Status: Fix Released


** Tags: sts

** Also affects: lvm2 (Ubuntu Xenial)
   Importance: Undecided
       Status: New

** Also affects: lvm2 (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Also affects: lvm2 (Ubuntu Disco)
   Importance: Undecided
       Status: New

** Also affects: lvm2 (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Also affects: lvm2 (Ubuntu Eoan)
   Importance: Undecided
       Status: New

** 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

** Changed in: lvm2 (Ubuntu Xenial)
   Importance: Undecided => Medium

** Changed in: lvm2 (Ubuntu Xenial)
     Assignee: (unassigned) => Matthew Ruffell (mruffell)

** Tags added: sts

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1869831

Title:
  lvm2: VG swaps to most recent disk if underlying PV has duplicate UUID
  and VG name

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/1869831/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to