From: Sage Weil Date: Mon, 28 Oct 2019 19:12:37 +0000 (-0500) Subject: mgr/rook: implement update_mds X-Git-Tag: v15.1.0~1123^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31059%2Fhead;p=ceph.git mgr/rook: implement update_mds Note that this still doesn't provide control over active vs standby MDS counts. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 1acf5582c29..2d196ecac22 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -427,6 +427,12 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): lambda: self.rook_cluster.update_mon_count(num), None, "Updating mon count to {0}".format(num)) + def update_mds(self, spec): + num = spec.count + return RookWriteCompletion( + lambda: self.rook_cluster.update_mds_count(spec.name, num), None, + "Updating MDS server count in {0} to {1}".format(spec.name, num)) + def update_nfs(self, spec): num = spec.count return RookWriteCompletion( diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index fc147f70139..4d4c3ed76e6 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -454,6 +454,20 @@ class RookCluster(object): return "Updated mon count to {0}".format(newcount) + def update_mds_count(self, svc_id, newcount): + patch = [{"op": "replace", "path": "/spec/metadataServer/activeCount", + "value": newcount}] + + try: + self.rook_api_patch( + "cephfilesystems/{0}".format(svc_id), + body=patch) + except ApiException as e: + log.exception("API exception: {0}".format(e)) + raise ApplyException( + "Failed to update NFS server count for {0}: {1}".format(svc_id, e)) + return "Updated NFS server count for {0} to {1}".format(svc_id, newcount) + def update_nfs_count(self, svc_id, newcount): patch = [{"op": "replace", "path": "/spec/server/active", "value": newcount}]