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