diff --git a/pkg/daemon/ceph/osd/daemon.go b/pkg/daemon/ceph/osd/daemon.go index 77f689720..345ca6894 100644 --- a/pkg/daemon/ceph/osd/daemon.go +++ b/pkg/daemon/ceph/osd/daemon.go @@ -214,6 +214,15 @@ func Provision(context *clusterd.Context, agent *OsdAgent, crushLocation string) return errors.Wrap(err, "failed to configure devices") } + // Let's fail if no OSDs were configured + // This likely means the filter for available devices passed (in PVC case) + // but the resulting device was already configured for another cluster (disk not wiped and leftover) + // So we need to make sure the list is filled up, otherwise fail + if len(deviceOSDs) == 0 { + logger.Warningf("skipping OSD configuration as no devices matched the storage settings for this node %q", agent.nodeName) + return nil + } + logger.Infof("devices = %+v", deviceOSDs) // Populate CRUSH location for each OSD on the host