From 3de8f22cd1f7e376e33b7995b6d0db8bdfcc9605 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 4 May 2021 16:22:21 -0400 Subject: [PATCH] mgr/cephadm: do not autotune when _no_autotune_memory label is present Signed-off-by: Sage Weil (cherry picked from commit 1e4d20a592aa6ca111201b0a3edc4dd619885f93) --- doc/cephadm/host-management.rst | 6 ++++++ src/pybind/mgr/cephadm/serve.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/cephadm/host-management.rst b/doc/cephadm/host-management.rst index 5b6e0c2f9a9bc..012dafc33889a 100644 --- a/doc/cephadm/host-management.rst +++ b/doc/cephadm/host-management.rst @@ -140,6 +140,12 @@ The following host labels have a special meaning to cephadm. All start with ``_ an existing host that already contains Ceph daemons, it will cause cephadm to move those daemons elsewhere (except OSDs, which are not removed automatically). +* ``_no_autotune_memory``: *Do not autotune memory on this host*. + + This label will prevent daemon memory from being tuned even when the + ``osd_memory_target_autotune`` or similar option is enabled for one or more daemons + on that host. + * ``_admin``: *Distribute client.admin and ceph.conf to this host*. By default, an ``_admin`` label is applied to the first host in the cluster (where diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index d419ff2bb5759..681434ddcf274 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -283,7 +283,10 @@ class CephadmServe: if r: failures.append(r) - if self.mgr.cache.host_needs_autotune_memory(host): + if ( + self.mgr.cache.host_needs_autotune_memory(host) + and not self.mgr.inventory.has_label(host, '_no_autotune_memory') + ): self.log.debug(f"autotuning memory for {host}") self._autotune_host_memory(host) -- 2.39.5