diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b6528f119e9..333cd53a79d 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2364,6 +2364,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): 'mds': self._create_mds, 'rgw': self._create_rgw, 'rbd-mirror': self._create_rbd_mirror, + 'nfs': self._create_nfs, 'grafana': self._create_grafana, 'alertmanager': self._create_alertmanager, 'prometheus': self._create_prometheus, @@ -2433,6 +2434,8 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): daemon_type, daemon_id, host)) if daemon_type == 'mon': create_func(daemon_id, host, network) # type: ignore + elif daemon_type == 'nfs': + create_func(daemon_id, host, spec) # type: ignore else: create_func(daemon_id, host) # type: ignore @@ -2668,6 +2671,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): 'mds': PlacementSpec(count=2), 'rgw': PlacementSpec(count=2), 'rbd-mirror': PlacementSpec(count=2), + 'nfs': PlacementSpec(count=1), 'grafana': PlacementSpec(count=1), 'alertmanager': PlacementSpec(count=1), 'prometheus': PlacementSpec(count=1), @@ -2800,6 +2804,10 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): keyring=keyring, cephadm_config=cephadm_config) + @trivial_completion + def apply_nfs(self, spec): + return self._apply(spec) + def _generate_prometheus_config(self): # type: () -> Tuple[Dict[str, Any], List[str]] deps = [] # type: List[str] diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 314bb53e0a2..c8c3c836942 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -785,13 +785,17 @@ Usage: @_cli_write_command( 'orch apply nfs', - "name=svc_id,type=CephString " + 'name=svc_id,type=CephString ' + 'name=pool,type=CephString ' + 'name=namespace,type=CephString,req=false ' 'name=placement,type=CephString,req=false ' 'name=unmanaged,type=CephBool,req=false', 'Scale an NFS service') - def _apply_nfs(self, svc_id, placement=None, unmanaged=False): + def _apply_nfs(self, svc_id, pool, namespace=None, placement=None, unmanaged=False): spec = NFSServiceSpec( svc_id, + pool=pool, + namespace=namespace, placement=PlacementSpec.from_string(placement), unmanaged=unmanaged, )