From: Kyle Date: Thu, 12 Aug 2021 17:49:38 +0000 (-0700) Subject: Add CLI command to set threshold X-Git-Tag: v17.1.0~1007^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a84e4dfd63db216c767d6a94218b326b337ca236;p=ceph.git Add CLI command to set threshold Signed-off-by: Kyle McGough --- diff --git a/doc/rados/operations/placement-groups.rst b/doc/rados/operations/placement-groups.rst index d282d9e5bee3..90e3238d197e 100644 --- a/doc/rados/operations/placement-groups.rst +++ b/doc/rados/operations/placement-groups.rst @@ -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``. diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index 24487c7a3a3d..926c0b5d842e 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -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]: """