]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add CLI command to set threshold
authorKyle <mcgoughboy@gmail.com>
Thu, 12 Aug 2021 17:49:38 +0000 (10:49 -0700)
committerKyle <mcgoughboy@gmail.com>
Thu, 12 Aug 2021 17:49:38 +0000 (10:49 -0700)
Signed-off-by: Kyle McGough <kmcgough@digitalocean.com>
doc/rados/operations/placement-groups.rst
src/pybind/mgr/pg_autoscaler/module.py

index d282d9e5bee334ba82d4eea159c29f91d04e0983..90e3238d197e7dabb12b6d78fabbd9e4e91e7b54 100644 (file)
@@ -91,7 +91,7 @@ always a power of 2, and will only be present if the "ideal" value
 varies from the current value by more than a factor of 3 by default.
 This factor can be be adjusted with::
 
-  ceph config set mgr mgr/pg_autoscaler/threshold 2.0
+  ceph osd pool set threshold 2.0
 
 **AUTOSCALE**, is the pool ``pg_autoscale_mode``
 and will be either ``on``, ``off``, or ``warn``.
index 24487c7a3a3d0e82d85db103b56c30e8a2597402..926c0b5d842e4634bf76a360ea2334b18185a2fa 100644 (file)
@@ -252,6 +252,17 @@ class PgAutoscaler(MgrModule):
                 ])
             return 0, table.get_string(), ''
 
+    @CLIWriteCommand("osd pool set threshold")
+    def set_scaling_threshold(self, num: float) -> Tuple[int, str, str]:
+        """
+        set the autoscaler threshold 
+        A.K.A. the factor by which the new PG_NUM must vary from the existing PG_NUM
+        """
+        if num < 2.0:
+            return 22, "", "threshold can not be set less than 2.0"
+        self.set_module_option("threshold", num)
+        return 0, "threshold updated", ""
+
     @CLIWriteCommand("osd pool set autoscale-profile scale-up")
     def set_profile_scale_up(self) -> Tuple[int, str, str]:
         """