]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: Add nfs cluster update interface
authorVarsha Rao <varao@redhat.com>
Thu, 23 Apr 2020 13:40:48 +0000 (19:10 +0530)
committerVarsha Rao <varao@redhat.com>
Wed, 8 Jul 2020 05:36:34 +0000 (07:36 +0200)
$ ceph nfs cluster update <clusterid> <placement>

This updates the existing deployed cluster according to placement value.

Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit 9f97401f2794d51cfd7c44564a82b747e88420f9)

doc/cephfs/fs-nfs-exports.rst
src/pybind/mgr/volumes/fs/nfs.py
src/pybind/mgr/volumes/module.py

index b076b88280c6e73a8d9eedde3f68a15aa876d26d..e92935223b9d8c262bc48d67e92313b32256d132 100644 (file)
@@ -27,6 +27,15 @@ For more details on placement specification refer the `orchestrator doc
 <https://docs.ceph.com/docs/master/mgr/orchestrator/#placement-specification>`_.
 Currently only CephFS export type is supported.
 
+Update NFS Ganesha Cluster
+==========================
+
+.. code:: bash
+
+    $ ceph nfs cluster update <clusterid> <placement>
+
+This updates the deployed cluster according to the placement value.
+
 Create CephFS Export
 ====================
 
index f7084b0d99b712758f432973164726a1da0056bb..d136362f96563ea773c5c9c8be1fd7e2effe4414 100644 (file)
@@ -388,8 +388,12 @@ class NFSCluster:
 
         return 0, "", "NFS Cluster Created Successfully"
 
-    def update_nfs_cluster(self, size):
-        raise NotImplementedError()
+    def update_nfs_cluster(self, placement):
+        if not self.check_cluster_exists():
+            return -errno.EINVAL, "", "Cluster does not exist"
+
+        self._call_orch_apply_nfs(placement)
+        return 0, "", "NFS Cluster Updated Successfully"
 
     def delete_nfs_cluster(self):
         raise NotImplementedError()
index 03c3310e726e9e565432dc40b20c9640265c6c4f..40e51e8db74fd7577cfb2e8124adda632f346f7f 100644 (file)
@@ -278,6 +278,13 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
             'desc': "Create an NFS Cluster",
             'perm': 'rw'
         },
+        {
+            'cmd': 'nfs cluster update '
+                   'name=clusterid,type=CephString '
+                   'name=placement,type=CephString ',
+            'desc': "Updates an NFS Cluster",
+            'perm': 'rw'
+        },
         # volume ls [recursive]
         # subvolume ls <volume>
         # volume authorize/deauthorize
@@ -479,3 +486,6 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         nfs_cluster_obj = NFSCluster(self, cmd['clusterid'])
         return nfs_cluster_obj.create_nfs_cluster(export_type=cmd['type'],
                                                   placement=cmd.get('placement', None))
+    def _cmd_nfs_cluster_update(self, inbuf, cmd):
+        nfs_cluster_obj = NFSCluster(self, cmd['clusterid'])
+        return nfs_cluster_obj.update_nfs_cluster(placement=cmd['placement'])