Bug 1543186
| Summary: | RFE: boom could check if --rootlv or --root-device exist | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | LVM and device-mapper development team <lvm-team> |
| lvm2 sub component: | Snapshots | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | unspecified | CC: | agk, bmr, heinzm, jbrassow, msnitzer, prajnoha, prockai, rhandlin, zkabelac |
| Version: | 7.5 | Keywords: | FutureFeature |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.177-3.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 15:23:49 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
2018-02-07 23:10:09 UTC
I think we should make this a warning; this is partly intended, since the target LV or device may not be active (or even exist yet - it's not a use case we're promoting, but we do allow it right now). For the CLI I think we should issue a warning and prompt (or require a --force type switch). The API can accept a parameter to allow creation with non-existent root device and raise an exception otherwise. Fixed upstream:
commit 9498317c32f63fa5bf19a6bcb039051c5db213e5
Author: Bryn M. Reeves <bmr>
Date: Thu Feb 8 12:59:00 2018 +0000
boom: default to not allow entries with invalid root device
Check the provided --root-device (or result of --root-lv handling)
and give an error if the path does not exist, or is not a valid
block device node.
Add a new kwarg to BootEntry::__init__(), 'allow_no_dev' to allow
API users to disable this behaviour and enable it when the new
--no-dev/--nodev command line option is given.
Signed-off-by: Bryn M. Reeves <bmr>
Passing a non-existent or non-block root device will now yield an error:
# boom create --title qux2 --rootlv nosuch/dev
Device '/dev/nosuch/dev' not found.
Creating an entry with no valid root device requires --no-dev
Also passing --nodev/--no-dev disables this:
# boom create --title qux2 --nodev --rootlv nosuch/dev
Created entry with boot_id 0419aa4:
title qux2
machine-id 611f38fd887d41dea7eb3403b2730a76
version 4.13.13-200.fc26.x86_64
linux /vmlinuz-4.13.13-200.fc26.x86_64
initrd /initramfs-4.13.13-200.fc26.x86_64.img
options BOOT_IMAGE=/vmlinuz-4.13.13-200.fc26.x86_64 root=/dev/nosuch/dev ro rd.lvm.lv=nosuch/dev rhgb quiet
Fix verified in the latest rpms. 3.10.0-848.el7.x86_64 lvm2-2.02.177-3.el7 BUILT: Wed Feb 14 06:52:14 CST 2018 lvm2-libs-2.02.177-3.el7 BUILT: Wed Feb 14 06:52:14 CST 2018 lvm2-cluster-2.02.177-3.el7 BUILT: Wed Feb 14 06:52:14 CST 2018 lvm2-lockd-2.02.177-3.el7 BUILT: Wed Feb 14 06:52:14 CST 2018 lvm2-python-boom-0.8.4-3.el7 BUILT: Wed Feb 14 07:10:51 CST 2018 [root@mckinley-03 ~]# boom create --title 'System Snapshot' --root-device test/sanp Device 'test/sanp' not found. Creating an entry with no valid root device requires --no-dev [root@mckinley-03 ~]# boom create --title 'System Snapshot' --rootlv " " Root logical volume name must be in VG/LV format. Invalid logical volume name: ' ' [root@mckinley-03 ~]# boom create --title 'System Snapshot' --rootlv "/ " / Device '/dev// ' not found. Creating an entry with no valid root device requires --no-dev [root@mckinley-03 ~]# boom create --title 'System Snapshot' --root-device "&&&&&&&&&&&&&" Device '&&&&&&&&&&&&&' not found. Creating an entry with no valid root device requires --no-dev [root@mckinley-03 ~]# boom create --title 'System Snapshot' --nodev --root-device "&&&&&&&&&&&&&" Created entry with boot_id c940d02: title System Snapshot machine-id 99c24df6ee1b4f758788b62052ae1b4b version 3.10.0-848.el7.x86_64 linux /vmlinuz-3.10.0-848.el7.x86_64 initrd /initramfs-3.10.0-848.el7.x86_64.img options root=&&&&&&&&&&&&& ro rhgb quiet [root@mckinley-03 ~]# boom create --title 'System Snapshot' --nodev --rootlv "/ " / Created entry with boot_id 174af5a: title System Snapshot machine-id 99c24df6ee1b4f758788b62052ae1b4b version 3.10.0-848.el7.x86_64 linux /vmlinuz-3.10.0-848.el7.x86_64 initrd /initramfs-3.10.0-848.el7.x86_64.img options root=/dev// ro rd.lvm.lv=/ rhgb quiet Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0853 |