Fix lvremove, lvcreate, and update ZK details

This commit is contained in:
Joshua Boniface 2023-11-04 00:24:09 -04:00
parent 0e45613634
commit 1535078842
1 changed files with 11 additions and 2 deletions

View File

@ -731,14 +731,14 @@ class CephOSDInstance(object):
state="i", state="i",
) )
retcode, stdout, stderr = common.run_os_command( retcode, stdout, stderr = common.run_os_command(
f"lvremove {db_device}" f"lvremove --force {db_device}"
) )
logger.out( logger.out(
f"Creating new Bluestore DB volume for OSD {osd_id}", state="i" f"Creating new Bluestore DB volume for OSD {osd_id}", state="i"
) )
retcode, stdout, stderr = common.run_os_command( retcode, stdout, stderr = common.run_os_command(
f"lvcreate -L {osd_new_db_size_mb}M -n osd-{osd_id} osd-db" f"lvcreate -L {osd_new_db_size_mb}M -n osd-{osd_id} --yes osd-db"
) )
if retcode: if retcode:
logger.out("Failed: lvcreate", state="e") logger.out("Failed: lvcreate", state="e")
@ -778,6 +778,15 @@ class CephOSDInstance(object):
logger.out(stderr, state="d") logger.out(stderr, state="d")
raise Exception raise Exception
logger.out(f"Updating OSD {osd_id} details in PVC", state="i")
zkhandler.write(
[
(("osd.device", osd_id), new_device),
(("osd.vg", osd_id), f"ceph-{vg_uuid}"),
(("osd.lv", osd_id), f"osd-block-{osd_fsid}"),
]
)
# Log it # Log it
logger.out( logger.out(
f"Successfully replaced OSDs {','.join([o['id'] for o in all_osds_on_block])} on new disk {new_device}", f"Successfully replaced OSDs {','.join([o['id'] for o in all_osds_on_block])} on new disk {new_device}",