]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
ceph-volume: use safer check for bluestore label
authorBlaine Gardner <blaine.gardner@redhat.com>
Mon, 19 Jul 2021 17:57:09 +0000 (11:57 -0600)
committerBlaine Gardner <blaine.gardner@redhat.com>
Tue, 20 Jul 2021 18:24:37 +0000 (12:24 -0600)
commit651b28f2e3cb39dbe9c7038cd677a01523f08821
tree5de5fcbe67afc24a7e01aac4e20f0653fa1336c6
parent1ca76821590fba1f2e08eb8bb9192b96f3d2aba2
ceph-volume: use safer check for bluestore label

Using only the exit status of `ceph-bluestore-tool show-label` to
determine if a device is a bluestore OSD could report a false negative
if there is a system error when `ceph-bluestore-tool` opens the device.

A better check is to open the device and read the bluestore device
label (the first 22 bytes of the device) to look for the bluestore
device signature ("bluestore block device"). If ceph-volume fails to
open the device due to a system error, it is safest to assume the device
is BlueStore so that an existing OSD isn't overwritten.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
src/ceph-volume/ceph_volume/tests/util/test_arg_validators.py
src/ceph-volume/ceph_volume/tests/util/test_device.py
src/ceph-volume/ceph_volume/util/device.py