How to Set Up a Hyper-V Cluster on Windows Server 2012 R2

A Hyper-V cluster combines multiple physical Hyper-V hosts into a single high-availability platform. When a host fails, the Failover Cluster service detects the failure and automatically restarts the affected virtual machines on surviving nodes — a process called failover. Windows Server 2012 R2 Hyper-V clustering supports up to 64 nodes per cluster and 8,000 VMs per cluster. This guide covers the prerequisites, Failover Clustering installation, cluster creation, shared storage configuration, and VM deployment on a cluster.

Prerequisites

  • Two or more Windows Server 2012 R2 servers with the Hyper-V role installed
  • All nodes joined to the same Active Directory domain
  • Identical or compatible hardware across all nodes (CPU family must be compatible for Live Migration)
  • Shared storage accessible by all nodes: iSCSI, Fibre Channel SAN, or SMB 3.0 file share (Scale-Out File Server)
  • Multiple network interfaces per node: one for management, one for cluster heartbeat, one for VM traffic, one for Live Migration (best practice)
  • Static IP addresses on all cluster network interfaces

Step 1 — Install the Failover Clustering Feature

Install the Failover Clustering feature on all nodes that will join the cluster. Run on each node:

Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools -Restart

To install on multiple remote nodes simultaneously:

$Nodes = "HV-Node01", "HV-Node02", "HV-Node03"
Invoke-Command -ComputerName $Nodes -ScriptBlock { Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools -Restart }

Step 2 — Run the Cluster Validation Wizard

Before creating a cluster, always run the validation wizard to identify any hardware or configuration issues. The validation tests must pass (or produce only warnings, not failures) before Microsoft will support the cluster:

Test-Cluster -Node "HV-Node01", "HV-Node02" -Include "Storage", "Inventory", "Network", "System Configuration", "Hyper-V Configuration"

Review the HTML report generated in C:WindowsClusterReports. Address any failures before proceeding. Common issues include: unsupported storage drivers, inconsistent network adapter configurations, or time synchronisation problems between nodes.

Step 3 — Create the Failover Cluster

Create the cluster with a cluster name and IP address. The cluster name and IP are registered in DNS and Active Directory:

New-Cluster -Name "HV-Cluster01" -Node "HV-Node01", "HV-Node02" -StaticAddress "192.168.1.100" -NoStorage

The -NoStorage parameter prevents the wizard from automatically claiming all available disks as cluster storage — you will add storage manually in the next steps. Verify the cluster was created:

Get-Cluster -Name "HV-Cluster01"
Get-ClusterNode -Cluster "HV-Cluster01"

Step 4 — Configure the Cluster Quorum

The quorum determines how many nodes must be online for the cluster to continue operating. For a two-node cluster, a disk witness or file share witness is required to break ties:

# Configure a file share witness (recommended when you don't want to dedicate a disk):
Set-ClusterQuorum -Cluster "HV-Cluster01" -FileShareWitness "\fileserverHVCluster01-Witness"

# Or configure a disk witness if a small shared disk is available:
Set-ClusterQuorum -Cluster "HV-Cluster01" -DiskWitness "Cluster Disk 1"

To check current quorum configuration:

Get-ClusterQuorum -Cluster "HV-Cluster01"

Step 5 — Add and Configure Cluster Shared Volumes

Cluster Shared Volumes (CSV) allow multiple cluster nodes to simultaneously access the same NTFS volume, which is required for Live Migration and VM hosting. First, present shared LUNs to all nodes (via iSCSI or FC), then add them to the cluster:

# Add a disk to the cluster:
Add-ClusterDisk -InputObject (Get-Disk | Where-Object { $_.OperationalStatus -eq "Offline" })

# Convert a cluster disk to a CSV:
Add-ClusterSharedVolume -Name "Cluster Disk 2"

List all CSVs:

Get-ClusterSharedVolume -Cluster "HV-Cluster01"

CSVs are mounted under C:ClusterStorageVolume1, Volume2, etc. All nodes see the same path, which is critical for VM portability.

Step 6 — Configure Cluster Networks

Separate cluster traffic types onto dedicated networks for performance and isolation. Configure which networks are used for what purpose:

# View all cluster networks:
Get-ClusterNetwork -Cluster "HV-Cluster01"

# Set the Cluster/Heartbeat network:
(Get-ClusterNetwork -Cluster "HV-Cluster01" -Name "Cluster Network 1").Role = 1

# Set a network to not be used for cluster communication (VM traffic only):
(Get-ClusterNetwork -Cluster "HV-Cluster01" -Name "VM Network").Role = 0

# Configure Live Migration to use a specific network:
Get-ClusterResourceType -Cluster "HV-Cluster01" -Name "Virtual Machine" | Set-ClusterParameter -Name MigrationNetworkOrder -Value "192.168.10.0/24"

Step 7 — Create a Clustered VM

Create a VM on the CSV so it can be live-migrated between nodes:

New-VM -Name "ClusteredVM01" -Generation 2 -MemoryStartupBytes 4GB -SwitchName "VMSwitch" -NewVHDPath "C:ClusterStorageVolume1ClusteredVM01ClusteredVM01.vhdx" -NewVHDSizeBytes 60GB -Path "C:ClusterStorageVolume1ClusteredVM01"

Add the VM to the cluster as a clustered role (highly available VM):

Add-ClusterVirtualMachineRole -VMName "ClusteredVM01" -Cluster "HV-Cluster01"

Verify the VM is registered as a clustered resource:

Get-ClusterGroup -Cluster "HV-Cluster01" | Where-Object { $_.GroupType -eq "VirtualMachine" }

Step 8 — Configure Preferred Owners and Failover Policy

Configure which node a VM prefers to run on and where it should fail over:

# Set preferred owner:
Set-ClusterOwnerNode -Group "ClusteredVM01" -Owners "HV-Node01", "HV-Node02"

# Configure failover settings (maximum failures in specified period):
(Get-ClusterGroup -Name "ClusteredVM01").FailoverThreshold = 3
(Get-ClusterGroup -Name "ClusteredVM01").FailoverPeriod = 6

Step 9 — Test Cluster Failover

Test that a VM fails over correctly by simulating a node failure:

# Move VM to the other node (graceful live migration):
Move-ClusterVirtualMachineRole -Name "ClusteredVM01" -Node "HV-Node02" -MigrationType Live

# Verify current owner:
Get-ClusterGroup -Name "ClusteredVM01" | Select-Object Name, OwnerNode, State

Verifying Cluster Health

Get-ClusterNode -Cluster "HV-Cluster01" | Select-Object Name, State
Get-ClusterGroup -Cluster "HV-Cluster01" | Select-Object Name, State, OwnerNode | Format-Table -AutoSize
Get-ClusterSharedVolumeState -Cluster "HV-Cluster01"

Summary

Setting up a Hyper-V cluster on Windows Server 2012 R2 involves installing Failover Clustering, running validation, creating the cluster with proper quorum, configuring Cluster Shared Volumes, and registering VMs as highly available clustered roles. The result is a platform where VM workloads automatically restart on surviving nodes during unplanned outages, and can be live-migrated between nodes with zero downtime for planned maintenance. Proper network segmentation and quorum configuration are essential for cluster stability and supported operation.