This can be achieved with the use of vSphere cluster. While a single ESXi server can provide all of these functions (by, Editing Virtual Machine Startup and Shutdown Settings ), the option of vSphere High Availability becomes available if the storage is isolated from the single server itself. This storage could be a centrally available appliance such as a SAN (Storage Area Network) or a NAS (Network Attached Storage). In this type infrastructure, an entire physical server can fail, and users would only experience a few minutes of an outage versus days or weeks of an outage while the server that failed was repaired or replaced.
With vSphere-HA enabled, by default all VMs will automatically Power-On back to the remaining ESXi hosts in the cluster if the host server they were previously running on were to fail. The event causing the outage of the server is called an HA Event. HA Events triggers a failover on remaining hosts in a cluster to Power-On the VMs on other hosts.
Here, if we want the VMs to power back ON in a specific order. Most likely helpful in situations if you encounter a power outage, that caused all ESXi hosts and virtual machines to shut down, and nothing is powered on.
To configure this we need to enable vSphere-ha and use the VM/Host Groups & VM/Host Rules as below :
- Select Cluster > Go to Configure > Select vSphere Availability > Edit vSphere-HA > Enable vSphere-HA
- Inside vSphere-ha edit settings, Expand the "Failures and responses" tab > Select VM dependency restart condition > Set it to "Guest Heartbeats detected" (Note : VMs must have VM tools installed before using this feature).
- Create multiple groups of VMs that we want to be Powered-ON together or separately.
- Select Cluster > Go to Configure > Select VM/Host Groups > Click on ADD >
- Then provide a Name of the group (Note : The VM group name is non-editable)
- Select the Type as VM Group.
- Then select the ADD button to add the VMs. > Select OK
- Create the VM/Host Rule that will allow one group of VMs to be Powered-On before another group
- Select Cluster > Go to Configure > Select VM/Host Rules > Click on ADD >
- Then provide a Name of the group and Check mark the Enable rule option.
- Select the Type as Virtual Machines to Virtual machine.
- Then on section "On restart for VM group", select the VM Group (For example : Group-1 )that will be Powered-On first.
- Then on section "The VM dependency restart condition must be met before continuing to:", select the the VM Group (For example : Group-2) that will be Powered-On only after the condition of Group-1 is met i.e. "Guest Heartbeats detected" . (Note : We defined this option on step 1.1 )
- Continue to create multiple VM/Host rule to be triggered in an order once the respective groups "VM dependency restart condition" is met for all VM groups.