From: Adam King Date: Mon, 4 Nov 2024 19:13:02 +0000 (-0500) Subject: mgr/cephadm: trigger host metadata refrsh when taking host out of maintenance X-Git-Tag: v20.3.0~193^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=91b7d9dfc38c79f285ee52cac53ebdc6a6cade35;p=ceph.git 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 --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b27b2cd3ee0f..1a5389d02608 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()