Check for partition tables on new devices
This commit is contained in:
parent
d1602f35de
commit
7490f13b7c
|
@ -310,6 +310,15 @@ class CephOSDInstance(object):
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# Check if device has a partition table; it's not valid if it does
|
||||||
|
retcode, _, _ = common.run_os_command(f"sfdisk --dump {device}")
|
||||||
|
if retcode < 1:
|
||||||
|
logger.out(
|
||||||
|
f"Device {device} has a partition table and is unsuitable for an OSD",
|
||||||
|
state="e",
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
if ext_db_size is not None or ext_db_ratio is not None:
|
if ext_db_size is not None or ext_db_ratio is not None:
|
||||||
ext_db_flag = True
|
ext_db_flag = True
|
||||||
else:
|
else:
|
||||||
|
@ -525,6 +534,15 @@ class CephOSDInstance(object):
|
||||||
)
|
)
|
||||||
new_device = ddevice
|
new_device = ddevice
|
||||||
|
|
||||||
|
# Check if device has a partition table; it's not valid if it does
|
||||||
|
retcode, _, _ = common.run_os_command(f"sfdisk --dump {new_device}")
|
||||||
|
if retcode < 1:
|
||||||
|
logger.out(
|
||||||
|
f"Device {new_device} has a partition table and is unsuitable for an OSD",
|
||||||
|
state="e",
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
# Phase 1: Try to determine what we can about the old device
|
# Phase 1: Try to determine what we can about the old device
|
||||||
real_old_device = None
|
real_old_device = None
|
||||||
osd_block = zkhandler.read(("osd.device", osd_id))
|
osd_block = zkhandler.read(("osd.device", osd_id))
|
||||||
|
|
Loading…
Reference in New Issue