]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Abort nvme deployment with pool that doesn't exists 61389/head
authorKushal Deb <Kushal.Deb@ibm.com>
Wed, 15 Jan 2025 10:13:17 +0000 (15:43 +0530)
committerKushal Deb <Kushal.Deb@ibm.com>
Sun, 26 Jan 2025 08:12:10 +0000 (13:42 +0530)
Signed-off-by: Kushal Deb <Kushal.Deb@ibm.com>
src/pybind/mgr/cephadm/module.py

index e42b9fe3b56d7f1632a0f7cd5a70c4bcf5824a17..7c7908cc4ba6ef1d318337afed9e0ce70ab69544 100644 (file)
@@ -37,7 +37,8 @@ from ceph.deployment.service_spec import \
     ServiceSpec, PlacementSpec, \
     HostPlacementSpec, IngressSpec, \
     TunedProfileSpec, \
-    MgmtGatewaySpec
+    MgmtGatewaySpec, \
+    NvmeofServiceSpec
 from ceph.utils import str_to_datetime, datetime_to_str, datetime_now
 from cephadm.serve import CephadmServe
 from cephadm.services.cephadmservice import CephadmDaemonDeploySpec
@@ -3438,6 +3439,15 @@ Then run the following:
             if not mgmt_gw_daemons:
                 raise OrchestratorError("The 'oauth2-proxy' service depends on the 'mgmt-gateway' service, but it is not configured.")
 
+        if spec.service_type == 'nvmeof':
+            spec = cast(NvmeofServiceSpec, spec)
+            assert spec.pool is not None, "Pool cannot be None for nvmeof services"
+            try:
+                self._check_pool_exists(spec.pool, spec.service_name())
+            except OrchestratorError as e:
+                self.log.debug(f"{e}")
+                raise
+
         if spec.placement.count is not None:
             if spec.service_type in ['mon', 'mgr']:
                 if spec.placement.count > max(5, host_count):