Bug 1954247
| Summary: | New udev rule and systemd unit for VG autoactivation | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | David Teigland <teigland> | ||||||
| Component: | lvm2 | Assignee: | David Teigland <teigland> | ||||||
| lvm2 sub component: | Activating existing Logical Volumes | QA Contact: | cluster-qe <cluster-qe> | ||||||
| Status: | CLOSED CURRENTRELEASE | Docs Contact: | |||||||
| Severity: | unspecified | ||||||||
| Priority: | urgent | CC: | agk, cmarthal, heinzm, jbrassow, lmiksik, mcsontos, msnitzer, prajnoha, zkabelac | ||||||
| Version: | 9.0 | Keywords: | Triaged | ||||||
| Target Milestone: | beta | Flags: | pm-rhel:
mirror+
|
||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | lvm2-2.03.13-1.el9 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2021-12-07 21:42:00 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: | |||||||||
| Attachments: |
|
||||||||
|
Description
David Teigland
2021-04-27 19:08:06 UTC
Currently in dev-next branch The mechanism has changed a bit since the original description. The udev rule now uses systemd-run vgchange -aay instead of systemctl start lvm-vchange@ (where this service runs vchange -aay). For testing, the main things I can think of that are related to this: - various kinds of devices that people put PVs on, physical and virtual (md, mpath, crypt). - the number of PVs that need to be attached before the VG can be autoactivated (1 to many, e.g. 1000). - PVs being attached concurrently (so the pvscans are running at the same time) vs sequentially over time. - the number of PVs that hold metadata (1 to all). - the autoactivated VG containing a number of LVs that require monitoring, which means the vgchange needs to interact with dmeventd. - the autoactivated VG containing LVs that need to continue polling upon being activated (e.g. a snapshot merge) which means vgchange needs to interact with lvmpolld. - that event_activation=0 in lvm.conf prevents the VG from being autoactivated when the devices are attached on a running system (the VG would still be autoactivated by lvm2-activation-* services during system startup.) There are three ways to trigger the device attachment uevents which exercise these features: 1. actually reboot the machine 2. echo 1 > /sys/block/<devname>/device/delete; echo "- - -" > /sys/class/scsi_host/<host>/scan 3. udevadm trigger -c add /sys/block/<dev> 1 is the most realistic, but is most time consuming and hard to control. It might reveal some issues that wouldn't be seen otherwise related to interactions with other system startup steps. 2 is a pretty realistic, and I'm not sure what downsides it might have. 3 is probably the quickest and simple to do from a test script (this is what I use in udev-pvscan-vgchange.sh). bug 1954256 involves making similar changes in dracut It doesn't matter to me, it might be better to ask Corey. There might be some problems applying dev-next commits onto 2.03.12 since that will be about 3 months old. Created attachment 1817175 [details]
test results
Results of
make check_local LVM_TEST_DEVICE_LIST=/tmp/devs T=shell/udev-pvscan-vgchange.sh
Created attachment 1817176 [details]
test results
Results of
make check_devicesfile LVM_TEST_DEVICE_LIST=/tmp/devs T=shell/udev-pvscan-vgchange.sh
Setting verified:tested based on Corey's request in comment 4 and test results in comments 13 and 14. Marking Verified in the latest rpms. kernel-5.14.0-1.2.1.el9 BUILT: Fri Sep 17 02:57:25 AM CDT 2021 lvm2-2.03.13-2.el9_b BUILT: Fri Sep 17 10:55:56 AM CDT 2021 lvm2-libs-2.03.13-2.el9_b BUILT: Fri Sep 17 10:55:56 AM CDT 2021 I create many of the stacks mentioned in comment #2, md raid, crypt, PVs on lvm linear, snapshots, snapshots with merges pending, partial raids and partial mirrors, and all of them (with the exception of dm-mirrors) were auto mounted on reboot. [root@hayes-02 bin]# lvs -a -o +devices,autoactivation WARNING: Couldn't find device with uuid 7d6xza-gHUI-QZpc-JnpR-I4PH-bTUN-C3Ru5t. WARNING: VG mirror_vg is missing PV 7d6xza-gHUI-QZpc-JnpR-I4PH-bTUN-C3Ru5t (last written to /dev/sdh1). WARNING: Couldn't find all devices for LV mirror_vg/auto_mirror_mimage_1 while checking used and assumed devices. WARNING: Couldn't find all devices for LV mirror_vg/auto_mirror_mlog while checking used and assumed devices. LV VG Attr LSize Origin Data% Meta% Move Log Cpy%Sync Devices AutoAct linear base_stack_vg -wi-ao---- 600.00m /dev/sdf1(0) enabled linear crypt_vg Owi---s--- 600.00m /dev/mapper/auto(0) enabled [snap2] crypt_vg Swi---s--- 8.00m linear /dev/mapper/auto(150) enabled linear default_vg owi-a-s--- 600.00m /dev/sde1(0) enabled snap3 default_vg swi-a-s--- 8.00m linear 0.00 /dev/sde1(150) enabled linear md_vg owi-a-s--- 600.00m /dev/md127(0) enabled snap1 md_vg swi-a-s--- 8.00m linear 0.00 /dev/md127(150) enabled auto_mirror mirror_vg mwi-a-m-p- 100.00m [auto_mirror_mlog] 100.00 auto_mirror_mimage_0(0),auto_mirror_mimage_1(0) enabled [auto_mirror_mimage_0] mirror_vg iwi-aom--- 100.00m /dev/sdg1(0) enabled [auto_mirror_mimage_1] mirror_vg iwi-aom-p- 100.00m [unknown](0) enabled [auto_mirror_mlog] mirror_vg lwi-aom-p- 4.00m [unknown](25) enabled # REBOOT [root@hayes-02 ~]# lvs -a -o +devices,autoactivation WARNING: Couldn't find device with uuid 7d6xza-gHUI-QZpc-JnpR-I4PH-bTUN-C3Ru5t. WARNING: VG mirror_vg is missing PV 7d6xza-gHUI-QZpc-JnpR-I4PH-bTUN-C3Ru5t (last written to /dev/sdh1). LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices AutoAct linear base_stack_vg -wi-a----- 600.00m /dev/sdf1(0) enabled linear crypt_vg -wi-a----- 600.00m /dev/mapper/auto(0) enabled linear default_vg owi-a-s--- 600.00m /dev/sde1(0) enabled snap3 default_vg swi-a-s--- 8.00m linear 0.00 /dev/sde1(150) enabled linear md_vg owi-a-s--- 600.00m /dev/md127(0) enabled snap1 md_vg swi-a-s--- 8.00m linear 0.00 /dev/md127(150) enabled auto_mirror mirror_vg mwi---m-p- 100.00m [auto_mirror_mlog] auto_mirror_mimage_0(0),auto_mirror_mimage_1(0) enabled [auto_mirror_mimage_0] mirror_vg Iwi---m--- 100.00m /dev/sdg1(0) enabled [auto_mirror_mimage_1] mirror_vg Iwi---m-p- 100.00m [unknown](0) enabled [auto_mirror_mlog] mirror_vg lwi---m-p- 4.00m [unknown](25) enabled |