]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: apply nfs service spec
authorMichael Fritch <mfritch@suse.com>
Mon, 9 Mar 2020 18:44:06 +0000 (12:44 -0600)
committerSage Weil <sage@redhat.com>
Thu, 26 Mar 2020 01:56:31 +0000 (20:56 -0500)
orch apply nfs <svc_id> [<placement>]

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 76f27894caba2b3bc146c79d86c4335c9c33dcde)

src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/module.py

index b470752f6b2b9072e02739b5c671afe2c35b0fa3..0e3d69b059dfd22e65ccf98fc6e1eebb5e1deaba 100644 (file)
@@ -2332,6 +2332,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,
@@ -2401,6 +2402,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
 
@@ -2636,6 +2639,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),
@@ -2768,6 +2772,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]
index b200334930fe4d6bbc3057d72bd2d5bf47baae8b..277570d277c7df3161b9ee19b6727816e8428684 100644 (file)
@@ -783,13 +783,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,
         )