Autostart VM in free version of XenServer 6.x

Unlike previous versions, VMs do not have a visible property in the GUI allowing autostart, which kinda sucks big time. This has been claimed to interfere with High Availability (HA) and produced unexpected results during HA functions.

So, what we are going to do?!

First approach is to set auto_poweron parameter to true at the pool and VM level.

Setting the XenServer to allow Auto-Start
1. Gather the UUID’s of the pools you wish to auto-start.
To get the list of the pool’s on your XenServer type

xe pool-list

2. Copy the UUID of the pool. If you have just one server, it will still have a pool UUID as bellow:

uuid ( RO) : d170d718-e0de-92fc-b920-f4c59cc62e91

name-label ( RW):

name-description ( RW):

master ( RO): 755d4ea3-373b-44b9-8ae3-3cd6f77a7f33

default-SR ( RW): 51218f44-6ac6-4893-98fb-f924b08f7af9

3. Set the pool or server to allow auto-start:

xe pool-param-set uuid=UUID other-config:auto_poweron=true

Note: *Replacing UUID with the UUID of the XenServer or pool.

Setting the Virtual Machines to Auto-Start
1. Gather the UUID’s of the Virtual Machine you want to auto-start by typing:

xe vm-list

Note: This generates a list of Virtual Machines in your pool or server and their associated UUID’s.

2. Copy the UUID of the Virtual Machines you want to auto-start, and type the following command for each Virtual Machine to auto-start:

xe vm-param-set uuid=UUID other-config:auto_poweron=true

Note: *Replace UUID with the UUID of the Virtual Machine to auto-start.*

For this second part (enabling auto-start for the VMs) we can use a little one-line script, which would enable autostart for ALL vms: