STONITH fencing protects clustered services from split-brain and data corruption by forcefully isolating a node that is no longer trustworthy.
Pacemaker implements fencing as a STONITH resource that calls an external fence agent (such as fence_ipmilan or fence_redfish) to power off, reboot, or otherwise block access to shared resources. The STONITH resource stores the device parameters and constrains which cluster nodes the device is allowed to fence through host mapping options such as pcmk_host_list.
Fencing configuration must match the physical environment, including management network reachability, device credentials, and correct mapping between cluster node names and fence targets. Incorrect settings can power-cycle the wrong system, while enabling fencing without working STONITH devices can prevent recovery because resource start is blocked when a fence action cannot complete.
$ sudo pcs status nodes Pacemaker Nodes: Online: node-01 node-02 node-03 Standby: Standby with resource(s) running: Maintenance: Offline: Pacemaker Remote Nodes: Online: Standby: Standby with resource(s) running: Maintenance: Offline:
$ sudo pcs stonith list | head -n 5 apcmaster - APC MasterSwitch apcmastersnmp - APC MasterSwitch (SNMP) apcsmart - APCSmart baytech - BayTech power switch bladehpi - IBM BladeCenter (OpenHPI)
$ sudo pcs stonith describe fence_dummy
fence_dummy - Dummy fence agent
fence_dummy
Stonith options:
random_sleep_range
Description: Issue a sleep between 1 and X seconds. Used for testing.
Type: string
status_file
Description: File with status
Type: string
Default: /tmp/fence_dummy.status
type
Description: Type of the dummy fence agent
Type: string
Default: file
##### snipped #####
Default operations:
monitor:
interval=60s
$ sudo pcs stonith create fence-dummy-node-01 fence_dummy pcmk_host_list="node-01" pcmk_host_check=static-list
Most production environments require one STONITH resource per node because each management controller controls a single host, and typing passwd= on the command line can expose credentials in shell history.
Incorrect fence settings can power-cycle the wrong system.
$ sudo pcs stonith create fence-dummy-node-02 fence_dummy pcmk_host_list="node-02" pcmk_host_check=static-list
Incorrect host mapping can fence the wrong target.
$ sudo pcs stonith create fence-dummy-node-03 fence_dummy pcmk_host_list="node-03" pcmk_host_check=static-list
$ sudo pcs property set stonith-enabled=true
Enabling stonith-enabled without complete, working fencing coverage can block failover and keep resources stopped.
$ sudo pcs stonith status * fence-dummy-node-01 (stonith:fence_dummy): Started node-01 * fence-dummy-node-02 (stonith:fence_dummy): Started node-02 * fence-dummy-node-03 (stonith:fence_dummy): Started node-03
$ sudo pcs property config Cluster Properties: cib-bootstrap-options cluster-infrastructure=corosync cluster-name=clustername dc-version=2.1.6-6fdc9deea29 have-watchdog=false last-lrm-refresh=1767240361 no-quorum-policy=stop stonith-enabled=true