[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
This commit is contained in:
Stephen Taylor
2022-09-27 13:10:23 -06:00
parent ed7e58f4b1
commit 6852f7c8ed
3 changed files with 22 additions and 7 deletions

View File

@@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph Client description: OpenStack-Helm Ceph Client
name: ceph-client name: ceph-client
version: 0.1.37 version: 0.1.38
home: https://github.com/ceph/ceph-client home: https://github.com/ceph/ceph-client
... ...

View File

@@ -161,17 +161,31 @@ function reweight_osds () {
} }
function enable_autoscaling () { function enable_autoscaling () {
if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then 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 ceph mgr module enable pg_autoscaler # only required for nautilus
fi fi
ceph config set global osd_pool_default_pg_autoscale_mode on ceph config set global osd_pool_default_pg_autoscale_mode on
fi
} }
function disable_autoscaling () { function disable_autoscaling () {
if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then 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 ceph mgr module disable pg_autoscaler # only required for nautilus
fi fi
ceph config set global osd_pool_default_pg_autoscale_mode off ceph config set global osd_pool_default_pg_autoscale_mode off
fi
} }
function set_cluster_flags () { function set_cluster_flags () {

View File

@@ -38,4 +38,5 @@ ceph-client:
- 0.1.35 Handle multiple mon versions in the pool job - 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.36 Add the ability to run Ceph commands from values
- 0.1.37 Added OCI registry authentication - 0.1.37 Added OCI registry authentication
- 0.1.38 Make use of noautoscale with Pacific
... ...