Retain the original hostname for CRUSH removal operations so the
commands continue to match existing CRUSH bucket names after hostname
normalization.
Also normalize DaemonDescription.hostname when loading the persisted
host cache to ensure scheduler hostname comparisons remain consistent
with normalized inventory and HostCache entries.
Fixes: https://tracker.ceph.com/issues/78426
Signed-off-by: Shubha Jain <SHUBHA.JAIN1@ibm.com>
j.get('networks_and_interfaces', {}))
for name, d in j.get('daemons', {}).items():
- self.daemons[host][name] = \
- orchestrator.DaemonDescription.from_json(d)
+ dd = orchestrator.DaemonDescription.from_json(d)
+ dd.hostname = host
+ self.daemons[host][name] = dd
# still want to check old device location for upgrade scenarios
for d in j.get('devices', []):
self.devices[host].append(inventory.Device.from_json(d))
:param force: bypass running daemons check
:param offline: remove offline host
"""
+ original_host = host
host = normalize_hostname(host)
# check if host is offline
cmd_args = {
'prefix': 'osd crush rm',
- 'name': host
+ 'name': original_host
}
run_cmd(cmd_args)
try:
self.check_mon_command({
'prefix': 'osd crush remove',
- 'name': host,
+ 'name': original_host,
})
except MonCommandFailed as e:
self.log.error(f'Couldn\'t remove host {host} from CRUSH map: {str(e)}')