Monday, August 5, 2013

Windows 2012 Hyper-V Replica using a dedicated network is possible.

Hello.

We'll talk about Windows 2012 Hyper-V replica feature today.
This feature allows to replicate a living VM on a secondary Hyper-V Windows 2012 server.
The replication interval is 5 minutes, and is block incremental. The network overhead is quite low.

Two weeks ago, i had a customer request about dedicating a network for this replication traffic.

I thought that it could be interesting to do this since it offers :

-More security (total isolation)
-Increased performance in case of network saturation or if the network backbone is overwhelmed or slow (let's say 100 mbps)
-Increased resilience (replication would continue if the LAN backbone is out)

In this specific case, the replication network was not switched. It was simply made by connecting the source and replica destination servers by a patch network cable (direct attach, no switches involved)

I wondered too if i could add even more resilience by teaming the direct connection between the servers.
The reply is : yes.

So, i used two NICs on both sides too create a Windws 2012 teamed interface (on both servers).
Whenever, one NIC or cable fails or disconnect, the traffic continues to flow. I left all settings for the teaming at automatic. I was pleased to see that I got more than NFT mode (network fault tolerance, meaning only one link is used at a time) : The network reported 2 Gbps on both sides so it means there was load balancing at work.

Then I tested disconnecting and reconnecting the links one at a time, and validated that the NIC team was performing well on both sides.

Then, How to use this network for Hyper-V replication ?

The solution is extremely simple : edit hosts file  and override DNS settings on the source of replication server, assigning to the FQDN name of the replica server the IP declared on the replication dedicated network.

Make also sure that the rules of Windows Firewall allow replication using this network, you can do this easily by first declaring the dedicated team for replication to be a private network in Windows firewall. (you have to edit the local GPO of the server for this)

Then create the replica link.

Configure replication using Kerberos or SSL Certificates (both modes worked for me in this setup) on the replica destination server.

Then initiate replication of a VM from the source server using whatever mode. The replication should work.

Then you have to check that the replication network you created is indeed used by Hyper-V.

Use this command to check it on the source or destination server :

netstat -no| find ":80"
or
netstat -no | find ":443"

You should find sockets open on the IP addresses of the replication network and see traffic flowing every 5 minutes. You may check more in detail with the performance monitor, or network monitor, or wireshark.

Hope you will test this setup too and tell me what you think about it.

 Finally some important info :

Using a test environment at first is really important. Having a solid backup plan too is important. Do not rely on replications as a backup method.

DISCLAIMER :

Use the procedure above at your own risk. I am not to be held responsible of data loss or any damage done to your IT environment by applying the procedure above.





2 comments:

  1. hi , do I need to create a virtual switch and virtual adapter for this to work? or do i just set up teaming on 2 NICs and thats it?

    ReplyDelete
    Replies
    1. Hello, thank for your comment.

      If i remember correctly, you don't need virtual switches on the dedicated interfaces used for replication. You will see soon enought if it does not work.

      Delete

Fell free to comment : share your opinion and experienced, provide feedback, help me to correct mistakes, and ask for help if you need any !