From befce629252f15aae5f3f1ee2513b6d2842b4645 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 3 Nov 2023 23:44:27 -0400 Subject: [PATCH] Add OSD destroy before purge --- node-daemon/pvcnoded/objects/CephInstance.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/node-daemon/pvcnoded/objects/CephInstance.py b/node-daemon/pvcnoded/objects/CephInstance.py index 569c2e4d..7eb51e77 100644 --- a/node-daemon/pvcnoded/objects/CephInstance.py +++ b/node-daemon/pvcnoded/objects/CephInstance.py @@ -996,7 +996,18 @@ class CephOSDInstance(object): logger.out(f"Deleting OSD {osd_id} from PVC", state="i") zkhandler.delete(("osd", osd_id), recursive=True) - # 5. Purge the OSD from Ceph + # 5a. Destroy the OSD from Ceph + logger.out(f"Destroying OSD {osd_id}", state="i") + retcode, stdout, stderr = common.run_os_command( + f"ceph osd destroy {osd_id} --yes-i-really-mean-it" + ) + if retcode: + logger.out("Failed: ceph osd destroy", state="e") + logger.out(stdout, state="d") + logger.out(stderr, state="d") + time.sleep(2) + + # 5b. Purge the OSD from Ceph logger.out(f"Purging OSD {osd_id}", state="i") if force_flag: force_arg = "--force"