Windows Server 2012 R2 Hyper V Replica setup step by step

Since introduction of Windows Server 2012 R2, HyperV has a wonderful new feature – Replication. HyperV Replica asynchronously copies selected VM from primary HyperV server (source) to designated replica (target) HyperV across LAN or WAN.

HyperV Replica is not HA solution, it is more like DR support, and great option if you have limited budget for your IT.

HyperV Replica doesn`t need special hardware, your servers should support Windows Server 2012 and virtualization. You don`t have to setup additional storage (NAS, SAN) HyperV Replica can be done on local storage as long as you have enough space to successfully enable your VMs.

You should take you LAN/WAN capacities into consideration when thinking about HyperV Replica. Traffic depends on the workload your VM does. If you want your connection to be secure (especially via WAN) you should consider implementing HTTPS communication which will require certificates.

You don`t need Failover Clustering in order to implement HyperV Replica, two machines with installed HyperV are enough. Machines also don`t have to be in domain.

I won`t cover prerequisites for HyperV Replica here in details – if you are interested about HyperV Replica more in depth and details you can read here – https://technet.microsoft.com/en-us/library/jj134207.aspx

This LAB will cover setting up HyperV Replica and assumes you have prepared your machines for it.

 

Start HyperV by going to Server Manager |Tools | Hyper-V Manager and when Manager opens right click on your HyperV server and choose Hyper-V Settings

hypervreplica_1

From left side of the menu choose Replication Configuration | from right side I choose Enable this computer as a Replica server | From Authentication and ports I choose Use Kerberos (HHTP) on port 80 (you should consider certification based Authentication especially if connection is going through WAN, this should be mandatory) | from  Authorization and storage menu I choose Allow replication from any authenticated server and specified my VMs folder.

hypervreplica_2

This should be done on both HyperV servers, so repeat procedure on your second server.

After Replica is enabled on both HyperV servers, next step should be firewall

Control Panel | Windows Firewall | Advanced settings | Inbound Rules | you should enable Hyper-V Replica HTTP listener or HTTPS Listener ( I enabled both for purpose of my LAB needs, only one should be enabled HTP, or HTTPS according to what you use)

hypervreplica_3

This should be done on both servers.

 

That’s it for HyperV server setup.

Next stop is configuration of VM Replica.

Right click on VM you wish to Replicate and click on Enable Replication

hypervreplica_4

Next

hypervreplica_5

Enter name of your target server | Next

hypervreplica_6

I`m doing this LAB in my test environment, so I`ll choose HTTP Authentication over port 80 with no Data compression. You should definitely consider HTTPS and data compression in your network environment |Next

hypervreplica_7

Choose VHDs that you want to replicate | Next

hypervreplica_8

Frequency or Replication. For the LAB I`ll choose 5min, in your case and according to your needs you`ll choose same, more or less frequent replication | Next

hypervreplica_9

I`ll choose Maintain only the latest recovery point, you can choose to keep more than one recovery point, so that you can choose to recover to some point in time. Keep in mind that it is disk and processor consuming task | Next

hypervreplica_10

Last point in this wizard is initial replication. Since I don`t have bandwidth or VM size problem, I`ll replicate via network. You can choose to replicate with external media or already have restored VM to target replica. You can also choose when to start replication, I`ll start it immediately | Next

hypervreplica_11

Check your settings | Finish

hypervreplica_12

Replication is successfully enabled

hypervreplica_13

Replication process started…

Source

hypervreplica_14

Target

hypervreplica_15

Sometimes later…

While Source finished sending Initial Replica

hypervreplica_16

Target is still receiving

hypervreplica_17

This is normal situation, and give it some time to finish.

While you wait for it, you may encounter few errors. I just waited and didn`t touch anything, and it went fine in the end.

hypervreplica_18

Here is the Microsoft support answer to error ids https://support.microsoft.com/en-us/kb/2889734

 

Right click on the VM on your source server | choose Replication | View Replication Health

Replication in my case is successfully done and enabled. Step may be different if you choose to send copy over media or use existing restored machine.

You can see your primary and replica server, health, state and many other info.

hypervreplica_20

 

In this short lab we covered Hyper V Replica setup and in the end we have successful VM replication. If you are interested in failover testing of your VM replica read on here – https://www.informaticar.net/?p=2146

 

 

Disclaimer