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 <blaine.gardner@redhat.com>
This commit is contained in:
Blaine Gardner committed 2021-04-06 16:59:33 -06:00
1 parent 1df4336a68
commit 80d2cde5c7
1 file changed
+7
+7
View File
@@ -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)
}