]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: implement update_mds 31059/head
authorSage Weil <sage@redhat.com>
Mon, 28 Oct 2019 19:12:37 +0000 (14:12 -0500)
committerSage Weil <sage@redhat.com>
Mon, 28 Oct 2019 19:15:27 +0000 (14:15 -0500)
Note that this still doesn't provide control over active vs standby MDS
counts.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/rook/module.py
src/pybind/mgr/rook/rook_cluster.py

index 1acf5582c29016d0f2a6da51d2c8832d4f10f68b..2d196ecac22554c35a83edc83088b71ca58700b2 100644 (file)
@@ -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(
index fc147f70139067bf06c6ed252c8c01c158d1fac2..4d4c3ed76e6d49cd59c2528a1265c19d0355a805 100644 (file)
@@ -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}]