Skip to main content

Autostart VM on boot

How to start VM on host boot?

A VM can be started at XCP-ng boot itself, it's called Auto power on. We have two ways to configure it: using Xen Orchestra or via the CLI.

With Xen Orchestra

In Xen Orchestra we can just enable a toggle in VM "Advanced" view, called Auto power on. Everything will be set accordingly.

With the CLI

  1. Determine the UUID of the pool for which we want to enable Auto Start. To do this, run the console command on the server:
# xe pool-list
uuid ( RO) : <VM_UUID>
  1. Allow autostart of virtual machines at the pool level with the found UUID command: # xe pool-param-set uuid=<VM_UUID> other-config:auto_poweron=true

Now we enable autostart at the virtual machine level. 3. Execute the command to get the UUID of the virtual machine:

# xe vm-list
uuid ( RO) : <VM_UUID>
name-label ( RW) : VM
power-state ( RO) : running
  1. Enable autostart for each virtual machine with the UUID found: # xe vm-param-set uuid=<VM_UUID> other-config:auto_poweron=true

  2. Checking the output # xe vm-param-list uuid=<VM_UUID> | grep other-config