From: Redouane Kachach Date: Tue, 2 Jun 2026 14:33:17 +0000 (+0200) Subject: mgr/cephadm: Don't skip OSDs with non-empty osdspec_affinity X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F69247%2Fhead;p=ceph.git mgr/cephadm: Don't skip OSDs with non-empty osdspec_affinity `ceph cephadm osd activate` calls `deploy_osd_daemons_for_existing_osds` with a synthetic DriveGroupSpec where service_id=''. Commit fbe3a053 introduced an unconditional osdspec_affinity filter: if osd['tags']['ceph.osdspec_affinity'] != spec.service_id: continue The fix is to only enforce the affinity check when spec.service_id is non-empty. An empty service_id means the caller is osd activate, which should adopt any existing OSD regardless of its affinity tag. Fixes: https://tracker.ceph.com/issues/76979 Signed-off-by: Redouane Kachach --- diff --git a/src/pybind/mgr/cephadm/services/osd.py b/src/pybind/mgr/cephadm/services/osd.py index a3d116d3c876..e2ca9a238351 100644 --- a/src/pybind/mgr/cephadm/services/osd.py +++ b/src/pybind/mgr/cephadm/services/osd.py @@ -146,7 +146,7 @@ class OSDService(CephService): if osd['tags']['ceph.cluster_fsid'] != fsid: logger.debug('mismatched fsid, skipping %s' % osd) continue - if osd['tags']['ceph.osdspec_affinity'] != spec.service_id: + if spec.service_id and osd['tags']['ceph.osdspec_affinity'] != spec.service_id: logger.debug('mismatched service id, skipping %s' % osd) continue if osd_id in before_osd_uuid_map and osd_id not in replace_osd_ids: