From 6852f7c8ed31e0a88bc10de3578eb6821bb627f0 Mon Sep 17 00:00:00 2001 From: Stephen Taylor Date: Tue, 27 Sep 2022 13:10:23 -0600 Subject: [PATCH] [ceph-client] Make use of noautoscale with Pacific The Ceph Pacific release has added a noautoscale flag to enable and disable the PG autoscaler for all pools globally. This change utilizes this flag for enabling and disabling autoscaler when the Ceph major version is greater than or equal to 16. Change-Id: Iaa3f2d238850eb413f26b82d75b5f6835980877f --- ceph-client/Chart.yaml | 2 +- ceph-client/templates/bin/pool/_init.sh.tpl | 26 ++++++++++++++++----- releasenotes/notes/ceph-client.yaml | 1 + 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ceph-client/Chart.yaml b/ceph-client/Chart.yaml index 5ebc0847c5..9dca721f50 100644 --- a/ceph-client/Chart.yaml +++ b/ceph-client/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph Client name: ceph-client -version: 0.1.37 +version: 0.1.38 home: https://github.com/ceph/ceph-client ... diff --git a/ceph-client/templates/bin/pool/_init.sh.tpl b/ceph-client/templates/bin/pool/_init.sh.tpl index c224cd649d..4f2a648a96 100644 --- a/ceph-client/templates/bin/pool/_init.sh.tpl +++ b/ceph-client/templates/bin/pool/_init.sh.tpl @@ -161,17 +161,31 @@ function reweight_osds () { } function enable_autoscaling () { - if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then - ceph mgr module enable pg_autoscaler # only required for nautilus + CEPH_MAJOR_VERSION=$(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) + + if [[ ${CEPH_MAJOR_VERSION} -ge 16 ]]; then + # Pacific introduced the noautoscale flag to make this simpler + ceph osd pool unset noautoscale + else + if [[ ${CEPH_MAJOR_VERSION} -eq 14 ]]; then + ceph mgr module enable pg_autoscaler # only required for nautilus + fi + ceph config set global osd_pool_default_pg_autoscale_mode on fi - ceph config set global osd_pool_default_pg_autoscale_mode on } function disable_autoscaling () { - if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then - ceph mgr module disable pg_autoscaler # only required for nautilus + CEPH_MAJOR_VERSION=$(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) + + if [[ ${CEPH_MAJOR_VERSION} -ge 16 ]]; then + # Pacific introduced the noautoscale flag to make this simpler + ceph osd pool set noautoscale + else + if [[ ${CEPH_MAJOR_VERSION} -eq 14 ]]; then + ceph mgr module disable pg_autoscaler # only required for nautilus + fi + ceph config set global osd_pool_default_pg_autoscale_mode off fi - ceph config set global osd_pool_default_pg_autoscale_mode off } function set_cluster_flags () { diff --git a/releasenotes/notes/ceph-client.yaml b/releasenotes/notes/ceph-client.yaml index a504d8cc37..cd2e3b1fe0 100644 --- a/releasenotes/notes/ceph-client.yaml +++ b/releasenotes/notes/ceph-client.yaml @@ -38,4 +38,5 @@ ceph-client: - 0.1.35 Handle multiple mon versions in the pool job - 0.1.36 Add the ability to run Ceph commands from values - 0.1.37 Added OCI registry authentication + - 0.1.38 Make use of noautoscale with Pacific ...