From 2f2c997652539795845184f938a70e67d245705c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 30 Apr 2021 11:10:38 -0400 Subject: [PATCH] mgr/cephadm: set host crush location based on HostSpec Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 4a8454e12840f..08813a4653d00 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1400,6 +1400,15 @@ Then run the following: raise OrchestratorError('New host %s (%s) failed check(s): %s' % ( spec.hostname, spec.addr, errors)) + # prime crush map? + if spec.location: + self.check_mon_command({ + 'prefix': 'osd crush add-bucket', + 'name': spec.hostname, + 'type': 'host', + 'args': [f'{k}={v}' for k, v in spec.location.items()], + }) + self.inventory.add_host(spec) self.cache.prime_empty_host(spec.hostname) self.offline_hosts_remove(spec.hostname) -- 2.39.5