]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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>
Tue, 8 Aug 2023 14:50:16 +0000 (10:50 -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>
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 e4e7709e096d74a661037f08e1a4fa03b7bed8b8..e2c6fed9c735329806be321414716d53e18b8766 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):