Skip to content

Proxmox HA failover — making VMs survive a host outage

How Proxmox HA works under the covers, the storage and quorum prerequisites, and the procedure to enable HA for a VM and test it without surprising prod.

Proxmox HA is the cluster feature that restarts a VM on a surviving node when its current host dies. It is built on a cluster of Proxmox nodes that already share quorum (see Proxmox cluster with corosync) and shared storage that the surviving nodes can reach. This article covers what Proxmox HA does (and what it does not — it is not a live-migration zero-downtime mechanism), the prerequisites a cluster has to satisfy first, and the procedure to enable HA for a guest and rehearse a failover.

How to verify

Before enabling HA, confirm the cluster has quorum, the storage that backs the VM is reachable from all candidate nodes, and the pve-ha-lrm and pve-ha-crm services are running.

sudo pvecm status | grep -E 'Quorate|Nodes'
sudo systemctl is-active pve-ha-crm pve-ha-lrm
pvesm status   # list storages — find your shared one
qm config 100  # the VM ID — confirm disk is on the shared storage
ha-manager status

ha-manager status shows the cluster’s HA state machine — the CRM (cluster resource manager) elects a master node which makes scheduling decisions; the LRMs (local resource managers) on each node execute them.

What’s happening

Proxmox HA has three moving parts on top of corosync quorum. The CRM is one daemon per cluster (the master) that watches for failed nodes and decides where to restart their guests. The LRMs are per-node daemons that own local execution — starting, stopping, migrating, and monitoring the guests assigned to them. A watchdog (hardware via IPMI/iLO or software via softdog) is what makes the suicide-on-isolation behaviour work: a node that loses quorum and cannot self-fence will reboot itself within the watchdog interval, ensuring it cannot host the guest while another node has restarted it.

When a node dies, the CRM detects the loss of quorum vote, waits for the fencing/watchdog window to expire, and instructs an LRM on a surviving node to start the dead node’s guests. This is restart-on-failure, not zero-downtime — the guest is power-cycled. RTO is typically 60-120 seconds, dominated by the watchdog timeout and the guest’s boot time.

The procedure

  1. Confirm shared storage. HA only works for VMs whose disks live on storage every candidate node can reach. Ceph, NFS, iSCSI with a shared LUN, or storage replication via pve-zsync all qualify. A VM with a local-zfs disk cannot HA — its disk does not exist on the failover target.

  2. Enable a watchdog. Without one, HA will not arm; corosync just spins. On hosts with IPMI, install ipmi-watchdog; otherwise the kernel softdog module works and is what most homelabs use:

    # softdog (default on Debian)
    echo 'softdog' | sudo tee /etc/modules-load.d/softdog.conf
    sudo modprobe softdog
    sudo systemctl restart pve-ha-lrm
  3. Add the VM to HA management. Via the web UI: Datacenter → HA → Add. Via the CLI:

    sudo ha-manager add vm:100 --group production --max_restart 2 --max_relocate 2
    sudo ha-manager status

    The max_restart is how many times the LRM tries to restart on the same node before giving up; max_relocate is how many other nodes it tries.

  4. Use HA groups to constrain placement. Without a group, HA will start the VM on whatever node it picks. Groups let you pin VMs to subsets of nodes (e.g. “DC1 nodes only,” “nodes with GPU”):

    sudo ha-manager groupadd production --nodes pve01,pve02,pve03 --restricted 1
    sudo ha-manager set vm:100 --group production
  5. Rehearse a failover — on purpose. The only way to know HA works is to test it. On a host with a known-HA VM, kill the network or pull the power and watch the surviving nodes pick up the VM. The CRM logs the decision in journalctl -u pve-ha-crm:

    # On pve02 (the host of vm 100)
    sudo systemctl stop networking      # simulates a network partition
    # Wait 60-120 seconds
    # On pve01:
    ha-manager status                   # should show vm 100 moving to pve01

    When done, bring pve02 back; the CRM will fence it (the watchdog reboots it) and once it rejoins the cluster, it will accept being demoted.

  6. Monitor the HA stack. Watch the CRM and LRM logs; alert on Quorate: No from pvecm status; alert on unfencable events from the CRM. The HA stack failing silently is worse than not having HA — operators assume it’ll work and find out at the wrong moment.

Operational notes

  • HA is restart-on-failure, not live migration — guests power-cycle when their host dies. Live migration is a separate, planned-maintenance feature.
  • Without a watchdog, a node that loses quorum but stays up can host a guest at the same time another node has restarted it (split-brain). Always enable a watchdog before turning on HA.
  • HA group restricted flag matters: 0 means the group is a preference (failover to outside-the-group is allowed); 1 means strict (the VM never runs outside the group, even if it means staying down).
  • Backups (vzdump) running during a failover can leave the failed-over VM in a confused state; pause the backup schedule on the affected node before deliberate failover tests.
  • The watchdog timeout (typically 60s for softdog) is the floor on your RTO; the actual recovery time also includes corosync detection (~10s), CRM decision (~10s), guest boot (variable). Plan 1-3 minutes total.

Stack Harbor enables Proxmox HA only after the cluster meets the prerequisites — quorum, watchdog armed, truly shared storage, monitored failover events. We test failover during onboarding rather than discovering on a 3 a.m. incident that it never worked. The clients who told us “we have HA” but couldn’t show a failover drill get that closed during onboarding to Clustered Environments.