Windows Server 2012- How to enable Hyper- V Replication

Introduction

What is Hyper-V Replica?
Hyper-V Replica is a Software based Asynchronous Replication mechanism. The mechanism will replicate / photocopy your virtual Machine to a different site that may be your Data Centre in Las Vegas. Of course that would be transferred over Wan, how to secure the replication traffic is out of scope of this article, however I would recommend VPN.

Steps
(19 total)

1

Enable replication on the Servers

The first step is to, please note that we do not need to enable replication on the Host Sending the replications, replication should only be enabled on Servers that are receiving replications. While we are configuring Replication on a Virtual Machine we will be prompted to configure replication on Replica Server. For this exercise we will follow the other path.

2

Connect the Hyper-V Console to your Host Hyper-V Servers.

3

Right Click on LHEHOST5 and click on Hyper-V Settings

4

Enable this computer as Replica server

On Hyper-V Server Settings dialog, click on Replication Configuration in the left pane. Select Enable this computer as Replica server. Now we need to configure Authentication and ports. The authentication option can be Kerberos or Certificate-based, or it can be both that complies your requirement. For this exercise I would use Kerberos.

5

Configure Authorization and storage

What we configure here is which Hyper-V Server is allowed to send replicate virtual machines to this Host, and where they will be stored. We can allow replication traffic to come in from any authenticated server or we can specify a server, as we would do here by clicking add.

6

Specify Servers that are allowed to replicate Virtual Macines to this Virtual Server

Specify primary Server: This is the Hyper-V Host that will send replication traffic.
Specify the default location to store replica files: Of course as the name denotes this is the folder location where replicated machines will be stored on LHEHOST5.
Specify the trust group: In simple words this is a tag placed on replicated virtual machines so it can only be run on Hyper-v hosts in that trust group.

7

Summarising

what we have configured so far is; only LHEHOST4 can send replicated virtual machines to LHEHOST5 and the replicated machines will be placed in Replica VMs Store Folder on Lhehost5, in addition the replicated virtual machines can only be run on Hyper-V Hosts that are part of CX Trust group.

8

You will be prompted to configure Fire Wall

Clicking Ok will prompt an informational message to ensure that LHEHOST Hyper-v 5 have an allowed rule for this replication traffic.

9

Configure Firewall Rule

Open Windows Firewall and Advanced Security on LHEHOST5 by typing wf.msc in Run window and click on.

10

On Windows Firewall and Advanced Security console click on inbound rules in left pane.

Enable Replication for Virtual Machine.

On Hyper-V Manager Console right click on LHEHOST4 in the left pane. Right click on the ,machine you want to replicate and Enable Replication to open the wizard.

12

Before You Begin:

This just informatory page, you can safely click next on this screen.

13

Specify Replica Server:

Provide the name of Hyper-V Server that will receive replication traffic, both NetBIOS and FQDN will work or you can click on browse to search the Hyper-V Host machine in your domain.

14

Specify Connection Parameters:

Here we will specify where we will be sending or replicating this virtual machine, settings are pre-configured in accordance to our Replica Server. We can select or deselect compression, if we have selected compression, the network traffic will be lesser.

15

Choose Replication VHDs:

Now from the detected hard drives of the virtual machine we will select which VHD will be replicated. Make selection and click Next.

16

Chose Replication Frequency:

This option an enhancement to and is only available for Windows 2012 R2, here we can configure the replication frequency.

17

Choose Recovery History:

Now we will specify how much history of this virtual machine to be retained on destination Replica Server. By default the latest recovery point will be retained, however we can increase the number of recovery points, the storage usage will be shown dynamically based upon the number of recovery points you want to retain. We can also make use of incremental VSS and set an interval for that. For this exercise I click on Next having only the latest recovery point selected as default.

18

Choose Initial Replication Method:

Since after the first replication only changes are sent, so here we will specify the method for Initial Replication. Knowing the size can help us making the right decision that can be using network, external media or an existing virtual machine, I can also configure replication to occur now or later after business hours. Remember this traffic will travel over the WAN. I would go for Send Initial copy over network and Start replication immediately and click on Next.

19

Completing the Enable Replication wizard:

Review the configuration here can click on Finish

Conclusion

We are done here.
Please note that the replication mechanism caters the needs of Small to Medium enterprise with limited bandwidth, however it is not an ideal solution for Large Scale Enterprise.

8 Comments

Hello S. Danish,
Thank you for the post. it would be very helpful for newbies like me. I do have the following scenario: I do have only two Hyper-V hosts, each one is running certain guests, let us assume each host is running 3 VMs. Each of these hosts have the resources and space to run more than 10 vms. My question is: can I do replication to each other? Thanks

Ammar,
So lets name your servers. VHOST1 and VHOST 2. First you would enable replication on VHOST2 step 1-10, and then enable replication on 3 machines hosted on VHOST2, remaining steps for all VMS. Then vice versa.

Thank you for this tutorial. I have a question though that doens't seem to answered anywhere that i search.

I want to know if two hyper-v's (HyperV01 and HyperV02) can replicate to one another? They are both on 2012 servers and the replication works fine in one direction HyperV02 --> HyperV01, but the reverse, HyperV01 -->Hyperv02 seem's to be smitten with errors relating from kerberos to obscure undocumented errors! Before addressing all those errors, is my theory correct. they CAN be made be to replicate between each other??? (obviously different machines on each hyperv) .. they can both be Replication server and Replication primary and serve each other?
Many thanks,

A vendor claims Ciscos hardware routers would out perform Sophos firewalls as gateway devices. Each vendor claims their stuff is superior. What do you think, is the hardware advantage enough to overcome the extra hop/processing cost?