]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: configure nvmeof with ip of target host
authorAdam King <adking@redhat.com>
Fri, 28 Jul 2023 21:27:55 +0000 (17:27 -0400)
committerAdam King <adking@redhat.com>
Thu, 31 Aug 2023 17:36:14 +0000 (13:36 -0400)
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 <adking@redhat.com>
(cherry picked from commit 25a9f5ab0bb8d3e050c8714ec3539feb3b2febf5)

src/pybind/mgr/cephadm/services/nvmeof.py
src/pybind/mgr/cephadm/tests/test_services.py

index e9674bac5c8bf4e93d1521bedbceafb6d75f043c..01867bbc7eae4c5586eef6edeac9a42ac60e3288 100644 (file)
@@ -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',
index 84dc6d6a4981465d4e25880a81ac8fe45b665a83..bb67a8ca86e3106dc00c8d5c1780be9f7077eeef 100644 (file)
@@ -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):