]> git.proxmox.com Git - pve-ha-manager.git/commit - src/PVE/HA/Manager.pm
fix 'change_service_location' misuse and recovery from fencing
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 12 Feb 2016 15:14:54 +0000 (16:14 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 15 Feb 2016 09:34:41 +0000 (10:34 +0100)
commit9da84a0d51dcc1e1b80e2a92127749de38851e5f
tree43b311154a7ba0eb076d9506a3f96fd2288850cc
parentec368d742549c29c49c55834084c6c4fef07719b
fix 'change_service_location' misuse and recovery from fencing

First rename the change_service_location method from the environment
to an more fitting name, 'steal_service'.

The 'change_service_location' from the virtual hardware class stays
at it is, because there the name fits (those function have not the
same meaning, so it's good that they named different now).

As we misused the config steal method (former
change_service_location) in the stopped state to process the
services from fenced nodes we need another way now.

This is achieved through the private method 'recover_fenced_service'
which is now the only place who has the right to steal a service
from an node.
When a node was successfully fenced we no longer change its services
state to 'stopped', rather we drop that hack and search a new node
in 'recover_fenced_service', if found we the steal the service and
move it to from the fenced to the new (recovery) node and place it
there in the 'started' state, after that the state machine is able
to handle the rest.

If we do not find a node we try again next round as that is better
then placing it in the error state, because so we have still a
chance to recover, which we do not have with the error state.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 files changed:
src/PVE/HA/Env.pm
src/PVE/HA/Env/PVE2.pm
src/PVE/HA/Manager.pm
src/PVE/HA/Sim/Env.pm
src/PVE/HA/Sim/Resources.pm
src/test/test-basic1/log.expect
src/test/test-basic2/log.expect
src/test/test-basic5/log.expect
src/test/test-shutdown1/log.expect
src/test/test-shutdown2/log.expect
src/test/test-shutdown3/log.expect
src/test/test-shutdown4/log.expect