From f11905ce53341cd243cb5e192ce9cdacc8257b90 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 28 Jul 2023 17:27:55 -0400 Subject: [PATCH] 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) --- src/pybind/mgr/cephadm/services/nvmeof.py | 3 ++- src/pybind/mgr/cephadm/tests/test_services.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/cephadm/services/nvmeof.py b/src/pybind/mgr/cephadm/services/nvmeof.py index e9674bac5c8bf..01867bbc7eae4 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 84dc6d6a49814..bb67a8ca86e31 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): -- 2.39.5