`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>
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: