From: Sage Weil Date: Fri, 30 Apr 2021 15:10:38 +0000 (-0400) Subject: mgr/cephadm: set host crush location based on HostSpec X-Git-Tag: v16.2.5~51^2~3^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6f6ee0e5a0af7a4b28ba1c154999b27ce54a31f;p=ceph.git mgr/cephadm: set host crush location based on HostSpec Signed-off-by: Sage Weil (cherry picked from commit 2f2c997652539795845184f938a70e67d245705c) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 4a8454e12840..08813a4653d0 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)