]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: Add 'osd pool get threshold' command which returns the current... 65015/head
authorConnor Fawcett <connorfa@uk.ibm.com>
Wed, 13 Aug 2025 14:03:40 +0000 (15:03 +0100)
committerConnor Fawcett <connorfa@uk.ibm.com>
Mon, 18 Aug 2025 11:22:47 +0000 (12:22 +0100)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2291435
Signed-off-by: Connor Fawcett <connorfa@uk.ibm.com>
doc/rados/operations/placement-groups.rst
src/pybind/mgr/pg_autoscaler/module.py

index 40b6a12b2f5fad6f632bbeec695f132364d7443f..14d3593731038a19720ab492ef411f4dd96ffc51 100644 (file)
@@ -161,6 +161,12 @@ The output will resemble the following::
 
      ceph osd pool set threshold 2.0
 
+  To get the current ``threshold`` value, run the following command:
+
+  .. prompt:: bash #
+
+     ceph osd pool get threshold
+
 - **AUTOSCALE** is the pool's ``pg_autoscale_mode`` and is set to ``on``,
   ``off``, or ``warn``.
 
index 451bcf8568cb3ad420b58eedd8b8feb3cada3cb0..03d601d0d4444f3989d3bebafe5cfd119f397712 100644 (file)
@@ -240,13 +240,23 @@ class PgAutoscaler(MgrModule):
     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
+        A.K.A. the factor by which the new pg_num must vary
+        from the existing pg_num before action is taken
         """
         if num < 1.0:
             return 22, "", "threshold cannot be set less than 1.0"
         self.set_module_option("threshold", num)
         return 0, "threshold updated", ""
 
+    @CLIReadCommand("osd pool get threshold")
+    def get_scaling_threshold(self) -> Tuple[int, str, str]:
+        """
+        return the autoscaler threshold value
+        A.K.A. the factor by which the new pg_num must vary
+        from the existing pg_num before action is taken
+        """
+        return 0, str(self.get_module_option('threshold')), ''
+
     def complete_all_progress_events(self) -> None:
         for pool_id in list(self._event):
             ev = self._event[pool_id]