Although Hyper-V VMs can be made highly available, the ability of a VM to fail over from one host server to another...
depends on the availability of hardware resources. After all, every VM requires storage, CPU, memory and other resources. If the destination host lacks the required resources, then the VM will be unable to start.
Microsoft helps administrators to solve this problem by establishing VM failover priority levels. In essence, an administrator can tell Hyper-V which VMs are the most important so that they take precedence in a failover situation and, therefore, have the best chance of receiving the resources that they need.
Prioritize VMs with SCVMM
Microsoft makes it easy to prioritize VMs through System Center Virtual Machine Manager 2012 R2 (SCVMM). Simply go to the SCVMM Administrator's VMs and Services workspace, right click on a VM and choose the Properties command from the shortcut menu. When the VM's properties sheet appears, select the Hardware Configuration tab and then select the Availability container. This container contains settings that allow you to set VM failover priority to High, Medium, Low or Do not restart automatically. You can see what this looks like in Figure A.
Although it takes very little effort to prioritize a VM, it is important for an administrator to understand what is going on behind the scenes and how the priority settings will impact VM behavior.
The simple way of thinking of VM failover priority is that higher priority VMs are migrated to the destination host before lower priority VMs. That way, if the destination host begins to run low on hardware resources, the most important VMs will hopefully have already been migrated. Although this concept seems simple enough, there is an equally important concept that must be understood -- pre-emption.
Plan accordingly when using pre-emption
Pre-emption is designed to ensure that mission-critical workloads continue to run even during a failover. However, pre-emption can actually cause service disruptions, so it is extremely important to plan accordingly.
To show you how pre-emption works, suppose that a cluster node is brought offline and that the node in question contains a high-priority VM that needs to remain online. The Windows Server Failover Clustering (WSFC) service will check the cluster's other nodes to see if adequate capacity is available. For the sake of this example, let's assume that none of the remaining cluster nodes have enough available memory to accommodate the high-priority VM. In this type of situation, the pre-emption feature will kick in and the WSFC service will begin taking lower priority VMs offline -- putting them into a saved state -- in order to free up resources for the higher priority VM. The WSFC service will initially shut down the lowest priority VMs, but will then begin shutting down higher priority VMs if necessary.
On the surface, VM pre-emption probably sounds like a good thing because it works to keep the highest priority VM online. It is worth noting, however, that pre-emption can cause problems if VMs are not properly prioritized.
The impact of VM prioritization
Most administrators probably assign a high priority to their most important VM and a medium priority to VMs that are slightly less important. This is the way that Microsoft intends for prioritization to be used. However, some organizations use prioritization as a mechanism for controlling the failover of multi-tier applications. For instance, such an organization might configure a database server with a high priority and the application server that depends on the database server with a medium priority. In theory, this means that the database server will fail over first and will be ready for use by the application server. If inadequate resources are available for either the database or application server, however, then this approach can cause a service outage.
Prioritization also determines how VMs are migrated from one node to another. High- and medium-priority VMs are live migrated from the source host to the destination host, but low-priority VMs are moved via Quick Migration. Quick Migration is similar to Hyper-V Live Migration, except that VMs are placed in a saved state prior to being migrated. This means that the VM will be offline during the migration process, resulting in a short service disruption.
Windows Server 2016 rolling upgrades prevent downtime
Microsoft makes upgrading a failover cluster easy
How to build a free Hyper-V failover cluster