From 91b7d9dfc38c79f285ee52cac53ebdc6a6cade35 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 4 Nov 2024 14:13:02 -0500 Subject: [PATCH] mgr/cephadm: trigger host metadata refrsh when taking host out of maintenance If a host was in maintenance mode, we should make sure to check all of the host information again once it's taken out even if it hasn't been long enough for the daemon/device/facts etc. cache to timeout. Some users may make changes to things like the node's hardware or OS during maintenance mode that we should make sure to pick up as soon as possible Signed-off-by: Adam King --- src/pybind/mgr/cephadm/module.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b27b2cd3ee0f7..1a5389d026083 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2300,6 +2300,10 @@ Then run the following: tgt_host['status'] = "" self.inventory._inventory[hostname] = tgt_host self.inventory.save() + # make sure we refresh state for this host now that it's out + # of maintenance mode. Maintenance mode is a time where users + # could have theoretically made a lot of changes to the host. + self._invalidate_all_host_metadata_and_kick_serve(hostname) self.set_maintenance_healthcheck() -- 2.39.5