Skip to content

Commit 09c904c

Browse files
committed
Abort nvme deployment with pool that doesn't exists
Signed-off-by: Kushal Deb <[email protected]>
1 parent 88b53e2 commit 09c904c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/pybind/mgr/cephadm/module.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
ServiceSpec, PlacementSpec, \
3838
HostPlacementSpec, IngressSpec, \
3939
TunedProfileSpec, \
40-
MgmtGatewaySpec
40+
MgmtGatewaySpec, \
41+
NvmeofServiceSpec
4142
from ceph.utils import str_to_datetime, datetime_to_str, datetime_now
4243
from cephadm.serve import CephadmServe
4344
from cephadm.services.cephadmservice import CephadmDaemonDeploySpec
@@ -3438,6 +3439,15 @@ def _apply_service_spec(self, spec: ServiceSpec) -> str:
34383439
if not mgmt_gw_daemons:
34393440
raise OrchestratorError("The 'oauth2-proxy' service depends on the 'mgmt-gateway' service, but it is not configured.")
34403441

3442+
if spec.service_type == 'nvmeof':
3443+
spec = cast(NvmeofServiceSpec, spec)
3444+
assert spec.pool is not None, "Pool cannot be None for nvmeof services"
3445+
try:
3446+
self._check_pool_exists(spec.pool, spec.service_name())
3447+
except OrchestratorError as e:
3448+
self.log.debug(f"{e}")
3449+
raise
3450+
34413451
if spec.placement.count is not None:
34423452
if spec.service_type in ['mon', 'mgr']:
34433453
if spec.placement.count > max(5, host_count):

0 commit comments

Comments
 (0)