From: Varsha Rao Date: Thu, 23 Apr 2020 13:40:48 +0000 (+0530) Subject: mgr/volumes: Add nfs cluster update interface X-Git-Tag: v15.2.5~166^2~63 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b8795eb5356d754724145b357c33e5befe3a7ea9;p=ceph.git mgr/volumes: Add nfs cluster update interface $ ceph nfs cluster update This updates the existing deployed cluster according to placement value. Signed-off-by: Varsha Rao (cherry picked from commit 9f97401f2794d51cfd7c44564a82b747e88420f9) --- diff --git a/doc/cephfs/fs-nfs-exports.rst b/doc/cephfs/fs-nfs-exports.rst index b076b88280c..e92935223b9 100644 --- a/doc/cephfs/fs-nfs-exports.rst +++ b/doc/cephfs/fs-nfs-exports.rst @@ -27,6 +27,15 @@ For more details on placement specification refer the `orchestrator doc `_. Currently only CephFS export type is supported. +Update NFS Ganesha Cluster +========================== + +.. code:: bash + + $ ceph nfs cluster update + +This updates the deployed cluster according to the placement value. + Create CephFS Export ==================== diff --git a/src/pybind/mgr/volumes/fs/nfs.py b/src/pybind/mgr/volumes/fs/nfs.py index f7084b0d99b..d136362f965 100644 --- a/src/pybind/mgr/volumes/fs/nfs.py +++ b/src/pybind/mgr/volumes/fs/nfs.py @@ -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() diff --git a/src/pybind/mgr/volumes/module.py b/src/pybind/mgr/volumes/module.py index 03c3310e726..40e51e8db74 100644 --- a/src/pybind/mgr/volumes/module.py +++ b/src/pybind/mgr/volumes/module.py @@ -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 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'])