Bug 1545627
Summary: | On devices with a partition table --force option on pvcreate is not effective due to device filtering and the error message is not clear | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Simone Tiraboschi <stirabos> |
Component: | lvm2 | Assignee: | LVM and device-mapper development team <lvm-team> |
lvm2 sub component: | Command-line tools | QA Contact: | cluster-qe <cluster-qe> |
Status: | CLOSED NOTABUG | Docs Contact: | |
Severity: | high | ||
Priority: | unspecified | CC: | agk, heinzm, jbrassow, khakimi, mcsontos, msnitzer, nsoffer, pbalogh, prajnoha, stirabos, talayan, teigland, thornber, zkabelac |
Version: | 7.5 | Keywords: | AutomationBlocker |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-01-09 17:28:46 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1527077 |
Description
Simone Tiraboschi
2018-02-15 11:31:55 UTC
Why not using `wipefs` first to get rid of all metadata? Anyway, it works with a FS, so should work the same with partition tables I guess. (In reply to Marian Csontos from comment #2) > Why not using `wipefs` first to get rid of all metadata? 'wipefs'by default is not enough, you need 'wipefs -a' > Anyway, it works with a FS, so should work the same with partition tables I > guess. Yes, I think so. (In reply to Simone Tiraboschi from comment #3) > (In reply to Marian Csontos from comment #2) > > Why not using `wipefs` first to get rid of all metadata? > > 'wipefs'by default is not enough, you need 'wipefs -a' > > > Anyway, it works with a FS, so should work the same with partition tables I > > guess. > > Yes, I think so. I don't understand this discussion... are you saying that you have a solution and we can close this bug, or something else? (In reply to Jonathan Earl Brassow from comment #4) > (In reply to Simone Tiraboschi from comment #3) > > (In reply to Marian Csontos from comment #2) > > > Why not using `wipefs` first to get rid of all metadata? > > > > 'wipefs'by default is not enough, you need 'wipefs -a' > > > > > Anyway, it works with a FS, so should work the same with partition tables I > > > guess. > > > > Yes, I think so. > > I don't understand this discussion... are you saying that you have a > solution and we can close this bug, or something else? No, I'm just saying that I agree that if --force works when the device contains a FS, I'd expect the same behavior if the device contains a partition table. The issue is that all the devices containing a partition table get filtered out before applying --force option. (In reply to Simone Tiraboschi from comment #5) > (In reply to Jonathan Earl Brassow from comment #4) > > (In reply to Simone Tiraboschi from comment #3) > > > (In reply to Marian Csontos from comment #2) > > > > Why not using `wipefs` first to get rid of all metadata? > > > > > > 'wipefs'by default is not enough, you need 'wipefs -a' > > > > > > > Anyway, it works with a FS, so should work the same with partition tables I > > > > guess. > > > > > > Yes, I think so. > > > > I don't understand this discussion... are you saying that you have a > > solution and we can close this bug, or something else? > > No, I'm just saying that I agree that if --force works when the device > contains a FS, I'd expect the same behavior if the device contains a > partition table. > > The issue is that all the devices containing a partition table get filtered > out before applying --force option. This is correct logic for lvm2. Lvm2 doesn't check all partitions when it's manipulating with a single device. In other words - this is 'rather' huge change for lvm2 internals to introduce some 'bypass' for elimination of partition tables skipping for --force option. You can think of lvm2 being a 'consumer' of 'device list' where 'partitioned' devices are ignored - the option '--force' is not meant to bypass core logic of device scanning ATM. Lvm2 would need to be enhanced first to detect it's safe to drop partition table. I see 2 options here: 1) decrease the necessary verbose setting to see the "partition" message below -vvv, but at least requiring -v 2) close WONTFIX Kobi, why this blocks automation? why don't you wipe the first 1MiB of a LUN before adding it? added AutomationBlocker because in any case, we had to do force clean of hosted engine environment (force clean - reprovision the host without correct cleanup) we failed in the next deploy even with the force key OVEHOSTED_ENGINE/forceCreateVG in the answer file. Our policy is: It is safer to err on side of caution and ask user if data loss is possible. There is a difference between wiping single FS and all partitions - when wiping all partitions we would need to go through all partitions and check their content. What if there are other PVs on those partitions? What if ...? This does not look like a job for LVM but for a management tool. If you want to clean a system, use `wipefs -a $DISK` but LVM is not a universal tool for managing ALL block devices including partitions. If you still wish to go down that road, use pvcreate --force with --yes which should work, but it is always dangerous combination to use in scripts. The only thing WE will do is improve the warning. additional info: The user get the following error when trying to deploy HE on FC SD manually and its not clean: [ INFO ] TASK [Add Fibre Channel storage domain] [ ERROR ] TypeError: 'NoneType' object is not iterable [ ERROR ] fatal: [localhost]: FAILED! => {"changed": false, "msg": "'NoneType' object is not iterable"} Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs)[nfs]: Can we plan this to be fixed in upcoming releases? I agree with Zdenek and Marian, clearing partitions with pvcreate -f doesn't look right; wipefs -a or dd work fine for this. |