Bug 1982889
| Summary: | IDTYPE=lvmlv_uuid stacked devices shouldn't cause warnings once pvremove'd and the underlining lv is also removed | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | David Teigland <teigland> |
| lvm2 sub component: | Devices, Filtering and Stacking | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED NOTABUG | Docs Contact: | |
| Severity: | low | ||
| Priority: | low | CC: | agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, zkabelac |
| Version: | 8.5 | Keywords: | Triaged |
| Target Milestone: | beta | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-04-11 23:45:18 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: | |||
|
Description
Corey Marthaler
2021-07-15 22:37:55 UTC
The general principle is that the user needs to explicitly add and remove devices from the devices file using lvmdevices --adddev|--deldev. So, pvremove doesn't remove the PV from the file, it just clears the PVID field as shown. As a way to ease the user transition, we made a special case for pvcreate/vgcreate so that those commands *do* add the target device to the devices file. This exception is technically a violation of the devices file concept, and we may at some point add a config setting to turn off this exception for pvcreate/vgcreate. In that case, a user would need to do lvmdevices --adddev prior to running pvcreate on the device. We've not come up with any exceptions where a command should automatically *remove* a device from the devices file, as we have for adding devices. It's possible that a case might come up which we've not thought of (possibly the stacking case if we find that's a recurring issue?) The stacking scenario where an LV is the device is being handled in the same way as a scsi device, where the user needs to explicitly remove it from the devices file if it's permanently detached from the system. (In the test above, setting the state to "offline" isn't actually detaching the device, it's still visible on the system even while offline.) [root@null-03 ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 rhel_null-03 lvm2 a-- 465.27g 0 /dev/sdf ff lvm2 a-- 931.01g 931.01g [root@null-03 ~]# lvmdevices Device /dev/sdf IDTYPE=sys_wwid IDNAME=naa.690b11c0000438ad0000057150910423 DEVNAME=/dev/sdf PVID=8hkmvJmTBHhnzn63RFXEFAdEy64I24HM Device /dev/sdb IDTYPE=sys_wwid IDNAME=naa.690b11c0000438ad0000056550910404 DEVNAME=/dev/sdb PVID=b1BaIjgRKsoXI9CGdWhJ50kKPaOZDZzo Device /dev/sda2 IDTYPE=sys_wwid IDNAME=naa.50014ee0ae1598c2 DEVNAME=/dev/sda2 PVID=0GfvU7fNrko5iAn1UIVOoKN2JyZr1s8z PART=2 [root@null-03 ~]# pvs /dev/sdb Cannot use PV /dev/sdb in shared VG bbsan. [root@null-03 ~]# pvs /dev/sdf PV VG Fmt Attr PSize PFree /dev/sdf ff lvm2 a-- 931.01g 931.01g [root@null-03 ~]# echo "offline" > /sys/block/sdf/device/state [root@null-03 ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 rhel_null-03 lvm2 a-- 465.27g 0 [root@null-03 ~]# pvs /dev/sdf Cannot use /dev/sdf: device is too small (pv_min_size) [root@null-03 ~]# cat /sys/block/sdf/device/state offline [root@null-03 ~]# cat /sys/block/sdf/device/wwid naa.690b11c0000438ad0000057150910423 AFAICT we can probably close this, but parking in need info for a bit in case there's some usability aspect to this that we should look at. You're correct, this can be closed. This LV stack removal condition is no different than any other device being removed with an existing devicesfile entry. Plus, we also already have bug 1956966 to deal with the potential annoyance of stale device/partition entries. # A similar md example. [root@hayes-01 ~]# pvcreate /dev/md127 Physical volume "/dev/md127" successfully created. [root@hayes-01 ~]# grep md /etc/lvm/devices/system.devices IDTYPE=md_uuid IDNAME=24904443-4c7a-7e4f-2f97-8ecfec58aeea DEVNAME=/dev/md127 PVID=f1lfjzc78b3oqO9xfbvjCqInli84OHwT [root@hayes-01 ~]# pvremove /dev/md127 Labels on physical volume "/dev/md127" successfully wiped. [root@hayes-01 ~]# grep md /etc/lvm/devices/system.devices IDTYPE=md_uuid IDNAME=24904443-4c7a-7e4f-2f97-8ecfec58aeea DEVNAME=/dev/md127 PVID=. [root@hayes-01 ~]# mdadm --stop /dev/md127 mdadm: stopped /dev/md127 [root@hayes-01 ~]# mdadm --zero-superblock /dev/sdc1 /dev/sde1 [root@hayes-01 ~]# pvscan Devices file md_uuid 24904443-4c7a-7e4f-2f97-8ecfec58aeea PVID none last seen on /dev/md127 not found. No matching physical volumes found |