How to Set Up Windows Server 2016 Hyper-V Replica
Hyper-V Replica is a built-in disaster recovery feature in Windows Server 2016 that asynchronously replicates virtual machines from a primary Hyper-V host to a replica host. When the primary site goes offline due to hardware failure, natural disaster, or any unplanned outage, you can fail over to the replica and keep critical workloads running with minimal downtime. This tutorial walks through the complete process of enabling, configuring, and testing Hyper-V Replica on Windows Server 2016.
Prerequisites
Before you begin, ensure you have two Windows Server 2016 hosts with the Hyper-V role installed. Both hosts must be able to communicate over the network, and at least one virtual machine must exist on the primary host. If you are replicating across domains or workgroups, certificate-based authentication is recommended. For domain-joined hosts, Kerberos authentication is the simpler option.
You will also need appropriate firewall rules in place. Hyper-V Replica uses port 80 for HTTP (Kerberos) and port 443 for HTTPS (certificate-based). Make sure these ports are open between the two hosts, and that the Windows Firewall on both servers permits Hyper-V Replica traffic.
Step 1: Enable the Hyper-V Replica Broker (Failover Cluster)
If your Hyper-V hosts are part of a Windows Server Failover Cluster, you need to configure the Hyper-V Replica Broker role. In standalone environments, this step is not required and you can configure replication directly on the host. For clustered environments, open the Failover Cluster Manager and add the Hyper-V Replica Broker role as a cluster role.
Step 2: Configure the Replica Server
On the server that will act as the replica (secondary) host, open Hyper-V Manager. Right-click the host name and select Hyper-V Settings. In the left pane, click Replication Configuration. Check the box labelled Enable this computer as a Replica server.
Choose your authentication method. For Kerberos (HTTP), select Use Kerberos (HTTP). For certificate-based authentication, select Use certificate-based Authentication (HTTPS) and provide the appropriate certificate. Specify the port number (80 for HTTP, 443 for HTTPS).
Under Authorization and storage, choose whether to allow replication from any authenticated server or to specify authorised servers. For tighter control, select Allow replication from the specified servers and add the FQDN of your primary host. Set the default storage location for replica VM files on the replica host.
Set-VMReplicationServer -ReplicationEnabled $true -AllowedAuthenticationType Kerberos -ReplicationAllowedFromAnyServer $true -DefaultStorageLocation "D:HyperVReplica"
Step 3: Configure Firewall Rules on the Replica Server
Windows Firewall must permit incoming Hyper-V Replica traffic. Run the following commands on the replica host to enable the required rules:
Enable-NetFirewallRule -DisplayName "Hyper-V Replica HTTP Listener (TCP-In)"
Enable-NetFirewallRule -DisplayName "Hyper-V Replica HTTPS Listener (TCP-In)"
Step 4: Enable Replication for a Virtual Machine
On the primary host, open Hyper-V Manager. Right-click the virtual machine you want to replicate and select Enable Replication. The Enable Replication wizard opens. Click Next on the Before You Begin page.
On the Specify Replica Server page, type the FQDN or IP address of the replica server and click Next. On the Specify Connection Parameters page, choose the authentication type and port that match what you configured on the replica server. Click Next.
On the Choose Replication VHDs page, all virtual hard disks attached to the VM are selected by default. Deselect any disks that do not need to be replicated (such as temporary or scratch disks). Click Next.
On the Configure Replication Frequency page, choose how often replication occurs: 30 seconds, 5 minutes, or 15 minutes. For most workloads, 5 minutes strikes a good balance. Click Next.
On the Configure Additional Recovery Points page, you can choose to maintain only the latest recovery point or to keep additional hourly snapshots (up to 24 hours). Additional recovery points increase storage consumption but provide more granular recovery options. Click Next.
On the Choose Initial Replication Method page, select Send initial copy over the network for smaller VMs, or use external media for large VMs to avoid saturating the network link. Set a start time for the initial replication and click Finish.
Enable-VMReplication -VMName "WebServer01" -ReplicaServerName "replica-host.domain.local" -ReplicaServerPort 80 -AuthenticationType Kerberos -CompressionEnabled $true -RecoveryHistory 4 -ReplicationFrequencySec 300
Step 5: Monitor Replication Status
Once replication is enabled and the initial copy completes, you can monitor the replication health from Hyper-V Manager. In the Virtual Machines pane, select the VM and look at the Replication tab in the bottom panel. The replication state, health, and last synchronisation time are displayed here.
To check replication status via PowerShell, run:
Get-VMReplication -VMName "WebServer01" | Select-Object VMName, State, Health, LastReplicationTime, ReplicaServerName
Step 6: Perform a Test Failover
Testing the failover regularly is essential to confirm that the replica VM can boot and operate correctly. On the replica host, right-click the replica VM in Hyper-V Manager, point to Replication, and select Test Failover. Choose a recovery point and click Test Failover. Hyper-V creates a temporary test VM that runs independently of the replica. Verify the test VM boots and that services operate as expected, then right-click the VM, point to Replication, and select Stop Test Failover to clean up.
Start-VMFailover -VMName "WebServer01" -AsTest
Step 7: Perform a Planned Failover
A planned failover is used when you need to migrate the VM to the replica site with zero data loss, such as during scheduled maintenance. Shut down the VM on the primary host first, then right-click it, point to Replication, and select Planned Failover. Click Start Failover. The final replication delta is sent, and the VM starts on the replica host.
Start-VMFailover -VMName "WebServer01" -Prepare
Start-VMFailover -VMName "WebServer01"
Step 8: Reverse Replication After Failover
After a failover, you can reverse replication so the (formerly) replica host becomes the new primary and sends changes back to the original primary once it is restored. In Hyper-V Manager on the new primary, right-click the VM, point to Replication, and select Reverse Replication. Follow the wizard to re-establish replication in the opposite direction.
Set-VMReplication -Reverse -VMName "WebServer01"
Extended Replication
Windows Server 2016 also supports Extended Replication, which allows you to replicate from the replica host to a third host. This creates a three-site replication chain for additional redundancy. Configure the extended replica server in the same manner as the initial replica, then enable extended replication on the replica VM using the Hyper-V Manager wizard or PowerShell.
Troubleshooting Tips
If replication enters a critical or warning state, check the Hyper-V-VMMS event log on both the primary and replica hosts (Event Viewer > Applications and Services Logs > Microsoft > Windows > Hyper-V-VMMS). Common issues include network connectivity failures, authentication errors, insufficient storage on the replica, and time synchronisation problems. Ensure both hosts have their clocks synchronised with an NTP source, as Kerberos authentication is time-sensitive and will fail if clocks differ by more than five minutes.
Get-WinEvent -LogName "Microsoft-Windows-Hyper-V-VMMS-Admin" | Where-Object {$_.LevelDisplayName -eq "Error"} | Select-Object TimeCreated, Message -First 20
Hyper-V Replica is a powerful, cost-effective disaster recovery solution that requires no additional licensing. By following the steps above, you can protect your virtual machines against unplanned outages and confidently recover workloads with minimal data loss and downtime.