From 09c904c94b896c4ef1cfc3747c6cae527e7fc967 Mon Sep 17 00:00:00 2001 From: Kushal Deb Date: Wed, 15 Jan 2025 15:43:17 +0530 Subject: [PATCH] Abort nvme deployment with pool that doesn't exists Signed-off-by: Kushal Deb --- src/pybind/mgr/cephadm/module.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index e42b9fe3b56d..7c7908cc4ba6 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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): -- 2.47.3