High availability engineering · Part 2

How VMBook decides when a takeover is safe

VMBook’s HA design asks three questions before moving a workload. Is the original host really unavailable? Has its old copy lost permission to run? Can the target recover the workload without putting the rest of the fleet at risk?

VMBook site inventory showing computers and fleet context
VMBook fleet interface. Site and computer identity provide the context for a recovery decision. The HA results below come from separate simulations and lab drills.

Keep it simple. Keep it stable.

That is VMBook’s design principle. The default is to observe the failure, prepare the recovery and show the operator why each action is safe or held. The recovery plan names the old host, the isolation evidence, the target and the age of the data. Operators can explain the decision before they execute it. A brief interruption should leave healthy workloads running, and an uncertain recovery should wait for better evidence.

1. Treat a missing heartbeat as an observation

The development implementation uses a default five-minute grace period before preparing a host recovery. It asks from more than one vantage point. If another member can still see the host, or the host returns during the observation window, recovery is held or cancelled. Prepared recovery with operator confirmation is the default. Automatic recovery is an explicit policy and uses the same safeguards.

2. Confirm that the old copy cannot keep writing

Cross-site recovery uses a run lease, independent voters and a host-side lease guard. A lease provides fencing evidence only under the conditions enforced by the protocol, including evidence that the guard was running. The recovery can also use confirmed external isolation, such as BMC or PDU power-off. If the system cannot establish a safe fence automatically, an operator must verify isolation before proceeding.

A frozen host is especially tricky. When it wakes, it may still remember ownership that has expired elsewhere. VMBook pauses protected guests when lease ownership cannot be confirmed, and allows them to continue only after a valid renewal. A host that returns after takeover keeps its old copy stopped.

3. Verify that the target has independent data and capacity

VMBook distinguishes host, data and site protection. A second host attached to the same failed storage is an invalid recovery target for that storage incident. The plan looks for a usable replica on independent storage. If its recovery point is too old, the operator must explicitly decide whether the known loss is acceptable. If there is no usable target, the plan reports why it held the workload.

In a NAS lab drill, a slow NAS produced a warning. When it stopped responding, the recovery plan excluded a second host attached to the same NAS. One VM recovered from an independent replica, while two without independent replicas stayed down. The lab plan estimated that the selected replica was about 149 seconds behind. When the NAS came back, the original instance did not resume.

4. Prevent recovery from becoming a second incident

When several computers disappear together, VMBook checks for a shared cause before issuing mass recovery commands. Starts are paced and staggered. Replication backs off after failures. Recovery admission checks memory and disk capacity, and an automatic recovery attempt that fails is held for review. An operator can pause automated recovery while observation continues. Returning workloads to the original host is a deliberate decision.

What the million-seed runs actually found

Deterministic simulation lets engineers replay a sequence of network loss, clock changes, process failures and host freezes from its seed. Two early million-seed runs exposed 26 and 10 instances of related wake and renewal defects. One failure sequence let an old guest wake and write beside its replacement while ownership was still uncertain. The fix made the guard and the service enforce the wake check, with pause before termination when stopping a guest.

A fresh 1,000,000-seed run reported zero assertion failures and separately recorded 2,998 residual cases. Those cases involve combinations where the local guard and renewal service are unavailable together, including at wake-up. The generator deliberately over-sampled some of these combinations. The counts are test coverage and findings, not production probabilities. Independent fencing remains necessary to cover these combinations.

What to verify on your own infrastructure

  • Place primary, replica and witness in the failure domains your service must survive. Verify the actual dependency paths for power, network, storage and management access.
  • Test a host that loses its heartbeat while retaining disk access. Record the point at which its old guest can no longer write, then the time the new guest begins writing.
  • Measure application recovery separately from VM startup. Verify IP or DNS cutover, credentials, data integrity and the first successful transaction.

These results describe development builds and named lab tests. Application routing after failover, including IP and DNS changes, and larger group drills still require validation. The public Web UI demo lets you explore sample sites and machines. It does not execute a real failover.

Make recovery drills part of normal operations

Simulation helps find rare failure sequences. A controlled drill shows whether the real connections, permissions, replica and people are ready on your infrastructure. Start with a disposable workload. Record who can stop the exercise, what triggers an abort and what evidence is required before restoring service. Repeat after changes to storage, networking, fencing or the people responsible for recovery.

ExerciseWhat a pass looks like
Short heartbeat interruptionThe original guest keeps running and no replacement starts when independent checks still see it.
Network partition with the old guest still able to reach storageThe replacement waits until the old guest loses write access. Record the fencing evidence and the first write on the replacement.
Shared storage failureThe recovery plan skips hosts that depend on the failed storage, identifies the independent replica and reports how far behind it is.
Old host returns after takeoverThe old copy stays stopped. The application passes a write and read-back test through the intended client route.

Compare the measured recovery time and recoverable data against the application’s RTO and RPO. Keep the timeline, handoff notes and unresolved dependencies. Assign each gap an owner and run the affected scenario again after fixing it. That is how a simple recovery procedure stays dependable as the system changes.