Chapter 10. Configuring SBD fencing in a high-availability cluster
Storage-based death (SBD) is a fencing mechanism that provides an alternative to traditional “power fencing” agents. SBD uses a watchdog timer, and optionally shared storage to make nodes self-fence if they become unresponsive or lose quorum.
You can use this approach in environments where network-based power management is unavailable, or where you want to ensure a node reboots if it loses access to the shared storage fabric.
10.1. Overview of SBD fencing Copy linkLink copied to clipboard!
Storage-based death (SBD) fencing provides a mechanism for nodes to self-fence in the event certain health checks fail or can’t be performed in time or a reboot is requested by disk-based messaging. You can implement SBD in one of two ways, depending on your hardware and storage availability.
| Feature | Watchdog-only fencing | Poison-pill fencing |
|---|---|---|
| Mechanism |
Relies on health and quorum monitoring. If a node loses quorum or cannot verify its own health, it stops resetting the watchdog timer. The cluster assumes fencing is successful only after the |
Uses shared storage to send explicit "poison pill" messages by the |
| Storage requirement | None. | Requires 1 to 3 shared block devices (minimum 4 MB each). Devices must be accessible by all nodes and cannot host a filesystem, be managed by LVM, or be part of a RAID/mirroring layer managed by the cluster. |
| Reliability |
Reliability is derived from a watchdog device (hardware WDT or | Reliability is derived from the same watchdog device mechanism. Although disks facilitate communication, the watchdog device is the responsible for guarantying a reboot. Because Pacemaker awareness keeps a cluster accessible when disks are not available, even a single shared disk does not represent a single point of failure (SPOF). However, use three disks if you want to be able to fence when a storage device is unavailable. |
| Performance |
Can be configured for faster recovery by reducing network latency blips. However, the cluster must wait for the full | Potentially provides faster reboot because a responsive target node might react to the fence message immediately. However, it might require higher storage-layer timeouts, such as 30s, to account for storage maintenance or firmware updates. If a node comes back quickly resource recovery time might be short otherwise resource recovery is held back by these storage timeout requirements. |
| Common use case | Environments without shared storage. Preferred for clusters with at least 3 quorum voters (or 2 nodes and a QDevice). | Primarily used in 2-node clusters to bypass the 3-vote quorum limitation of watchdog-only setups. Also useful for multi-site clusters where the network link between members might be severed but storage remains accessible. |
10.2. Configuring watchdog-only SBD fencing Copy linkLink copied to clipboard!
In a watchdog-only configuration nodes monitor quorum state and their health as seen by the cluster. If a node is unable to retrieve the cluster view (CIB) or if the cluster determines the node is in an unhealthy state, the local watchdog timer on that node to expire, triggering a reboot.
Prerequisites
- A running high-availability cluster.
-
A functional watchdog timer (WDT) device available on all nodes at
/dev/watchdogor another device path configured on a per node basis. - No other fencing devices are active, or if other fencing devices are available in the cluster watchdog-fencing can be limited to those nodes that can’t be fenced by those or a fencing topology can be configured to have watchdog-fencing as fallback
SBD implementation is modular and can be deployed selectively within a cluster. In heterogeneous environments, such as those containing pacemaker-remote nodes or hardware lacking functional watchdog devices, SBD remains a viable fencing solution for compatible members. The absence of universal SBD support does not preclude its selective implementation on supported nodes.
Procedure
On all nodes in the cluster, install the
sbdpackage:# dnf install sbdOn each node, list the available watchdog devices to identify the proper device path:
# pcs stonith sbd watchdog listOn each node, verify that the watchdog device functions correctly by triggering a test:
WarningThis command reboots the system to confirm the watchdog can successfully trigger a hardware reset. Perform this test only before enabling the SBD daemon; the command does not work after the daemon has taken control of the watchdog device.
# pcs stonith sbd watchdog testOn one node, enable SBD fencing to update
/etc/sysconfig/sbdon all nodes and enables thesbdservice:# pcs stonith sbd enable sbd_watchdog_timeout=5Set the cluster
stonith-watchdog-timeoutproperty. This value determines how long the remaining cluster nodes do wait before assuming a missing node has successfully self-fenced:# pcs property set stonith-watchdog-timeout=10ImportantEach node verifies this property individually before bringing up resources. To prevent split-brain scenarios,
stonith-watchdog-timeoutmust be at least as large as the value ofSBD_WATCHDOG_TIMEOUT. Do not set this property to-1for automated calculation, as inconsistentSBD_WATCHDOG_TIMEOUTvalues across nodes would then lead to different calculations of stonith-watchdog-timeout (a value that needs to be consistent for both the fencing originator and the target - lower for originator than target leads to split-brain) for different nodes.Restart the cluster to initialize the SBD processes:
# pcs cluster stop --all # pcs cluster start --all
Verification
Verify that the SBD status is active:
# pcs stonith sbd statusManually trigger a fence test to ensure the configuration works:
WarningThis command reboots the target node immediately.
# pcs stonith fence node_name
10.3. Creating a visible watchdog device for selective fencing Copy linkLink copied to clipboard!
In heterogeneous clusters where some nodes lack a functional hardware watchdog, you can create a visible fencing resource to ensure watchdog-only fencing is applied only to supported nodes.
Prerequisites
- SBD is enabled in watchdog-only mode on the supported nodes.
- A functional hardware watchdog device is available on the target nodes.
Procedure
Create the watchdog fencing resource. Use the
pcmk_host_listattribute to specify only the nodes that possess a functional watchdog device:# pcs stonith create watchdog_fencing fence_watchdog pcmk_host_list="node-01,node-02"-
If the cluster contains nodes that are not in the
pcmk_host_list, configure an alternative fencing method (such as IPMI or a power-based agent) for those specific nodes. Configure fencing levels to use the watchdog as a fallback. Set the primary fencing agent at level 1 and the watchdog agent at level 2.
# pcs stonith level add 1 node-01 ipmi_fencing # pcs stonith level add 2 node-01 watchdog_fencing
Verification
Confirm that the resource is restricted to the specified hosts:
# pcs stonith config watchdog_fencingVerify that the cluster recognizes the fencing topology:
# pcs stonith level
10.4. Configuring watchdog-only SBD fencing in a 2-node cluster with a QDevice Copy linkLink copied to clipboard!
When using a 2-node cluster, adding a quorum device (corosync-qdevice) provides an additional vote to quorum, making its behavior closer to odd-numbered member clusters. This allows the cluster to bypass the standard 3-node minimum quorum vote limitation for watchdog-only SBD fencing.
When combining a QDevice with watchdog-only SBD fencing, you must strictly align your timeout values, otherwise SBD prevents startup.
Procedure
Determine the required timeout values for your cluster:
-
qdevice-sync_timeout: The default value is30s. -
SBD_WATCHDOG_TIMEOUT: If this value is less than theqdevice-sync_timeout, a quorum state update can be delayed long enough to cause a split-brain situation. -
stonith-watchdog-timeout: This value must be higher than theSBD_WATCHDOG_TIMEOUTto ensure the cluster waits long enough for a node to self-fence. Set this to double the value of theSBD_WATCHDOG_TIMEOUT. Therefore, ifSBD_WATCHDOG_TIMEOUTis 30, this should be60.
-
Enable SBD and configure the watchdog timeout. By not specifying any block devices, SBD will automatically defaults to watchdog-only fencing:
# pcs stonith sbd enable SBD_WATCHDOG_TIMEOUT=30Configure the
stonith-watchdog-timeoutcluster property to enable the implicit, "hidden" watchdog STONITH device:# pcs property set stonith-watchdog-timeout=60Optional: Create a visible watchdog fencing device. Incorporate this device into a fencing topology, such as configuring it as a fallback for other fencing devices that have failed, or limiting it to a certain list of nodes. Configure the device using the
fence_watchdogagent:# pcs stonith create sbd_watchdog fence_watchdog
10.5. Configuring poison-pill SBD fencing Copy linkLink copied to clipboard!
Poison-pill fencing uses shared block devices to communicate fencing instructions. When a node needs to be fenced, the cluster writes a message to the shared device. The target node reads this message and reboots itself.
Prerequisites
- A running high-availability cluster.
-
A functional watchdog timer (WDT) device available on all nodes at
/dev/watchdog. - One to three shared block devices (typically 1-4mb in size) accessible by all nodes.
- The shared devices must not contain a filesystem or be managed by LVM.
Procedure
On all nodes in the cluster, install the SBD and fence agent packages:
# dnf install sbd fence-agents-sbdOn each node, verify that the watchdog device functions correctly by triggering a test:
WarningThis command reboots the system to confirm the watchdog can successfully trigger a hardware reset. Perform this test only before enabling the SBD daemon; the command does not work after the daemon takes control of the watchdog device.
# pcs stonith sbd watchdog testInitialize the shared SBD block device. Replace
/dev/sdbwith the path to your shared device:NoteIf you are using multiple shared block devices for redundancy, repeat the
device=parameter for each device (for example,device=/dev/sdb device=/dev/sdc).# pcs stonith sbd device setup device=/dev/sdbEnable SBD with the shared device:
# pcs stonith sbd enable device=/dev/sdb sbd_watchdog_timeout=5Create the fencing device in the cluster. This example uses
fence_sbd_storageas the resource name:# pcs stonith create fence_sbd_storage fence_sbd devices=/dev/sdbAdjust the
pcmk_reboot_timeoutto ensure the cluster waits long enough for the disk message to be processed. This value should be at least 5 seconds higher than themsgwaitvalue stored on the disk:# pcs stonith update sbd_fence pcmk_reboot_timeout=15
Verification
Verify that the service is enabled and running, the nodes are correctly registered on the SBD device and check their slot status:
# pcs sbd status --fullCheck the
stonith-watchdog-timeoutcluster property:# pcs property show stonith-watchdog-timeoutFor a standard poison-pill deployment, this value should be
0(disabled) to prevent the cluster from prematurely assuming a node has self-fenced before the poison-pill message is acknowledged. In advanced setups where this property is non-zero, ensure that all targets used for poison-pill fencing are explicitly excluded from watchdog-only fencing to avoid split-brain risks.Manually trigger a fence test to ensure the configuration works:
WarningThis command reboots the target node immediately.
# pcs stonith fence node_name
10.6. Timing configuration considerations in poison-pill fencing Copy linkLink copied to clipboard!
When deploying a Red Hat High Availability cluster using poison-pill fencing with Storage-based Death (SBD), configure timing carefully. Proper timeouts ensure that nodes are safely fenced during failures, preventing split-brain conditions while allowing cluster services to stabilize.
Here are the primary considerations for timing configurations in a poison-pill fencing scenario:
SBD_WATCHDOG_TIMEOUTKeep this at the default of 5 seconds. A higher value gives the cluster more time to resolve temporary connectivity blips without reacting harshly, but it increases the time it takes to recover from legitimate failures. Setting it below the default 5 seconds is cautioned against, as it can make the cluster overly aggressive and lead to instability during high load or brief unresponsiveness.
If your cluster uses a QDevice, set the
SBD_WATCHDOG_TIMEOUTparameter higher thanqdevice-sync_timeout(which defaults to 30s). Set a difference of 3 to 5 seconds to prevent delayed quorum updates from causing a split-brain situation.msgwaittimeoutThe duration that
fence_sbdwaits after writing the poison-pill message before the fencing action is considered complete. Set this to twice the value ofSBD_WATCHDOG_TIMEOUT, for example, 10 seconds, if the watchdog timeout is 5 seconds. Ifmsgwaitis set lower than the watchdog timeout, the cluster can prematurely declare the fencing operation successful while the target node is still processing the action or waiting for its hardware watchdog to expire, resulting in a split-brain scenario.The
msgwaitduration must be appropriately sized to securely cover three distinct scenarios:- The target successfully reads the message and self-fences: The intended scenario where the target node is still responsive, successfully reads the poison-pill message from the shared block device, and initiates a self-fence.
- The target loses access to the disks: The target node is still running but finds that it is not capable of reading from a quorate number of shared disks, causing it to recognize this loss of access and self-fence.
The target is completely unresponsive: The target node is frozen and incapable of doing anything. Because it cannot run actions, it won’t be able to reset the (hardware)-watchdog, which in turn leads to a reboot as well.
If
msgwaitis set lower than the timeout derived from preceding considerations, the cluster can prematurely declare the fencing operation successful while the target node is still processing the action or waiting for its hardware watchdog to expire, allowing a split-brain scenario.
pcmk_reboot_timeout(STONITH-level timeout)This is awaited by the cluster during timeout that dictates how long the STONITH device itself (
fence_sbd) awaits during a "reboot" action.This value should be raised so that it is at least 5 seconds higher than the
msgwaitattribute. If it is not raised accordingly, the cluster might give up on the fencing operation and report a failure before themsgwaitperiod has been fully exhausted.SBD_START_DELAYand startup delaysSetting a delay on startup gives the cluster extra time to stabilize and allows storage devices to fully come online before monitoring begins. Furthermore, there is a generic issue with cluster nodes after a quick recovery after fencing that they might still catch the broadcast about their own successful fence. This confuses them and brings them to a permanent error condition under the assumption something had gone wrong within the fencing sublayer.
-
With SBD: An increase of
SBD_START_DELAYcan be used to mitigate this behavior, purposefully slowing the node’s re-entry so the old broadcast clears. - Without SBD: For environments not using SBD, there is the hint to delay the corosync startup directly in the unit-file to achieve the same result.
-
With SBD: An increase of