diff --git a/config.yaml b/config.yaml index 4b689850..f66d96fc 100644 --- a/config.yaml +++ b/config.yaml @@ -225,3 +225,11 @@ options: from the ceph all-in-one charm to a ceph-mon / ceph-osd deployment. Refer to the Charm Deployment guide at https://docs.openstack.org/charm-deployment-guide/latest/ for more information. + disable-pg-max-object-skew: + type: boolean + default: False + description: | + Openstack clouds that use ceph will typically start their life with at + least one pool (glance) loaded with a disproportionately high amount of + data/objects where other pools may remain empty. This can trigger HEALTH_WARN + if mon_pg_warn_max_object_skew is exceeded but that is actually false positive. diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 79cff5f3..ccbe7970 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -169,6 +169,10 @@ def get_ceph_context(): if config('default-rbd-features'): cephcontext['rbd_features'] = config('default-rbd-features') + if config('disable-pg-max-object-skew'): + cephcontext['disable_object_skew'] = config( + 'disable-pg-max-object-skew') + # NOTE(dosaboy): these sections must correspond to what is supported in the # config template. sections = ['global', 'mds', 'mon'] diff --git a/templates/ceph.conf b/templates/ceph.conf index b19cde13..b4cdb034 100644 --- a/templates/ceph.conf +++ b/templates/ceph.conf @@ -50,6 +50,10 @@ keyring = /var/lib/ceph/mon/$cluster-$id/keyring {{ key }} = {{ mon[key] }} {% endfor %} {% endif %} +{% if disable_object_skew and "mon pg warn max object skew" not in mon %} +mon pg warn max object skew = 0 +{% endif %} + [mds] keyring = /var/lib/ceph/mds/$cluster-$id/keyring diff --git a/unit_tests/test_ceph_hooks.py b/unit_tests/test_ceph_hooks.py index 2ceec433..0f96d2da 100644 --- a/unit_tests/test_ceph_hooks.py +++ b/unit_tests/test_ceph_hooks.py @@ -48,7 +48,8 @@ CHARM_CONFIG = {'config-flags': '', 'nagios_degraded_thresh': '1', 'nagios_misplaced_thresh': '10', 'nagios_recovery_rate': '1', - 'nagios_ignore_nodeepscub': False} + 'nagios_ignore_nodeepscub': False, + 'disable-pg-max-object-skew': False} class CephHooksTestCase(unittest.TestCase):