mgr/cephadm: Fixed rank calculation logic for potential candidates when NFS daemon colocation is enabled

When colocation of NFS daemons is allowed, the existing rank calculation incorrectly derives the
rank based solely on the number of hosts. This leads to inaccurate rank assignment because the logic
does not account for the full set of potential candidates, especially in scenarios where multiple
daemons can reside on the same host.

Fixes: https://tracker.ceph.com/issues/73442
Signed-off-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com>
This commit is contained in:
Shweta Bhosale 2026-03-23 16:53:01 +05:30
parent 4e20140ecf
commit e33edc8890

View File

@ -401,7 +401,7 @@ class HostAssignment(object):
existing_slots: List[DaemonPlacement] = []
to_add: List[DaemonPlacement] = []
to_remove: List[orchestrator.DaemonDescription] = []
ranks: List[int] = list(range(len(all_candidates)))
ranks: List[int] = list(range(len(all_candidates if len(all_candidates) > len(candidates) else candidates)))
others: List[DaemonPlacement] = candidates.copy()
for dd in daemons:
found = False