[pve-devel] [RFC pve-ha-manager 0/5] external fence device support

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 11 12:39:00 CET 2015


After switching on and off from this series quite some time I refactored and divided it a bit.

This series implements basic support for external fencing devices. This is not meant for committing but for comments only,
if the base principle is OK I'll continue.

Fencing can be toggled from waiting for the agent lock only
and hardware fencing at the moment only with a variable in the PVE2 env (hardware_fencing) and needs a rebuild (sorry).

Devices can be configured in /etc/pve/ha/fence_devices.cfg and follow the dlm.conf format.
An example would be:

> # begin /etc/pve/ha/fence_devices.cfg
> device pve_mitte fence_pve ip="192.168.XX.XX" password="unsecure" action=off
> connect pve_mitte node=uno plug=100
> connect pve_mitte node=due plug=101
> connect pve_mitte node=tre plug=102
> 
> device power_s fence_apc ip=192.168.XX.XX username=fencing password=unsecure action=reboot ssh
> connect power_s node=due plug=1 switch=1
> connect power_s node=tre plug=1 switch=1
> # end /etc/pve/ha/fence_devices.cfg

Currently there can be some problems when a node gets fenced with reboot as action, 
and it comes almost immediately up again during the time where it's services gets relocated.
This case is a bit unlikely in a real world scenario but needs to be addressed absolutely nonetheless.

On the road map are currently:
 * add retries for devices in (recoverable) error cases (e.g. fence_apc is quite fragile and my fail sometimes on the first try)
 * add manual unfencing possibility (this is an idea inly at the moment)
 * add regression test (with the sim env) and test a lot
 * catch some corner case errors


Thomas Lamprecht (5):
  add FenceConfig class for external fencing devices
  add Fence class for external fence devices
  add fence_agent method to HA environment
  allow use of external fencing devices
  Adapt log message and regression tests

 src/PVE/HA/CRM.pm               |   4 +
 src/PVE/HA/Env.pm               |  10 ++
 src/PVE/HA/Env/PVE2.pm          |  57 ++++++++++++
 src/PVE/HA/Fence.pm             | 179 +++++++++++++++++++++++++++++++++++
 src/PVE/HA/FenceConfig.pm       | 200 ++++++++++++++++++++++++++++++++++++++++
 src/PVE/HA/Makefile             |   2 +-
 src/PVE/HA/Manager.pm           |   4 +
 src/PVE/HA/NodeStatus.pm        |  13 ++-
 src/PVE/HA/Sim/Env.pm           |  23 +++++
 src/test/test-basic1/log.expect |   2 +-
 src/test/test-basic2/log.expect |   2 +-
 src/test/test-basic5/log.expect |   2 +-
 12 files changed, 492 insertions(+), 6 deletions(-)
 create mode 100644 src/PVE/HA/Fence.pm
 create mode 100644 src/PVE/HA/FenceConfig.pm

-- 
2.1.4





More information about the pve-devel mailing list