Bug 2056719

Summary: [ceph-volume] 'lvm create' must FAIL if specified device has existing partitions
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Michael J. Kidd <linuxkidd>
Component: Ceph-VolumeAssignee: Guillaume Abrioux <gabrioux>
Status: CLOSED ERRATA QA Contact: Ameena Suhani S H <amsyedha>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2CC: ceph-eng-bugs, ceph-qe-bugs, gabrioux, gjose, kdreyer, mmanjuna, mmuench, sbaldwin, vereddy, vumrao
Target Milestone: ---   
Target Release: 4.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ceph-14.2.22-75.el7cp ceph-14.2.22-75.el8cp Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2057496 (view as bug list) Environment:
Last Closed: 2022-05-05 07:54:39 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: 2057496    

Description Michael J. Kidd 2022-02-21 22:39:51 UTC
Description of problem:
The `ceph-volume lvm create` command currently does NOT abort if partitions exist on a specified block device.

Version-Release number of selected component (if applicable):
RHCS 4.2z4

How reproducible:
100%

Steps to Reproduce:
1. Have block.db device with partitions
2. Specify --block.db to the device with existing partitions
3. Issue `ceph-volume lvm create --bluestore --block $dev --block.db $dev2 --block.db-size 250G`

Actual results:
- Existing partitions on $dev2 are wiped and a new PV/VG/LV structure created.
- In this instance, the partitions for currently running OSDs `block.db` were wiped and re-used by LV's, thus causing prior running OSDs to crash and be unrecoverable.

Expected results:
- `ceph-volume` to abort due to existing data structure

Additional info:
- This would appear to occur if the `--block` or `--block.db` or `--block.wal` has partition structure, but this particular event occurred on `--block.db`.

Comment 25 errata-xmlrpc 2022-05-05 07:54:39 UTC
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 (Moderate: Red Hat Ceph Storage 4.3 Security and Bug Fix update), 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/RHSA-2022:1716