From 80d2cde5c749715298eeec5f148b30ea397f8de4 Mon Sep 17 00:00:00 2001 From: Blaine Gardner Date: Tue, 6 Apr 2021 16:59:33 -0600 Subject: [PATCH] ceph: remove auth in osd-purge job `ceph osd purge` should remove the OSD auth, but many users have issues where they are unable to create new OSDs after removing old ones due to the old OSD auth still being present. Therefore, run `ceph auth del` for the OSD after purging to fix this. Signed-off-by: Blaine Gardner --- pkg/daemon/ceph/osd/remove.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/daemon/ceph/osd/remove.go b/pkg/daemon/ceph/osd/remove.go index 26c6a940b..6efe0170b 100644 --- a/pkg/daemon/ceph/osd/remove.go +++ b/pkg/daemon/ceph/osd/remove.go @@ -140,6 +140,13 @@ func removeOSD(clusterdContext *clusterd.Context, clusterInfo *client.ClusterInf // call archiveCrash to silence crash warning in ceph health if any archiveCrash(clusterdContext, clusterInfo, osdID) + // remove the auth for the osd. should be done by 'osd purge', but doesn't always seem to happen + err = client.AuthDelete(clusterdContext, clusterInfo, fmt.Sprintf("osd.%d", osdID)) + if err != nil { + // 'ceph auth del' returns error code 0 (success) if auth doesn't exist + logger.Errorf("failed to delete auth for osd.%d. user may need to use 'ceph auth del' or 'ceph auth rm' manually. %v", osdID, err) + } + logger.Infof("completed removal of OSD %d", osdID) }