Skip to content

Commit 3021dff

Browse files
authored
Merge pull request ceph#61389 from Kushal-deb/fix-issue-69435_NVMe-of_service
mgr/cephadm: Abort nvme deployment with pool that doesn't exist Reviewed-by: Adam King <[email protected]>
2 parents f6887b8 + 09c904c commit 3021dff

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
@@ -3391,6 +3392,15 @@ def _apply_service_spec(self, spec: ServiceSpec) -> str:
33913392
if not mgmt_gw_daemons:
33923393
raise OrchestratorError("The 'oauth2-proxy' service depends on the 'mgmt-gateway' service, but it is not configured.")
33933394

3395+
if spec.service_type == 'nvmeof':
3396+
spec = cast(NvmeofServiceSpec, spec)
3397+
assert spec.pool is not None, "Pool cannot be None for nvmeof services"
3398+
try:
3399+
self._check_pool_exists(spec.pool, spec.service_name())
3400+
except OrchestratorError as e:
3401+
self.log.debug(f"{e}")
3402+
raise
3403+
33943404
if spec.placement.count is not None:
33953405
if spec.service_type in ['mon', 'mgr']:
33963406
if spec.placement.count > max(5, host_count):

0 commit comments

Comments
 (0)