Applies to: Windows Server 2019, Windows Server 2022 and Windows Server 2025, subject to the workload and edition requirements below.
Use Replica for recovery, with a defined recovery objective
Hyper-V Replica asynchronously copies supported VM disk changes from a primary host to a replica host. It can provide a recovery copy when the primary location becomes unavailable, but it is not synchronous storage mirroring, automatic application failover or a substitute for independent backup. A replica can contain the same unwanted deletion or corruption as the primary, and a recovery point can lag behind the last acknowledged business transaction.
This guide connects two standalone hosts, HV01 and HV02, using certificate-authenticated HTTPS and an explicit authorization for HV01. Clustered hosts need the Hyper-V Replica Broker and cluster-specific setup rather than a direct substitution of a node name. Decide the recovery-point objective, recovery-time objective, application-consistency requirements and failback process before enabling a VM. A healthy replication status does not prove the replica application will be usable after a disaster.
Prepare host versions, capacity and certificates
Confirm supported Hyper-V host and VM configuration compatibility across the source and recovery environment. A newer VM configuration is not necessarily runnable on an older recovery host. Verify guest disks and attachments are eligible for replication, identify any deliberately excluded data, and ensure the recovery host can supply enough CPU, RAM, network and storage for the intended failover set.
For HTTPS, install suitable certificates in each host’s local-computer personal store with accessible private keys, the required authentication purposes and names matching the host identities. Both sides must trust the issuing chain and be able to perform required revocation checks. Plan certificate renewal before expiry; replication is a long-lived dependency, not a one-time handshake. Do not disable revocation checking merely to make an invalid certificate work.
Reserve storage for initial copies, change logs and selected recovery points. Measure the VM’s write rate and the available intersite bandwidth. Initial synchronization may be large even when steady-state change traffic is modest. Limit inbound TCP 443 to approved replication sources where network controls allow it, and keep this listener distinct from unrelated HTTPS applications on the host.
Enable a restricted HTTPS listener on the replica host
On HV02, open elevated PowerShell and inspect existing replication settings before modifying them. Select the exact approved certificate thumbprint from the local store, checking name, expiry and private-key presence. The placeholders below represent values you must obtain from your own PKI; they are not working certificates.
# On HV02:
Get-VMReplicationServer
Get-ChildItem Cert:\LocalMachine\My | Select-Object Subject,Thumbprint,NotAfter,HasPrivateKey
$replicaThumbprint = 'REPLACE_WITH_HV02_CERTIFICATE_THUMBPRINT'
New-Item -ItemType Directory -Path 'D:\ReplicaVMs' -Force | Out-Null
Set-VMReplicationServer -ReplicationEnabled $true `
-AllowedAuthenticationType Certificate -CertificateThumbprint $replicaThumbprint `
-CertificateAuthenticationPort 443 -ReplicationAllowedFromAnyServer $false
New-VMReplicationAuthorizationEntry -AllowedPrimaryServer 'hv01.corp.example' `
-ReplicaStorageLocation 'D:\ReplicaVMs' -TrustGroup 'PrimarySite'The authorization entry requires acceptance from any server to be disabled. Use the exact primary FQDN instead of a broad wildcard unless the trust design explicitly needs one. Confirm storage ACLs and space; do not grant a general user group write access to the replica directory to resolve a service permission issue.
Permit the listener and test authentication before copying data
Enable the built-in Hyper-V Replica HTTPS listener firewall rule on the receiving host and scope it to the intended source network through the approved firewall policy. Rule display names vary with the operating-system language, so inspect the actual rule rather than assuming an English display string always matches.
# Inspect the built-in listener rule on HV02:
Get-NetFirewallRule | Where-Object DisplayName -Like '*Replica*HTTPS*' |
Select-Object Name,DisplayName,Enabled,Direction,Action
# On HV01, select its own approved local certificate:
$primaryThumbprint = 'REPLACE_WITH_HV01_CERTIFICATE_THUMBPRINT'
Test-VMReplicationConnection -ReplicaServerName 'hv02.corp.example' `
-ReplicaServerPort 443 -AuthenticationType Certificate `
-CertificateThumbprint $primaryThumbprintThe test should report a successful connection with the selected parameters. A raw TCP 443 success is weaker evidence because it does not validate the Hyper-V certificate and authorization path. Resolve certificate, DNS, revocation, listener and firewall failures before enabling the VM; repeatedly retrying initial replication will not fix a failed authentication test.
Enable one VM and start initial replication
Choose a supported pilot VM and inspect all of its disks before enabling replication. The following requests five-minute replication intervals and two additional hourly recovery points. Those values are illustrative and need to fit the required recovery objective and available space. They do not make every point application-consistent or eliminate possible data loss.
Get-VMHardDiskDrive -VMName 'APP01'
Enable-VMReplication -VMName 'APP01' -ReplicaServerName 'hv02.corp.example' `
-ReplicaServerPort 443 -AuthenticationType Certificate `
-CertificateThumbprint $primaryThumbprint `
-ReplicationFrequencySec 300 -RecoveryHistory 2
Start-VMInitialReplication -VMName 'APP01'
Get-VMReplication -VMName 'APP01'Initial replication can be scheduled or seeded through a supported alternate method when network transfer is impractical. Keep the replica VM off during ordinary operation. Do not start it as a second production copy; duplicate IPs, computer identities or application writers can create a split-brain incident. Configure its failover network and any test network deliberately.
Verify health and perform an isolated test failover
Monitor initial synchronization until it completes and the relationship reaches the expected replicating state with normal health. Review latest replication times, errors and statistics from both hosts. Compare lag against the agreed objective rather than treating Normal as a complete business acceptance test.
Get-VMReplication -VMName 'APP01' | Format-List *
Measure-VMReplication -VMName 'APP01'
# Inspect relevant Hyper-V VMMS events on both hosts:
Get-WinEvent -LogName 'Microsoft-Windows-Hyper-V-VMMS/Admin' -MaxEvents 40Use Hyper-V’s Test Failover workflow on HV02 with an isolated test network. Validate guest boot, required data, application startup and dependencies without exposing duplicate production identities. Test Failover creates a temporary test instance while normal replication can continue; remove the test instance through the supported stop-test workflow when finished. Record what was actually checked. A replication connection test and an isolated application recovery test answer different questions.
Distinguish planned failover from emergency recovery
A planned failover coordinates a clean transition while the primary is available and can transmit the remaining changes. An unplanned failover chooses an available recovery point after the primary is unavailable and may lose recent work. In both cases, fence or otherwise confirm the old primary cannot continue serving the same workload before bringing the recovery copy into production.
Prepare DNS, IP addressing, firewall, load-balancer and external-service changes separately. Some applications need additional recovery or consistency steps after the VM boots. Define who authorizes the selected recovery point and how the application owner accepts it. Reverse replication and failback are controlled follow-on operations; do not simply turn both copies on and expect Hyper-V to reconcile independent writes.
Diagnose lag and remove replication safely
For authentication failures, inspect certificate validity, names, trust, private-key access, revocation reachability and the allowed-primary entry. For growing lag, compare write rate with available bandwidth and check network loss, target capacity, host CPU and disk latency. Preserve events before resuming or resynchronizing a failed relationship. A resynchronization can involve substantial storage and network work and should follow the actual error condition.
If replication must be removed, preserve an independent backup and identify which VM is the authorized production copy. Remove only the intended relationship and retain replica files until their retention and recovery purpose is settled. Disabling the receiving listener can affect every VM using that host, so it is not a per-VM rollback. Document certificates, storage, recovery-point policy, network mappings and test results, and repeat recovery exercises after material application or infrastructure changes.
Related guidance and official references
Prepare the Hyper-V host; Understand production checkpoints; Back up an AD CS certification authority.