]> git.apps.os.sepia.ceph.com Git - ceph.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)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 12 Aug 2021 11:24:59 +0000 (13:24 +0200)
commit68964390c65a65e1736d62c55715f15d510d9ae0
tree8ca266f27777560644c6a465d0d5198f94be0f92
parent23656c9f221cbd6ba80593b3f0eb5d18487d4bd2
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>
(cherry picked from commit 651b28f2e3cb39dbe9c7038cd677a01523f08821)
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