Use this when automating Hyper-V Replica.
Replication
Hyper-V replication automation configures Hyper-V Replica with Enable-VMReplication, Start-VMInitialReplication and Start-VMFailover, replicating VMs to a second host or site.
1. Replica automation: enable, initial replication, monitor health, test failover.
2. Broker in clusters.
3. Monitor lag.
4. Automate test failovers.
5. Report.
enable → initial sync → ongoing replication → test failover
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as name collisions, cluster ownership changes, path/capacity mismatch, checkpoints/locks, asynchronous completion, replication lag and host success without guest/application success, choosing the cases most relevant to source/target relationship, replication health/lag, resync/failover state and proving protected workload can use the replica rather than only seeing a healthy relationship.
Step 2 Common mistakes Narrow the fault
- Never running a test failover.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Replica server must allow incoming replication.
- Initial replication can be large.
- Test failover regularly.
Enable-VMReplication -VMName <vm> -ReplicaServerName <r> -ReplicaServerPort 80 -AuthenticationType Kerberos— enableStart-VMInitialReplication -VMName <vm>— initial syncGet-VMReplication | ft VMName,State,Health— status
ReferenceWhy it matters1 section · depth on demand
What it is
Hyper-V Replica copies VM changes to another host asynchronously for disaster recovery.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Hyper-V Replica asynchronously copies VM changes to another host or site, giving a recoverable copy for disasters. Replication frequency can be 30 seconds, 5 minutes or 15 minutes, with optional additional recovery points.
Enable-VMReplication -VMName app01 -ReplicaServerName hv-dr01 -ReplicaServerPort 80 `
-AuthenticationType Kerberos -ReplicationFrequencySec 300
Start-VMInitialReplication -VMName app01
Get-VMReplication | Select-Object Name, State, Health, LastReplicationTime
Start-VMFailover -VMName app01 -AsTest # test failover without disruption
Automate regular test failovers and health reporting; replication that has silently been in a warning state for weeks is a common surprise during a real disaster.
Example
Enable-VMReplication web01 hv-dr01 80 Kerberos
Get-VMReplication
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hyper-V Automation > Replication. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/module/hyper-v/?view=windowsserver2025-ps · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For source/target relationship, replication health/lag, resync/failover state and proving protected workload can use the replica rather than only seeing a healthy relationship, prefer typed fields and stable IDs over human presentation text.