If a Hyper-V server in a cluster fails, the failover is transparent for the users and is not noticeable. Maintenance tasks (keyword: cluster aware updating) is another scenario where you can take hosts offline without affecting the service availability.
High availability Hyper-V cluster
Basic configuration of a host cluster ^
First, you have to install Windows Server 2012 (R2), including all required device drivers and important updates on all physical servers. Don’t forget to name all computers at this point.
After that, you have to follow these configuration steps:
- Configure network adapters for LAN management. Name the adapters and, if possible, enable NIC teaming.
- Join the servers to the domain.
- Provision a central storage system, for example, in the form of iSCSI targets.
- Use a small 1GB LUN as a quorum, and later bigger units as Cluster Shared Volumes (CSVs). All hosts require access rights to the LUNs. Note: In contrast to a file share, the quorum disk stores the cluster database on a particular LUN.
- Configure the SAN with redundant NICs, switches for the iSCSI communication, and provisioning of Multipath (MPIO). Then, connect the iSCSI initiator to the target. Note: Jumbo frames improve network performance. You should remove unnecessary bindings on the iSCSI adapters (for instance, the Client for Microsoft Networks or NetBIOS over TCP/IP).
- Bring the LUNs online in the Disk Management tool of a server, initialized without drive letters and formatted with NTFS. Then, set the LUNs offline.
- Configure the network adapters for live migration, the VM traffic, and the cluster communication. Important: Ensure an identical configuration on all servers. If you want to unite adapters to teams, the NICs should at least support 1GBit or 10GBit; the adapter names should reflect their purpose.
- Install the Hyper-V role on the servers. The default storage locations for VHD and configuration files should not be changed at this point.
- Configure the virtual switches with the Hyper-V Manager or PowerShell. The vSwitches have to be connected to the NIC or the NIC team (for the VM traffic) and should have the same name on both hosts (pay attention to uppercase and lowercase!). This is important for failover/failback or for a live migration of the virtual machines. Make sure to disable the Allow management operating system to share this network adapter setting.
- Install the Failover Clustering feature in Server Manager on all servers and configure the failover cluster, including the networks within Failover Cluster Manager.
- Determine the adapter for the live migration through the adapter’s context menu in the networks pane.
- Verify and rename the LUNs and convert the large volumes into Cluster Shared Volumes. CSVs are required for the central storage of the virtual machines and the transparent failover/failback.
- Change the default storage location in Hyper-V Manager for the CSV (C:\ClusterStorage\Volume(x)).
Creating a high availability VM ^
At this point, you have created all required preconditions for the Hyper-V cluster. However, this doesn’t mean that all virtual machines will be automatically restarted on another server if the host fails. You still have to configure the corresponding VMs for high availability.
Creating a high availability VM
You can do this in Failover Cluster Manager where you have to right-click the roles and then navigate to Virtual computer -> New virtual computer. Before the wizard for creating the virtual machines starts, you have to decide which nodes to create for the machines. After that, the usual procedure for the configuration of a VM under Hyper-V follows.
In the future, you should use Failover Cluster Manager as the highest instance for the configuration of virtual computers.
Configuring high availability for existing VMs ^
If you want to configure high availability for existing VMs, you also have to open the context menu of the roles in Failover Cluster Manager and navigate to Configure roles, where you have to select Virtual computer. After that, you have to select the VMs that you want to configure for high availability.
Selecting VMs for high availability
The virtual disks and the configuration of the machines must be located on the CSV. If this is not the case, you have to transfer the data. You can do this by exporting and importing the data in Hyper-V Manager.