Virtualization

Test KVM Host Failure and Automatic VM Recovery

Run an external one-second application probe; Abruptly fail the active KVM host; Measure detection, fencing, restart, and service recovery; Validate data, rejoin the host, and clear only understood failures.

By InventiveHQ Team

Episode 25 of the InventiveHQ KVM virtualization series.

Lab verified July 2026 · Ubuntu 26.04 · libvirt 12.0.0 · QEMU 10.2.1

What this episode proves

  • Run an external one-second application probe
  • Abruptly fail the active KVM host
  • Measure detection, fencing, restart, and service recovery
  • Validate data, rejoin the host, and clear only understood failures

Validated workflow

1. Run an external one-second application probe

./probe-cluster-service.sh /tmp/ihq-ha-key 180

2. Abruptly fail the active KVM host

virsh destroy kvm-ha01

3. Measure detection, fencing, restart, and service recovery

pcs stonith history

4. Validate data, rejoin the host, and clear only understood failures

pcs resource cleanup ha-demo01

Finished state

The cluster is clean, ha-demo01 is healthy on a surviving node, and the failed node has rejoined. The public scripts contain no private keys, passwords, or tokens. Review names, addresses, paths, ownership, backups, quorum, and fencing for your own environment before running them.

Need help from an IT & cybersecurity partner?

InventiveHQ helps businesses secure, modernize, and run their technology. Let's talk about your goals.

Get in touch