Within vSphere 6.7 and later we can define the start order of VMs in a vSphere cluster in case of an HA event. This can be very useful for certain applications, like if the database server needs to be up before the application server connects to it for the application to run correctly.
General description of VMware vSphere HA functionality
How to configure this:
Within the vSphere HA configuration under Host Failure Response the third menu item addresses this. Change the default setting to “Guest Heartbeats Detected”
With this setting enabled, VMware HA will not start up the next group of VMs before it detects VM Guest heartbeats, which will first happen when the VM has started up and the OS is running. VMware tools have to be installed to detect Guest Heartbeat from the VM.
From the VM/Host Groups menu we have to create groups for the VMs we want to be powered on together.
For this I add two groups, one that I call database server and one I call App server. A good management practice is to use a naming standard to make it easy to read the intended start sequence. Here I use “# -” prefix in front of the description.
Create the rules that allow one group of VMs to be powered on before another group. Under VM/Host Rule select type “Virtual Machines to Virtual Machines” select the group that has to start before the next one can start. Create groups for all the VM groups that have been created.
VM Override can be used to define special behavior for individual VMs. In case you have VMs within the Cluster that don’t have VMware tools installed it is a good idea to define VM override rule. If they are in a group they will not give a heart beat and the following group will not start. The setting we need to choose for VMs that doesn’t have VMware tools is “Start next priority VMs when: Resources allocated”
Note the granularity here where we can add additional parameters per virtual machine in start up. One such parameter is VM Restart Priority. vCenter allows for 6 separate groupings of start order via the VM Restart Restart Priority setting. If a VM is overridden from the default setting they will start in the following order:
- Highest
- High
- Medium
- Low
- Lowest
- Disabled (will not power on automatically in an HA event)
The default setting is Medium in which all servers (if no Override is defined) will start up automatically in no specific order on an HA event or in a specific order if the VM Groups and VM Rules are defined.
In case you do not do any of this above configuration, but still have vSphere HA enabled, the VMs will reboot in case of a ESXi host going down.