Open a ticket
Chat with us
BLOG Published on 2015/11/12 by Asitha De Silva in Tech-Tips

Hyper-V Replication

Hyper-V Disaster Recovery

From my previous articles of Microsoft Hyper-V, I have discussed about the Overview of Hyper-V and the Hyper-V Operations. This article I’m going to address the Hyper-V Virtual machine high availability with Hyper-V Replications. When comes to Hyper-V High Availability there are options to select Fail over clustering or Load balancing clustering. These are host clusters which will provide high availability to their residing VM's. But it’s technically complex when implementing also there are licensing considerations and hardware costs involved. So it can be challenging to smaller organizations.



Hyper-V Replication


In Windows server 2012 R2 introduce Hyper-V Replication which is a built in feature to replicate VM's from its residing Host server to another Host Server. It is not a substitute for Failover clustering, it can use to protect VM's while asynchronously replicating a Virtual machine in a primary site to a replica Virtual machine in secondary site. Hyper-V replication does not require additional hardware or licenses, it can be activated easily by using the existing DR site and the existing network can be used for the replication.


Advantages


  • Resilience—Provides workload resilience with replication between branch offices or regional sites in different geographical locations for small to medium businesses.
  • Scalability—Replication can be scaled and automated by deploying it together with the Azure Site Recoveryservice. When you integrate with this service you can replicate between on-premises sites or between an on-premises site and Azure.
  • Lower costs—Lowers the cost-of-ownership by providing a storage-agnostic and workload-agnostic solution that replicates efficiently, periodically, and asynchronously over IP-based networks across different storage subsystems and across sites. It doesn’t rely on shared storage, storage arrays, or other software replication technologies.
  • Recovery—Allows quick recovery with minimal downtime and the ability to run workloads from a secondary site when outages occur.


To implement Hyper-V replication, your primary site server which is the source site and the replica site server which is the DR site should be Windows Server 2012R2. And both sites should be allowed for replication from the firewall.



Enabling Hyper-V Replication


Before implementing Hyper-Replica, Hyper-V Replication should be enabled in the replica site server to accept replication from the Primary site host server. And if you want to have reverse replication after a fail over, you have to enable the replication in the primary site server as well.Microsoft always recommend to allow replication from both sites.



  1. Login to the Replica site Hyper-V host and Open the Hyper-V Console  

  2. Open Hyper-V settings from Actions

  3. Select the replication Configuration Tab and tick Enable this computer as a Replica server, User Kerberos and allow replication from any authenticated server.



  4. Specific port should be opened for the replication from firewall also if you want to have the reverse replication from replica server to primary server, performed the above steps on the Primary site server. 







Configuring Virtual Machine Replication

After both sites are enabled for replication, you have to select the VM to replicate to the replica site. Initial replication will copy the VHD to the replica site and this can be done through the network or using an external media. If you are doing this using the network, select an off peak time so bandwidth impact will be lesser.



  1. Login to the Primary site host server and open Hyper-V console

  2. Select the Virtual Machine, right click – Enable Replication

     

  3. Press next and next page browse or type the name of the Replica host server. 



  4. Select the authentication type as Kerberos and next page select the VHD file







  5. Select the initial replication as network or external media, if you are selecting as network, schedule the time to start the replication on less bandwidth impact time. And if you are selecting the external media, you have to import it in the replica server while selecting the VM and choosing import



  6. Click finish to start the replication



  7. Check the replication health by clicking Replication – View Replication Health 








Testing the Failover

After the replication, you can confirm the replicated VM is running fine by doing Test Failover. Test failover can be run at any time, it will not have any impact to the production environment.   By running the test failover, it will create a temporary Virtual Machine in the replica site host server. You can turn on this VM and see everything is functioning, this will not going interrupt the current replication. When you finish with the test failover, temporary VM will be deleted automatically.


  1. Login to the Primary site host server and open the Hyper-V console.

  2. Select the replication enabled VM, Replication – Test Failover



  3. Select the recovery point



  4. Open the Hyper-V console in replica site server to see the temporary VM is creating.



  5. Run the VM to see its functioning

  6. After the testing right click the replicating VM and select Stop Test Failover, this will delete the temporary created VM. 






Running a Planned Failover 

In an event of a planned maintenance or a failure of the primary site or to test the disaster recovery site readiness, you can perform a planned failover. In a planned failover, the latest changes will be replicated to the replica site VM. And then it will started without a data loss.


  1. Login to the Primary site host server and open the Hyper-V console

  2. Select the replication enabled VM, Shutdown,  Replication – Planned Failover





  3. After the failover, you can enable the reverse replication so it will replicate from replica site to primary site server.


Conclusion

Hyper-V Replication is not a substitute for failover clustering. It’s VM level DR scenario which does not require additional hardware or licenses. For better use of Hyper-V replication both Host servers should be Windows Server 2012R2, Firewall exception should be added, both hosts should be resolve each others FQDN and both host server replication should be enabled from Hyper-V console.

Cheers


Asitha De Silva



















Asitha De Silva

Consultant Cloud Solutions

Expert in architecting and implementing cloud-based infrastructure solutions.

Newsletter

To keep up with the news and updates related to our products, make sure to subscribe to our newsletter!

Copyright © 2024 Terminalworks. All Rights Reserved