]> git.proxmox.com Git - pve-ha-manager.git/commit
lrm: keep manual maintenance mode independent of shutdown policy
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 20 Apr 2023 11:13:13 +0000 (13:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 20 Apr 2023 12:12:07 +0000 (14:12 +0200)
commitf129138cb046b5940f57f0734ab9eba22a05668d
tree535a94a046699096c567e4995b076f9f41f5a931
parentf12abfe0720ef80ce59b7bc60c598a113fe31ada
lrm: keep manual maintenance mode independent of shutdown policy

We did not handle being in maintenance mode explicitly with shutdown
policies, which is in practice not often an issue as most that use
the maintenance mode also switched over the shutdown policy to
'migrate', which keeps the maintenance mode, but for all those
evaluating HA or only using the manual maintenance mode it meant that
on shutdown the mode was set to 'restart' or 'shutdown', which made
the active manager think that the node got out of the maintenance
state again, and marked it as online – but as it wasn't really online
(and on the way to shutdown), this not only cleared the maintenance
mode by mistake, it also had a chance to cause fencing - if any
service was still on the node – i.e., maintenance mode wasn't reached
yet, but still in-progress of moving HA services (guests).

Fix that by checking if maintenance mode is requested, or already
active (we currently don't differ those two explicitly, but could be
determined from active service count if required), and avoid changing
the mode in the shutdown and restart case. Log that also explicitly
so admins can understand what happened and why.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/HA/LRM.pm
src/test/test-crm-maintenance-request3/log.expect
src/test/test-crm-maintenance-request4/log.expect