ANAVEM
Reference
Languagefr
How to Create a Hyper-V Cluster in Active Directory Domain with Windows Server 2025

How to Create a Hyper-V Cluster in Active Directory Domain with Windows Server 2025

Build a production-ready Hyper-V failover cluster using Windows Server 2025 with shared storage, Active Directory integration, and automated VM failover capabilities.

Emanuel DE ALMEIDAEmanuel DE ALMEIDA
3/16/2026 25 min 1
hardhyper-v 9 steps 25 min

Why Build a Hyper-V Cluster with Windows Server 2025?

Enterprise virtualization demands high availability, and Windows Server 2025 delivers significant improvements in Hyper-V clustering capabilities. The latest release includes enhanced Cluster Shared Volumes (CSV) support, improved scalability up to 64 nodes, and seamless integration with Active Directory for streamlined management.

A properly configured Hyper-V cluster eliminates single points of failure by automatically moving virtual machines between physical hosts when hardware issues occur. This ensures your critical workloads remain online even during planned maintenance or unexpected failures.

What Makes Windows Server 2025 Clustering Different?

Windows Server 2025 introduces several clustering enhancements over previous versions. The new User Management Manager role provides better integration with Active Directory, while improved SMB-based live migration delivers faster VM transfers between nodes. The platform now defaults to DNS-based access points for workgroup clusters and includes better support for hybrid cloud scenarios.

The clustering architecture in Server 2025 also provides enhanced security through improved Kerberos authentication and better integration with Windows Defender. These improvements make it easier to deploy secure, scalable virtualization infrastructure that meets enterprise compliance requirements.

What Will You Accomplish?

By following this tutorial, you'll build a production-ready Hyper-V cluster that can automatically failover virtual machines between physical servers. You'll configure shared storage using Cluster Shared Volumes, implement proper network segmentation for cluster traffic, and establish monitoring procedures to maintain cluster health. The result is a robust virtualization platform capable of supporting mission-critical workloads with minimal downtime.

Implementation Guide

Full Procedure

01

Prepare Active Directory Domain Environment

Before creating the cluster, you need to prepare your Active Directory environment. This involves creating a dedicated organizational unit and pre-staging the Cluster Name Object (CNO) to avoid permission issues during cluster creation.

First, create an OU for your cluster objects. Open Active Directory Users and Computers and create a new OU called "Hyper-V Clusters".

Next, pre-stage the CNO as a computer object in this OU:

New-ADComputer -Name "HV-CLUSTER01" -Path "OU=Hyper-V Clusters,DC=yourdomain,DC=com" -Enabled $false -Description "Hyper-V Cluster Name Object"

Grant your cluster nodes permission to act on behalf of the CNO:

$ClusterNodes = @("HV-NODE01", "HV-NODE02")
foreach ($Node in $ClusterNodes) {
    $NodeAccount = Get-ADComputer $Node
    $CNO = Get-ADComputer "HV-CLUSTER01"
    Set-ADComputer -Identity $CNO -PrincipalsAllowedToDelegateToAccount $NodeAccount
}
Warning: Skipping CNO pre-staging is the most common cause of cluster creation failures. Always create the CNO before running New-Cluster.

Verification: Run Get-ADComputer "HV-CLUSTER01" to confirm the CNO exists in your domain.

02

Install Hyper-V and Failover Clustering Features

Install the required Windows features on all cluster nodes. This step must be completed on each server that will participate in the cluster.

Run this command on each node to install Hyper-V and Failover Clustering:

Install-WindowsFeature -Name Hyper-V, Failover-Clustering -IncludeManagementTools -Restart

After the restart, configure the cluster service and Hyper-V settings:

Set-Service -Name ClusSvc -StartupType Automatic
Enable-VMMigration
Set-VMMigrationNetwork "192.168.2.0" -Priority 1
Set-VMHost -VirtualMachineMigrationPerformanceOption SMB
Set-VMHost -VirtualMachinePath "C:\ClusterStorage\Volume1\VMs"
Set-VMHost -VirtualHardDiskPath "C:\ClusterStorage\Volume1\VHDs"
Set-VMHost -EnableEnhancedSessionMode $true

These commands configure live migration to use SMB for better performance and set default paths for VMs and virtual hard disks on the cluster shared volume.

Pro tip: Use a dedicated network for live migration (192.168.2.0 in this example) to avoid impacting production traffic during VM moves.

Verification: Run Get-WindowsFeature -Name Hyper-V | Where-Object InstallState -eq "Installed" to confirm installation.

03

Configure Network Infrastructure

Proper network configuration is critical for cluster stability. You need separate networks for cluster heartbeat, management, and live migration traffic.

Configure network adapters on each node with static IP addresses:

# Management Network (Node 1)
New-NetIPAddress -InterfaceAlias "Management" -IPAddress "192.168.1.10" -PrefixLength 24 -DefaultGateway "192.168.1.1"
Set-DnsClientServerAddress -InterfaceAlias "Management" -ServerAddresses "192.168.1.5"

# Live Migration Network (Node 1)
New-NetIPAddress -InterfaceAlias "LiveMigration" -IPAddress "192.168.2.10" -PrefixLength 24

For Node 2, use .11 and .11 respectively. Repeat for additional nodes, incrementing the last octet.

Configure network adapter priorities to ensure proper traffic routing:

Set-NetIPInterface -InterfaceAlias "Management" -InterfaceMetric 10
Set-NetIPInterface -InterfaceAlias "LiveMigration" -InterfaceMetric 20

Disable NetBIOS on the live migration network to reduce broadcast traffic:

$adapter = Get-WmiObject -Class Win32_NetworkAdapterConfiguration | Where-Object {$_.Description -like "*LiveMigration*"}
$adapter.SetTcpipNetbios(2)  # 2 = Disable NetBIOS
Warning: Never use DHCP for cluster networks. Static IP addresses are mandatory for cluster stability.

Verification: Run Test-NetConnection -ComputerName "HV-NODE02" -Port 3343 to test cluster communication between nodes.

04

Validate Cluster Configuration

Before creating the cluster, run the cluster validation wizard to identify potential issues. This step helps prevent cluster creation failures and ensures your hardware configuration meets Microsoft's requirements.

Run the validation test from one of the cluster nodes:

Test-Cluster -Node "HV-NODE01","HV-NODE02" -Include "Inventory","Network","System Configuration"

If you haven't configured shared storage yet, skip storage tests to avoid false failures:

Test-Cluster -Node "HV-NODE01","HV-NODE02" -Ignore "Storage"

Review the validation report carefully. Address any errors before proceeding. Common warnings you can typically ignore include:

  • Missing shared storage (if not configured yet)
  • Network adapter teaming warnings (if using different hardware)
  • BIOS version differences (if functionality is equivalent)

For detailed validation results, check the report file:

$Report = Get-ChildItem "$env:TEMP\*Validation*.htm" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
Invoke-Item $Report.FullName
Pro tip: Save validation reports for documentation and troubleshooting. They contain detailed hardware and configuration information.

Verification: Ensure the validation report shows "Passed" or "Passed with warnings" status. Any "Failed" results must be resolved before cluster creation.

05

Create the Failover Cluster

With validation complete, create the failover cluster. This step establishes the cluster infrastructure and makes your nodes work together as a single highly available system.

Create the cluster without storage initially (we'll add storage in the next step):

New-Cluster -Name "HV-CLUSTER01" -Node @("HV-NODE01","HV-NODE02") -StaticAddress "192.168.1.100" -NoStorage

Configure cluster networks with appropriate roles:

# Set management network role
Get-ClusterNetwork | Where-Object {$_.Address -like "192.168.1.*"} | Set-ClusterNetwork -Name "Management" -Role ClusterAndClient

# Set live migration network role
Get-ClusterNetwork | Where-Object {$_.Address -like "192.168.2.*"} | Set-ClusterNetwork -Name "LiveMigration" -Role ClusterOnly

Configure cluster properties for optimal Hyper-V operation:

# Set cluster heartbeat settings
(Get-Cluster).SameSubnetDelay = 1000
(Get-Cluster).SameSubnetThreshold = 10
(Get-Cluster).CrossSubnetDelay = 1000
(Get-Cluster).CrossSubnetThreshold = 10

# Enable cluster shared volumes
Enable-ClusterS2D -Confirm:$false
Warning: The cluster IP address (192.168.1.100) must be in the same subnet as your management network and not conflict with existing IPs.

Verification: Run Get-Cluster and Get-ClusterNode to confirm the cluster is online and all nodes are active members.

06

Configure Shared Storage and Cluster Shared Volumes

Shared storage is essential for VM high availability. Configure your iSCSI, SAN, or SMB storage to be accessible from all cluster nodes, then add it to the cluster.

If using iSCSI storage, configure the initiator on each node:

# Configure iSCSI initiator (run on each node)
Set-Service -Name MSiSCSI -StartupType Automatic
Start-Service MSiSCSI
New-IscsiTargetPortal -TargetPortalAddress "192.168.3.100"
Connect-IscsiTarget -NodeAddress "iqn.2024-01.com.company:storage.target1"

Add available shared disks to the cluster:

# Discover and add shared storage
$SharedDisks = Get-ClusterAvailableDisk
$SharedDisks | Add-ClusterDisk

# Convert to Cluster Shared Volumes
$ClusterDisks = Get-ClusterResource | Where-Object ResourceType -eq "Physical Disk"
$ClusterDisks | Add-ClusterSharedVolume

Format the CSV volumes if they're new disks:

# Format CSV volumes (only for new disks)
Get-ClusterSharedVolume | ForEach-Object {
    $CSVPath = $_.SharedVolumeInfo.FriendlyVolumeName
    if ((Get-Volume -Path $CSVPath).FileSystem -eq "Unknown") {
        Format-Volume -Path $CSVPath -FileSystem NTFS -AllocationUnitSize 65536 -NewFileSystemLabel "CSV$($_.Id)"
    }
}

Create directory structure for VMs:

New-Item -Path "C:\ClusterStorage\Volume1\VMs" -ItemType Directory -Force
New-Item -Path "C:\ClusterStorage\Volume1\VHDs" -ItemType Directory -Force
Pro tip: Use 64KB allocation unit size for NTFS on CSV volumes to optimize performance for large VM files.

Verification: Run Get-ClusterSharedVolume to confirm CSV volumes are online and accessible from all nodes.

07

Configure Cluster Quorum

Quorum configuration determines how the cluster maintains consensus when nodes fail. For a two-node cluster, you need a witness to prevent split-brain scenarios.

For clusters with shared storage, configure a disk witness:

# Create a small disk for quorum (1GB minimum)
$QuorumDisk = Get-ClusterAvailableDisk | Where-Object {$_.Size -lt 5GB} | Select-Object -First 1
if ($QuorumDisk) {
    $QuorumDisk | Add-ClusterDisk
    Set-ClusterQuorum -DiskWitness $QuorumDisk.Name
}

Alternatively, configure a file share witness if you have a separate file server:

# Configure file share witness
Set-ClusterQuorum -FileShareWitness "\\fileserver.domain.com\ClusterWitness\HV-CLUSTER01"

For cloud deployments, you can use a cloud witness (Azure storage account):

# Configure cloud witness (requires Azure storage account)
Set-ClusterQuorum -CloudWitness -AccountName "yourstorageaccount" -AccessKey "your-access-key"

Verify quorum configuration and test failover scenarios:

# Check quorum status
Get-ClusterQuorum

# Test quorum by simulating node failure
Stop-ClusterNode -Name "HV-NODE02" -Force
Get-ClusterNode  # Should show NODE01 as Up, NODE02 as Down
Start-ClusterNode -Name "HV-NODE02"
Warning: Never run a two-node cluster without a witness. This will cause the cluster to go offline when one node fails.

Verification: Run Get-ClusterQuorum to confirm your witness is configured and online.

08

Create and Test Highly Available Virtual Machines

Now create virtual machines that can automatically failover between cluster nodes. This is the primary benefit of your Hyper-V cluster setup.

Create a new VM on the cluster shared volume:

# Create a new VM
$VMName = "TestVM01"
New-VM -Name $VMName -MemoryStartupBytes 2GB -Path "C:\ClusterStorage\Volume1\VMs" -NewVHDPath "C:\ClusterStorage\Volume1\VHDs\$VMName.vhdx" -NewVHDSizeBytes 40GB

# Configure VM settings
Set-VM -Name $VMName -ProcessorCount 2 -DynamicMemory -MemoryMinimumBytes 1GB -MemoryMaximumBytes 4GB
Add-VMNetworkAdapter -VMName $VMName -SwitchName "External"

# Make the VM highly available
Add-ClusterVirtualMachineRole -VMName $VMName

Test live migration between nodes:

# Start the VM
Start-VM -Name $VMName

# Check current owner
Get-ClusterGroup -Name $VMName | Select-Object Name, OwnerNode

# Perform live migration
Move-ClusterVirtualMachineRole -Name $VMName -Node "HV-NODE02"

# Verify migration completed
Get-ClusterGroup -Name $VMName | Select-Object Name, OwnerNode

Test failover scenarios by simulating node failures:

# Test automatic failover
$CurrentOwner = (Get-ClusterGroup -Name $VMName).OwnerNode
Stop-ClusterNode -Name $CurrentOwner -Force

# Wait for failover (should be automatic)
Start-Sleep -Seconds 30
Get-ClusterGroup -Name $VMName | Select-Object Name, OwnerNode, State

# Restart the failed node
Start-ClusterNode -Name $CurrentOwner

Configure VM monitoring for automatic restart on failure:

# Enable VM monitoring
Add-ClusterVMMonitoredItem -VirtualMachine $VMName -Service "Spooler"
Get-ClusterVMMonitoredItem -VirtualMachine $VMName
Pro tip: Always store VM files on CSV volumes, never on local storage. This ensures VMs can run on any cluster node.

Verification: Run Get-ClusterGroup | Where-Object GroupType -eq "VirtualMachine" to see all clustered VMs and their current status.

09

Configure Cluster Monitoring and Maintenance

Set up monitoring and maintenance procedures to ensure your cluster remains healthy and performs optimally over time.

Configure cluster logging for troubleshooting:

# Enable cluster logging
Get-ClusterLog -Destination "C:\ClusterLogs" -TimeSpan 60

# Configure automatic log collection
Set-ClusterParameter -Name ClusterLogLevel -Value 3
Set-ClusterParameter -Name ClusterLogSize -Value 1024

Set up performance monitoring:

# Create performance counter data collector
$DataCollectorSet = "Hyper-V Cluster Performance"
logman create counter $DataCollectorSet -f bincirc -max 500 -c "\Hyper-V Hypervisor\*" "\Cluster CSV File System\*" "\Process(vmms)\*" -si 00:01:00

Configure cluster-aware updating for automated patching:

# Install Cluster-Aware Updating feature
Install-WindowsFeature -Name RSAT-Clustering-CmdInterface, RSAT-Clustering-PowerShell

# Configure CAU self-updating mode
Add-CauClusterRole -ClusterName "HV-CLUSTER01" -MaxFailedNodes 0 -RequireAllNodesOnline

# Set update schedule (first Tuesday of each month at 3 AM)
Set-CauClusterRole -ClusterName "HV-CLUSTER01" -StartDate "2026-04-01 03:00:00" -DaysOfWeek Tuesday -WeeksOfMonth First

Create maintenance scripts for regular health checks:

# Cluster health check script
function Test-ClusterHealth {
    $Results = @{}
    $Results.ClusterStatus = (Get-Cluster).State
    $Results.NodeStatus = Get-ClusterNode | Select-Object Name, State
    $Results.ResourceStatus = Get-ClusterResource | Where-Object State -ne "Online" | Select-Object Name, State, OwnerNode
    $Results.CSVStatus = Get-ClusterSharedVolume | Select-Object Name, State
    $Results.QuorumStatus = Get-ClusterQuorum
    return $Results
}

# Run health check
$Health = Test-ClusterHealth
$Health | ConvertTo-Json -Depth 3
Warning: Always test cluster updates in a non-production environment first. CAU can cause extended downtime if not properly configured.

Verification: Run Get-ClusterResource | Where-Object State -ne "Online" to identify any failed cluster resources that need attention.

Frequently Asked Questions

What are the minimum hardware requirements for a Windows Server 2025 Hyper-V cluster?+
You need at least two physical servers with matching hardware specifications: minimum 8GB RAM per node, dual network adapters (one for cluster heartbeat/management, one for VM live migration), and CPUs supporting hardware virtualization with SLAT (Second Level Address Translation). Each server requires Windows Server 2025 Standard or Datacenter edition and access to shared storage via iSCSI, SAN, or SMB 3.0.
How do I troubleshoot cluster validation failures in Windows Server 2025?+
Start by running Test-Cluster with specific test categories to isolate issues. Common failures include network configuration problems (check static IP assignments and DNS resolution), storage connectivity issues (verify all nodes can access shared disks), and Active Directory permission problems (ensure CNO is pre-staged with proper permissions). Review the detailed HTML validation report generated in %TEMP% for specific error codes and recommended fixes.
What's the difference between live migration networks and cluster heartbeat networks?+
Cluster heartbeat networks carry critical cluster communication and health monitoring traffic between nodes, requiring low latency and high reliability. Live migration networks handle VM memory and state transfers during planned moves between nodes, requiring high bandwidth but can tolerate higher latency. Best practice is to use separate physical networks: heartbeat on the management network (192.168.1.0/24) and live migration on a dedicated high-speed network (192.168.2.0/24 or 10GbE).
Why do I need a quorum witness in a two-node Hyper-V cluster?+
A quorum witness prevents split-brain scenarios where both nodes think they should run the cluster when network communication fails between them. Without a witness, a two-node cluster will shut down when one node fails, even though the remaining node is healthy. The witness provides the deciding vote to determine which node(s) should continue running cluster services. You can use a disk witness (shared storage), file share witness (separate server), or cloud witness (Azure storage).
How does Cluster Shared Volumes (CSV) improve Hyper-V performance?+
CSV allows multiple cluster nodes to simultaneously access the same shared storage volume, eliminating the need to transfer disk ownership during VM operations. This enables faster live migration, backup operations, and VM management tasks. CSV also provides direct I/O access from any node to the storage, reducing network overhead and improving performance. In Windows Server 2025, CSV includes enhanced caching and better integration with Storage Spaces Direct for improved scalability.
Emanuel DE ALMEIDA
Written by

Emanuel DE ALMEIDA

Microsoft MCSA-certified Cloud Architect | Fortinet-focused. I modernize cloud, hybrid & on-prem infrastructure for reliability, security, performance and cost control - sharing field-tested ops & troubleshooting.

Discussion

Share your thoughts and insights

You must be logged in to comment.

Loading comments...