From 1535078842523f4395f462027171756384a5ff45 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 4 Nov 2023 00:24:09 -0400 Subject: [PATCH] Fix lvremove, lvcreate, and update ZK details --- node-daemon/pvcnoded/objects/CephInstance.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/node-daemon/pvcnoded/objects/CephInstance.py b/node-daemon/pvcnoded/objects/CephInstance.py index 8602d9ce..f68cb7a4 100644 --- a/node-daemon/pvcnoded/objects/CephInstance.py +++ b/node-daemon/pvcnoded/objects/CephInstance.py @@ -731,14 +731,14 @@ class CephOSDInstance(object): state="i", ) retcode, stdout, stderr = common.run_os_command( - f"lvremove {db_device}" + f"lvremove --force {db_device}" ) logger.out( f"Creating new Bluestore DB volume for OSD {osd_id}", state="i" ) 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: logger.out("Failed: lvcreate", state="e") @@ -778,6 +778,15 @@ class CephOSDInstance(object): logger.out(stderr, state="d") 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 logger.out( f"Successfully replaced OSDs {','.join([o['id'] for o in all_osds_on_block])} on new disk {new_device}",