Configure HA and verify failover
This lab proves that HA actually works in your environment, not just that the toggle is set. Until you have done a real failover drill, you don’t have HA — you have HA configured.
Steps
1. Configure fencing
Each node needs a hardware watchdog. Most server hardware supports this out of the box; nested virtualisation needs it emulated.
# Check the watchdog device exists
ls -la /dev/watchdog
systemctl status systemd-modules-load
If the watchdog is not present, enable softdog as a fallback (not for production but fine for this lab):
echo "softdog" >> /etc/modules-load.d/watchdog.conf
modprobe softdog
2. Add the VM to HA
In the GUI: Datacenter → HA → Add → HA-managed VM.
- VM: 100
- Group:
ha-group-1(default) - Request state: started
- Max restart: 1
- Max relocate: 1
Or via the CLI:
ha-manager add vm:100 --state started --group ha-group-1
ha-manager status
3. Verify HA state
ha-manager status
# Look for vm:100 with status=started, group=ha-group-1
4. Trigger a failure (controlled)
Run on the node hosting vm:100:
# Option A: graceful migration to a different node first
ha-manager migrate vm:100 pve-02
# Option B: simulate a crash (more aggressive)
echo c > /proc/sysrq-trigger # WARNING: hard reboot
For the lab, prefer Option A first. Then test Option B once you are confident the failover works.
5. Watch the recovery
Within 60 seconds:
- The original node becomes unreachable
- The CRM on the surviving master restarts vm:100 on a survivor
ha-manager statusshows vm:100 asstartedon the new host- The VM’s IP becomes reachable again
6. Verify fencing
If you used Option B, after the failed node boots:
# On the survivor that hosted vm:100 after failover:
journalctl -u corosync -n 200
grep -i fence /var/log/syslog
You should see fencing actions issued by the CRM.
Verification
- vm:100 is
startedafter a simulated node failure - The failover completes within 60 seconds
ha-manager statusreports no errors- Watchdog self-fence log entry exists when Option B is used
Cleanup
Remove the HA-managed VM from HA before tearing down the lab:
ha-manager remove vm:100