]> git.proxmox.com Git - pve-ha-manager.git/commit - src/PVE/HA/Env/PVE2.pm
Env, HW: add HW fencing related functions
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Mar 2016 12:01:27 +0000 (13:01 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Mar 2016 06:40:06 +0000 (07:40 +0100)
commitc982dfeea25f0cd253dee88cda7afc1c53ad80cf
tree9cf45011177e89be50abe1d5164b2e33c4da0859
parent7b8f63292ed1b4fdf58c2e5f7e712fc54c1a390e
Env, HW: add HW fencing related functions

This adds three methods to hardware fencing related functions:
* read_fence_config
* fencing_mode
* exec_fence_agent

'read_fence_config' allows to create a common code base between the
real world and the test/sim world regarding fencing a bit easier.
In PVE2 it parses the config from /etc/pve/ha/fence.cfg and in
the Sim method it parses the config from testdir/status/fence.cfg.

The 'fencing_mode' method checks respective to the callee's
environment if hardware fencing is enabled and returns the wanted
mode:

* PVE2: if the datacenter.cfg key 'fencing' is set then it will be
        used, else we use 'watchdog' as default.

* Sim: if the cfg exist and at least one device is configured we use
       'hardware' fencing, else we default to 'watchdog'.

For the simulator we should make also a option to turn HW fencing
off and on independent if devices are configured when we implement
HW fencing for it, but that is not really needed for now.

'exec_fence_agent' executes, as the name suggests, environment
specific a fence agent.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/HA/Env.pm
src/PVE/HA/Env/PVE2.pm
src/PVE/HA/Sim/Env.pm
src/PVE/HA/Sim/Hardware.pm