From: Kushal Deb Date: Wed, 15 Jan 2025 10:13:17 +0000 (+0530) Subject: Abort nvme deployment with pool that doesn't exists X-Git-Tag: v20.0.0~248^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=09c904c94b896c4ef1cfc3747c6cae527e7fc967;p=ceph.git Abort nvme deployment with pool that doesn't exists Signed-off-by: Kushal Deb --- 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):