From: Adam King Date: Fri, 28 Jul 2023 21:27:55 +0000 (-0400) Subject: mgr/cephadm: configure nvmeof with ip of target host X-Git-Tag: v18.2.1~326^2~26 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f11905ce53341cd243cb5e192ce9cdacc8257b90;p=ceph-ci.git mgr/cephadm: configure nvmeof with ip of target host This is the IP the nvmeof daemon will bind to, so it should be the IP of the host we're deploying the nvmeof daemon on, not the IP of the active mgr Signed-off-by: Adam King (cherry picked from commit 25a9f5ab0bb8d3e050c8714ec3539feb3b2febf5) --- diff --git a/src/pybind/mgr/cephadm/services/nvmeof.py b/src/pybind/mgr/cephadm/services/nvmeof.py index e9674bac5c8..01867bbc7ea 100644 --- a/src/pybind/mgr/cephadm/services/nvmeof.py +++ b/src/pybind/mgr/cephadm/services/nvmeof.py @@ -26,6 +26,7 @@ class NvmeofService(CephService): spec = cast(NvmeofServiceSpec, self.mgr.spec_store[daemon_spec.service_name].spec) igw_id = daemon_spec.daemon_id + host_ip = self.mgr.inventory.get_addr(daemon_spec.host) keyring = self.get_keyring_with_caps(self.get_auth_entity(igw_id), ['mon', 'profile rbd', @@ -38,7 +39,7 @@ class NvmeofService(CephService): context = { 'spec': spec, 'name': name, - 'addr': self.mgr.get_mgr_ip(), + 'addr': host_ip, 'port': spec.port, 'log_level': 'WARN', 'rpc_socket': '/var/tmp/spdk.sock', diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index 84dc6d6a498..bb67a8ca86e 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -354,7 +354,7 @@ class TestNVMEOFService: def test_nvmeof_dashboard_config(self, mock_resolve_ip): pass - @patch("cephadm.module.CephadmOrchestrator.get_mgr_ip", lambda _: '192.168.100.100') + @patch("cephadm.inventory.Inventory.get_addr", lambda _, __: '192.168.100.100') @patch("cephadm.serve.CephadmServe._run_cephadm") @patch("cephadm.module.CephadmOrchestrator.get_unique_name") def test_nvmeof_config(self, _get_name, _run_cephadm, cephadm_module: CephadmOrchestrator):