From 072d0e1fcede3fc5ed08583c9152b56070171e09 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Fri, 25 Feb 2022 10:37:03 -0700 Subject: [PATCH] osd: remove osd with purge instead of destroy The osd destroy command leaves the osd id in use instead of fully purging the osd id. If the osd id is not also removed, it gives the impression that there is still something that needs to be cleaned up from the old osd. Signed-off-by: Travis Nielsen --- pkg/daemon/ceph/osd/remove.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/daemon/ceph/osd/remove.go b/pkg/daemon/ceph/osd/remove.go index afee93a67ef3e..97e130ad47dac 100644 --- a/pkg/daemon/ceph/osd/remove.go +++ b/pkg/daemon/ceph/osd/remove.go @@ -174,19 +174,19 @@ func removeOSD(clusterdContext *clusterd.Context, clusterInfo *client.ClusterInf } // purge the osd - logger.Infof("destroying osd.%d", osdID) - purgeOSDArgs := []string{"osd", "destroy", fmt.Sprintf("osd.%d", osdID), "--yes-i-really-mean-it"} + logger.Infof("purging osd.%d", osdID) + purgeOSDArgs := []string{"osd", "purge", fmt.Sprintf("osd.%d", osdID), "--force", "--yes-i-really-mean-it"} _, err = client.NewCephCommand(clusterdContext, clusterInfo, purgeOSDArgs).Run() if err != nil { logger.Errorf("failed to purge osd.%d. %v", osdID, err) } // Attempting to remove the parent host. Errors can be ignored if there are other OSDs on the same host - logger.Infof("removing osd.%d from ceph", osdID) + logger.Infof("attempting to remove host %q from crush map if not in use", osdID) hostArgs := []string{"osd", "crush", "rm", hostName} _, err = client.NewCephCommand(clusterdContext, clusterInfo, hostArgs).Run() if err != nil { - logger.Errorf("failed to remove CRUSH host %q. %v", hostName, err) + logger.Infof("failed to remove CRUSH host %q. %v", hostName, err) } // call archiveCrash to silence crash warning in ceph health if any