Skip to main content

VM auto-restart after a failure

Center automatically starts a virtual machine (VM) that should be running but powered off without a command: it terminated abnormally, stopped when its node failed, or stayed powered off after a pool failover. Center does not start a VM that was powered off from the guest OS or by a command. A VM has no separate setting for this: auto-restart covers every VM that should be running.

Failure or shutdown​

Center stores the desired power state of a VM — the one set by the last command — and compares it with what the nodes report. When the VM process ends, the node reports who ended it and with which code.

How the VM powered offWhat Center decides
The guest OS shut down on its own after a successful startintentional: the desired state becomes Powered Off
Stop in the web interface or through the APIintentional
The VM terminated abnormally: hypervisor error, guest fault, process killedfailure: the VM is started again
The node was rebooted or stopped without being drainedfailure: the VM is started again
The pool failed over to another nodefailure: the VM is started again
The node failed, and no shutdown report was sentfailure: the VM is started again
The VM powered off, and the node did not report whythe desired state becomes Powered Off, the health shows VM is powered off, reason unknown; the VM is not started again
The VM is suspendeddoes not start it

The node, not Center, handles a guest OS reboot: it starts the VM again right away. If the guest reboots more than 5 times in 60 seconds — this is the default in the OS profile — the node powers off the VM. After that, Center starts the VM again. To break this cycle, stop the VM with the Stop button and eliminate the cause of the guest OS reboots.

Auto-restart conditions​

Center runs the check on a schedule — every 5 minutes — and after each VM inventory on the nodes. If a VM should be running but is not, Center assigns it a series of start attempts. Center does not assign a series if:

  • a task or migration is in progress on the VM;
  • the VM is suspended;
  • the node of the VM does not respond — then the VM health is Unreachable; Center starts a VM lost together with its node on another node — Node failure;
  • the user's last Start failed — start the VM manually;
  • auto-restart is disabled on the cluster;
  • the VM has not finished being created;
  • the pool of the VM is still failing over after a node failure — then the Start VMs after pool failover task starts the VM;
  • the pool of the VM is not running on any node.

If a VM is running while its desired power state is Powered Off, Center does not power it off. If the mismatch lasts for at least two checks and at least 10 minutes, Center changes the desired state to Powered On — the health shows Desired state changed to Powered On by system.

Number of start attempts​

  • Up to 5 attempts. The pauses between attempts are 2, 4, 8 and 8 minutes. The attempt count is kept even after Center restarts.
  • While the attempts are in progress, the VM health is Warning with the reason Start failed, retry <N> of 5.
  • After the fifth failure, Center stops trying: the health is Error with the reason Start failed, 5 attempts exhausted, and the event goes to the security event log. Start the VM manually.
  • The node response "another command is in progress" does not count as a failure: the attempt is postponed by 2 minutes.
  • A successful start — any start, including a manual one — resets the count.

Each attempt is visible in the Tasks section as a Power on VM task run by the system. To stop the attempts, terminate this task: the VM health becomes Error with the reason Auto-restart stopped by user — Tasks.

Where the VM starts​

  • Node. Center chooses the node in the same way as for a start without a selected node: by node load, and with DRS enabled — by DRS load. A VM that can be started on another node may start on a different node than the one where it ran. Auto-restart follows the mandatory DRS placement rules — DRS.
  • Memory. Center starts the VM on the first suitable node that has enough memory for it under the overcommit rules — Resource accounting: quotas and node memory. Auto-restart does not check the quotas of the virtual data center (VDC) or the memory reserve for node failures.
  • Insufficient memory. If no node has enough memory, the attempt fails and counts toward the series.

What you see​

  • Until Center learns about the node failure, the VM shows its previous status; when the node stops responding, the VM health is Unreachable.
  • Then the VM goes through Offline → Starting → Started. The Node field may change, and Remotely may appear next to it.
  • If the VM did not start, it stays Offline or Start failed, and Health shows the reason — VM statuses. Start it manually — VMs did not start after a node failure.

Limitations​

  • Center is required. While the management VM is unavailable, VMs are not started — Management VM failure.
  • Center does not start the management VM or other service VMs: the node starts the management VM when it opens its pool.
  • A Windows VM whose initial setup is not finished is started by Center on the node of the pool until the setup is finished — even with auto-restart disabled.
  • A cluster-wide switch — the feature.vm_auto_restart cluster parameter: 1 — auto-restart is enabled, 0 — disabled; without the parameter, auto-restart is enabled. If auto-restart was disabled with the old parameter on a 3.2 cluster, the upgrade to 3.3 writes 0. Center 3.3 does not read the old feature.autonomous_VM_wakeup parameter. To change the parameter, contact vStack support. With auto-restart disabled, the node failure recovery tasks close immediately with the reason "Auto-restart is disabled".

What not to do​

  • Do not manually start the VMs of a failed node on another node until the node is powered off or has returned. If it only lost connectivity, the VM may still be running on it — VM double-start protection.
  • Do not power off a VM from inside the guest OS instead of rebooting it. Center treats this as an intentional shutdown and does not start the VM.

See also​