Revert "[ceph-client] enhance logic to enable the autoscaler for Octopus"

This reverts commit 910ed906d0.

Reason for revert: May be causing upstream multinode gates to fail. 

Change-Id: I1ea7349f5821b549d7c9ea88ef0089821eff3ddf
This commit is contained in:
Brian Wickersham 2021-02-25 16:23:46 +00:00
parent 910ed906d0
commit 714cfdad84
6 changed files with 23 additions and 10 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.8 version: 0.1.9
home: https://github.com/ceph/ceph-client home: https://github.com/ceph/ceph-client
... ...

View File

@ -181,7 +181,13 @@ function pool_validation() {
pg_placement_num=$(echo ${pool_obj} | jq -r .pg_placement_num) pg_placement_num=$(echo ${pool_obj} | jq -r .pg_placement_num)
crush_rule=$(echo ${pool_obj} | jq -r .crush_rule) crush_rule=$(echo ${pool_obj} | jq -r .crush_rule)
name=$(echo ${pool_obj} | jq -r .pool_name) name=$(echo ${pool_obj} | jq -r .pool_name)
pg_autoscale_mode=$(echo ${pool_obj} | jq -r .pg_autoscale_mode)
if [[ "${ENABLE_AUTOSCALER}" == "true" ]]; then
if [[ "${pg_autoscale_mode}" != "on" ]]; then
echo "pg autoscaler not enabled on ${name} pool"
exit 1
fi
fi
if [[ $(ceph mon versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]]; then if [[ $(ceph mon versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]]; then
if [ "x${size}" != "x${RBD}" ] || [ "x${min_size}" != "x${EXPECTED_POOLMINSIZE}" ] \ if [ "x${size}" != "x${RBD}" ] || [ "x${min_size}" != "x${EXPECTED_POOLMINSIZE}" ] \
|| [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then || [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then

View File

@ -146,11 +146,13 @@ function reweight_osds () {
done done
} }
function enable_autoscaling () { function enable_or_disable_autoscaling () {
if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then if [[ "${ENABLE_AUTOSCALER}" == "true" ]]; then
ceph mgr module enable pg_autoscaler # only required for nautilus ceph mgr module enable pg_autoscaler
ceph config set global osd_pool_default_pg_autoscale_mode on
else
ceph mgr module disable pg_autoscaler
fi fi
ceph config set global osd_pool_default_pg_autoscale_mode on
} }
function set_cluster_flags () { function set_cluster_flags () {
@ -182,8 +184,10 @@ function create_pool () {
ceph --cluster "${CLUSTER}" osd pool application enable "${POOL_NAME}" "${POOL_APPLICATION}" ceph --cluster "${CLUSTER}" osd pool application enable "${POOL_NAME}" "${POOL_APPLICATION}"
fi fi
if [[ $(ceph osd versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]] ; then if [[ $(ceph osd versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]] && [[ "${ENABLE_AUTOSCALER}" == "true" ]] ; then
ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode on ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode on
else
ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode off
fi fi
# #
# Make sure pool is not protected after creation AND expansion so we can manipulate its settings. # Make sure pool is not protected after creation AND expansion so we can manipulate its settings.
@ -265,8 +269,8 @@ else
cluster_capacity=$(ceph --cluster "${CLUSTER}" df | head -n3 | tail -n1 | awk '{print $1 substr($2, 1, 1)}' | numfmt --from=iec) cluster_capacity=$(ceph --cluster "${CLUSTER}" df | head -n3 | tail -n1 | awk '{print $1 substr($2, 1, 1)}' | numfmt --from=iec)
fi fi
if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]]; then if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then
enable_autoscaling enable_or_disable_autoscaling
fi fi
{{- range $pool := .Values.conf.pool.spec -}} {{- range $pool := .Values.conf.pool.spec -}}

View File

@ -50,6 +50,8 @@ spec:
env: env:
- name: CLUSTER - name: CLUSTER
value: "ceph" value: "ceph"
- name: ENABLE_AUTOSCALER
value: {{ .Values.conf.features.pg_autoscaler | quote }}
- name: CLUSTER_SET_FLAGS - name: CLUSTER_SET_FLAGS
value: {{ .Values.conf.features.cluster_flags.set | quote }} value: {{ .Values.conf.features.cluster_flags.set | quote }}
- name: CLUSTER_UNSET_FLAGS - name: CLUSTER_UNSET_FLAGS

View File

@ -50,6 +50,8 @@ spec:
value: {{ .Values.conf.pool.default.crush_rule | default "replicated_rule" | quote }} value: {{ .Values.conf.pool.default.crush_rule | default "replicated_rule" | quote }}
- name: MGR_COUNT - name: MGR_COUNT
value: {{ .Values.pod.replicas.mgr | default "1" | quote }} value: {{ .Values.pod.replicas.mgr | default "1" | quote }}
- name: ENABLE_AUTOSCALER
value: {{ .Values.conf.features.pg_autoscaler | quote }}
{{- range $pool := .Values.conf.pool.spec -}} {{- range $pool := .Values.conf.pool.spec -}}
{{- with $pool }} {{- with $pool }}
- name: {{ .name | upper | replace "." "_" }} - name: {{ .name | upper | replace "." "_" }}

View File

@ -8,5 +8,4 @@ ceph-client:
- 0.1.5 Fix Helm test check_pgs() check for inactive PGs - 0.1.5 Fix Helm test check_pgs() check for inactive PGs
- 0.1.6 Uplift from Nautilus to Octopus release - 0.1.6 Uplift from Nautilus to Octopus release
- 0.1.7 Don't wait for premerge PGs in the rbd pool job - 0.1.7 Don't wait for premerge PGs in the rbd pool job
- 0.1.8 Enhance logic to enable the pg autoscaler
... ...