Merge ~raharper/curtin:fix/lvm-vgscan-no-mknodes into curtin:master

Proposed by Ryan Harper
Status: Merged
Approved by: Dan Watkins
Approved revision: 386422627c635c58091c7b559fd50016ba9987e6
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~raharper/curtin:fix/lvm-vgscan-no-mknodes
Merge into: curtin:master
Diff against target: 125 lines (+15/-15)
8 files modified
curtin/block/lvm.py (+1/-1)
examples/tests/multipath-lvm-part-wipe.yaml (+2/-2)
examples/tests/multipath-lvm.yaml (+2/-2)
examples/tests/preserve-lvm.yaml (+2/-2)
examples/tests/preserve-partition-wipe-vg-simple.yaml (+2/-2)
examples/tests/preserve-partition-wipe-vg.yaml (+2/-2)
examples/tests/reuse-lvm-member-partition.yaml (+2/-2)
tests/unittests/test_block_lvm.py (+2/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Dan Watkins (community) Approve
Review via email: mp+383141@code.launchpad.net

Commit message

lvm: don't use vgscan --mknodes

vgscan --mknodes has a bug which creates block device nodes for any
entry in dmsetup table if it doesn't exist yet. This breaks the
assumption that /dev/mapper entries are symlinks created by udev.
Until upstream RHBZ: #1828617 is resolved do not use --mknodes.

To post a comment you must log in.
Revision history for this message
Dan Watkins (oddbloke) wrote :

I've confirmed that this removes all "--mknodes" references. Thanks!

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/lvm.py b/curtin/block/lvm.py
2index 1edc587..da29c7b 100644
3--- a/curtin/block/lvm.py
4+++ b/curtin/block/lvm.py
5@@ -129,7 +129,7 @@ def lvm_scan(activate=True, multipath=False):
6 # only operate on mp devices
7 mponly = 'devices{ filter = [ "a|/dev/mapper/mpath.*|", "r|.*|" ] }'
8
9- for cmd in [['pvscan'], ['vgscan', '--mknodes']]:
10+ for cmd in [['pvscan'], ['vgscan']]:
11 if release != 'precise' and lvmetad_running():
12 cmd.append('--cache')
13 if multipath:
14diff --git a/examples/tests/multipath-lvm-part-wipe.yaml b/examples/tests/multipath-lvm-part-wipe.yaml
15index bfe39ea..0b22aa3 100644
16--- a/examples/tests/multipath-lvm-part-wipe.yaml
17+++ b/examples/tests/multipath-lvm-part-wipe.yaml
18@@ -29,8 +29,8 @@ bucket:
19 udevadm settle
20 ls -al /dev/disk/by-id
21 vgcreate --force --zero=y --yes root_vg /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk-a-part3
22- pvscan --cache
23- vgscan --verbose --mknodes --cache
24+ pvscan --verbose
25+ vgscan --verbose
26 udevadm settle
27 for x in $(seq 1 10); do
28 if vgs root_vg; then
29diff --git a/examples/tests/multipath-lvm.yaml b/examples/tests/multipath-lvm.yaml
30index 68c3271..fd5ea07 100644
31--- a/examples/tests/multipath-lvm.yaml
32+++ b/examples/tests/multipath-lvm.yaml
33@@ -28,8 +28,8 @@ bucket:
34 udevadm settle
35 ls -al /dev/disk/by-id
36 vgcreate --force --zero=y --yes root_vg /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk-a-part2
37- pvscan --cache
38- vgscan --verbose --mknodes --cache
39+ pvscan --verbose
40+ vgscan --verbose
41 udevadm settle
42 for x in $(seq 1 10); do
43 if vgs root_vg; then
44diff --git a/examples/tests/preserve-lvm.yaml b/examples/tests/preserve-lvm.yaml
45index 046d6b4..a939759 100644
46--- a/examples/tests/preserve-lvm.yaml
47+++ b/examples/tests/preserve-lvm.yaml
48@@ -10,8 +10,8 @@ bucket:
49 udevadm settle
50 ls -al /dev/disk/by-id
51 vgcreate --force --zero=y --yes root_vg /dev/disk/by-id/virtio-disk-a-part2
52- pvscan --cache
53- vgscan --mknodes --cache
54+ pvscan --verbose
55+ vgscan --verbose
56 lvcreate root_vg --name lv1_root --zero=y --wipesignatures=y \
57 --size 3758096384B
58 udevadm settle
59diff --git a/examples/tests/preserve-partition-wipe-vg-simple.yaml b/examples/tests/preserve-partition-wipe-vg-simple.yaml
60index 662f34f..e1f0b9e 100644
61--- a/examples/tests/preserve-partition-wipe-vg-simple.yaml
62+++ b/examples/tests/preserve-partition-wipe-vg-simple.yaml
63@@ -10,8 +10,8 @@ bucket:
64 udevadm settle
65 ls -al /dev/disk/by-id
66 vgcreate --force --zero=y --yes root_vg /dev/disk/by-id/virtio-disk-a-part2
67- pvscan --cache
68- vgscan --mknodes --cache
69+ pvscan --verbose
70+ vgscan --verbose
71 vgs
72 lvcreate root_vg --name lv1_root --zero=y --wipesignatures=y \
73 --size 2G
74diff --git a/examples/tests/preserve-partition-wipe-vg.yaml b/examples/tests/preserve-partition-wipe-vg.yaml
75index cef9678..97686e1 100644
76--- a/examples/tests/preserve-partition-wipe-vg.yaml
77+++ b/examples/tests/preserve-partition-wipe-vg.yaml
78@@ -15,8 +15,8 @@ bucket:
79 udevadm settle
80 ls -al /dev/disk/by-id
81 vgcreate --force --zero=y --yes vg8 /dev/disk/by-id/virtio-disk-b-part1
82- pvscan --cache
83- vgscan --mknodes --cache
84+ pvscan --verbose
85+ vgscan --verbose
86 udevadm settle
87 ls -al /dev/disk/by-id
88 mkfs.ext4 /dev/disk/by-id/virtio-disk-a-part3
89diff --git a/examples/tests/reuse-lvm-member-partition.yaml b/examples/tests/reuse-lvm-member-partition.yaml
90index d2f73ba..fd8f602 100644
91--- a/examples/tests/reuse-lvm-member-partition.yaml
92+++ b/examples/tests/reuse-lvm-member-partition.yaml
93@@ -25,8 +25,8 @@ bucket:
94 mkpart primary 2GiB 9GiB
95 udevadm settle
96 vgcreate --verbose --force --zero=y --yes ${VG} ${SDA}-part2 ${SDB}-part1
97- pvscan --verbose --cache
98- vgscan --verbose --mknodes
99+ pvscan --verbose
100+ vgscan --verbose
101 # create a striped lv
102 lvcreate ${VG} --extents 100%FREE --stripes 2 --stripesize 256 \
103 --name ${LV}
104diff --git a/tests/unittests/test_block_lvm.py b/tests/unittests/test_block_lvm.py
105index 842511c..ff58b30 100644
106--- a/tests/unittests/test_block_lvm.py
107+++ b/tests/unittests/test_block_lvm.py
108@@ -76,7 +76,7 @@ class TestBlockLvm(CiTestCase):
109 @mock.patch('curtin.block.lvm.distro')
110 def test_lvm_scan(self, mock_distro, mock_util, mock_lvmetad):
111 """check that lvm_scan formats commands correctly for each release"""
112- cmds = [['pvscan'], ['vgscan', '--mknodes']]
113+ cmds = [['pvscan'], ['vgscan']]
114 for (count, (codename, lvmetad_status, use_cache)) in enumerate(
115 [('precise', False, False),
116 ('trusty', False, False),
117@@ -100,7 +100,7 @@ class TestBlockLvm(CiTestCase):
118 @mock.patch('curtin.block.lvm.distro')
119 def test_lvm_scan_multipath(self, mock_distro, mock_util, mock_lvmetad):
120 """check that lvm_scan formats commands correctly for multipath."""
121- cmds = [['pvscan'], ['vgscan', '--mknodes']]
122+ cmds = [['pvscan'], ['vgscan']]
123 mock_distro.lsb_release.return_value = {'codename': 'focal'}
124 mock_lvmetad.return_value = False
125 lvm.lvm_scan(multipath=True)

Subscribers

People subscribed via source and target branches