]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Don't skip OSDs with non-empty osdspec_affinity 69247/head
authorRedouane Kachach <rkachach@ibm.com>
Tue, 2 Jun 2026 14:33:17 +0000 (16:33 +0200)
committerRedouane Kachach <rkachach@ibm.com>
Tue, 2 Jun 2026 14:33:17 +0000 (16:33 +0200)
`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 <rkachach@ibm.com>
src/pybind/mgr/cephadm/services/osd.py

index a3d116d3c876657e2a2d74f2f5a433f32b55fc89..e2ca9a23835152532195b46ed3cef39479458609 100644 (file)
@@ -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: