Setting Hyper-V Replica

Posted: December 24, 2016 in Windows Server

Hyper-V replica feaytures replicates virtual machines from one Hyper-V host server to another. Hyper-V Replica creates a copy of a live virtual machine to a replica offline virtual machine.It’s part of failover strategy.For example,if we have 2 datacenters,we can replicate VM from one data center to another.Replicated VM is in offline state,so in case of disaster recovery VM can be powered on to continue services.This an be used in clustered and non-clustered configuration.

In this example we’ll replicate VM from HyperV-02 to HyperV-01 Hyper-V host:

Enabling replication

First,on HyperV-01 host enable replication from HyperV-02:

On HyperV-01 go to Hyper-V settings


Set Kerberos authentication



Set-VMReplicationServer -ComputerName hyperv-01 -ReplicationEnabled $true -AllowedAuthenticationType Kerberos -ReplicationAllowedFromAnyServer $false

Because we want to allow replication only from specific server we need to add ReplicationAutorization Entry (trust group is random chosen)

New-VMReplicationAuthorizationEntry -AllowedPrimaryServer -ReplicaStorageLocation  c:\vm -TrustGroup test_group

Setting firewall:

Rule for Hyper-V replication is turned off by default,we need to enable it:


Get-NetFirewallRule -displayName ‘Hyper-V Replica HTTP Listener (TCP-In)’ | Enable-NetFirewallRule

On HyperV-02 host (where VM is located)


Set-VMReplicationServer -ComputerName hyperv-02 -ReplicationEnabled $true -AllowedAuthenticationType Kerberos -ReplicationAllowedFromAnyServer $false
New-VMReplicationAuthorizationEntry -AllowedPrimaryServer hyperv-01 -ReplicaStorageLocation c:\vm -TrustGroup test_group

Enabling replication for VM

On HyperV-02 right click VM-Enable Replication:


Enter Hyper-V host where VM will be replicated:


Choose if you wish to compress the data


If VM has more than one disk,it can be excluded from replication:


Set replication frequency


Configure recovery points:


Choose how VM data can be transferred to Replica Server (HyperV-01),over the network,or export it locally and copy it then to target server,and schedule replication


Using PowerShell:

Enable-VMReplication -VMName '2003' -ReplicaServerName '' -ReplicaServerPort 80 -AuthenticationType Kerberos -CompressionEnabled $true
Set-VMReplication -VMName '2003' -ReplicaServerName '' -ReplicaServerPort 80 -AuthenticationType Kerberos -CompressionEnabled $true -RecoveryHistory 0
Start-VMInitialReplication -VMName '2003'

We can track replication status:

Right click VM-Replication-View Replication Health






Get-VMReplication -VMName '2003' | fl *




  1. jcpro says:

    Now how do you do this with HTTPS certificate based authentication instead of Kerberos in a remote site – site connection with no existing VPN connecting the two sites?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s