How to configure Hyper-v Replica Step By Step


Hyper-V Replica provides IP based asynchronous replication of virtual machines between two Hyper-v servers. Since this an asynchronous replication, replica virtual machine will not have the most recent data. However, replica virtual machines provides a cost effective way of keeping a copy of production virtual machines in a secondary site and can be made available in case of a disaster.

Benefits:

  • Shared or standalone storage to fulfill the capacity requirement of the replicated virtual machine
  • Asynchronous replication of Hyper-V virtual machines over Ethernet IP based network
  • Replica works with standalone servers, failover clusters, or a mixture of both
  • Hyper-v Hosts can be physically co-located or geographically diverse location with MPLS or IPVPN connection
  • Hyper-v Hosts can be domain joined or standalone
  • Provide planned or unplanned failover
  • Any Hyper-v virtualized server can be replication using Hyper-v replica

Requirement:

  • Windows Server 2012 R2 Hyper-v Role Installed
  • Windows Server 2012 Hyper-v Role Installed
  • Similar virtual network and physical network must be configured in secondary site for replica virtual machine to function as production virtual machine.

Step1: Configure Firewall on Primary and Secondary Hyper-v Host

1. Right Click Windows Logo on Task Bar>Control Panel>Windows Firewall

2. Open Windows Firewall with Advance Security and click Inbound Rules.

3. Right-click Hyper-V Replica HTTP Listener (TCP-In) and click Enable Rule.

4. Right-click Hyper-V Replica HTTPS Listener (TCP-In) and click Enable Rule.

Step2: Pre-stage Replica Broker Computer Object

1. Log on to DC>Open Active Directory Users & Computers>Create New Computer e.g. HVReplica

2. Right Click on HVReplica Computer Object>Properties>Security Tab>Hyper-v Cluster Nodes NetBIOS Name>Allow Full Permission>Apply>Ok.

Step3: Configure Replica Broker in Hyper-v Environment

Hyper-v Replica using Failover Cluster Wizard

1. Log on Hyper-v Host>open Failover Cluster Manager.

2. In the left pane, connect to the cluster, and while the cluster name is highlighted, click Configure Role in the Actions pane. The High Availability wizard opens

3. In the Select Role screen, select Hyper-V Replica Broker.

image

4. Complete the wizard, providing a NetBIOS name you have created in previous step and IP address to be used as the connection point to the cluster.

5. Verify that the Hyper-V Replica Broker role comes online successfully. Click Finish.

6. To test Replica broker failover, right-click the role, point to Move, and then click Select Node. Then, select a node, and then click OK.

7. click Roles in the Navigate category of the Details pane

8. Right-click the role and choose Replication Settings.

9. In the Details pane, select Enable this cluster as a Replica server.

10. In the Authentication and ports section, select the authentication method Kerberos over HTTP and authentication over HTTPS.

11. To use certificate-based authentication, click Select Certificate and provide the request certificate information.

12. In the Authorization and storage section, you can specify default location or specific server with specific storage with the Trust Group tag.

13. Click OK or Apply when you are finished.

 

Configure Hyper-v Replica using Hyper-v Manager

To Configure Hyper-v replica Broker in non-clustered environment.

1. In Hyper-V Manager, click Hyper-V Settings in the Actions pane.

2. In the Hyper-V Settings dialog, click Replication Configuration.

image

3. In the Details pane, select Enable this computer as a Replica server.

4. In the Authentication and ports section, select the authentication method Kerberos over HTTP and authentication over HTTPS.

5. To use certificate-based authentication, click Select Certificate and provide the request certificate information.

6. In the Authorization and storage section, you can specify default location or specific server with specific storage with the Trust Group tag.

7. Click OK or Apply when you are finished.

Step4: Configure Replica Virtual Machine

1. In the Details pane of Hyper-V Manager, select a virtual machine by clicking it.

2. Right-click the selected virtual machine and point to Enable Replication. The Enable Replication wizard opens.

3. On the Specify Replica Server page, in the Replica Server box, enter either the NetBIOS or fully qualified international domain name (FQIDN) of the Replica server that you configured in Step 2.1. If the Replica server is part of a failover cluster, enter the name of the Hyper-V Replica Broker that you configured in Step 1.4. Click Next.

4. On the Specify Connection Parameters page, the authentication and port settings you configured for the Replica server in Step 2.1 will automatically be populated, provided that Remote WMI is enabled. If it is not enabled, you will have to provide the values. Click Next.

5. On the Choose Replication VHDs page, clear the checkboxes for any VHDs that you want to exclude from replication, then click Next.

6. On the Configure Recovery History page, select the number and types of recovery points to be created on the Replica server, then click Next.

7. On the Choose Initial Replication page, select the initial replication method and then click Next.

8. On the Completing the Enable Replication Relationship Wizard page, review the information in the Summary and then click Finish.

9. A Replica virtual machine is created on the Replica server. If you elected to send the initial copy over the network, the transmission begins either immediately or at the time you configured.

Step5: Test Replicated Virtual Machine

1. In Hyper-V Manager, right-click the virtual machine you want to test failover for, point to Replication…, and then point to Test Failover….

2. After you have concluded your testing, discard the test virtual machine by choosing Stop Test Failover under the Replication option

Step6: Planed Failover

1. Start Hyper-V Manager on the primary server and choose a virtual machine to fail over. Turn off the virtual machine that you want to fail over.

2. Right-click the virtual machine, point to Replication, and then point to Planned Failover.

3. Click Fail Over to actually transfer operations to the virtual machine on the Replica server. Failover will not occur if the prerequisites have not been met.

How to respond to unplanned Failover

1. Open Hyper-V Manager and connect to the Replica server.

2. Right-click the name of the virtual machine you want to use, point to Replication, and then point to Failover….

3. In the dialog that opens, choose the recovery snapshot you want the virtual machine to recover to, and then click Failover….. The Replication Status will change to Failed over – Waiting completion and the virtual machine will start using the network parameters you previously configured for it

4. Use the Complete-VMFailover Windows PowerShell cmdlet below to complete failover.

Starting a reverse replication once disaster is over

1. Open Hyper-V Manager and connect to the Replica server.

2. Right-click the name of the virtual machine you want to reverse replicate, point to Replication, and then point to Reverse replication…. The Reverse Replication wizard opens.

3. Complete the Reverse Replication wizard. You will find the requested information to be very similar if not identical to the information you provided in the Enable Replication wizard

Similar Articles:

Migrating VMs from Standalone Hyper-v Host to clustered Hyper-v Host

Understanding VLAN, Trunk, NIC Teaming, Virtual Switch Configuration in Hyper-v Server 2012 R2

How to configure SAN replication between IBM Storwize V3700 systems

About Raihan Al-Beruni

My Name is Raihan Al-Beruni. I am working as an Infrastructure Architect in Data Center Technologies in Perth, Western Australia. I have been working on Microsoft technologies for more than 15 years. Other than Microsoft technologies I also work on Citrix validated solution and VMware data center virtualization technologies. I have a Masters degree in E-Commerce. I am certified in Microsoft, VMware, ITIL and EMC. My core focus is on cloud technologies. In my blog I share my knowledge and experience to enrich information technology community as a whole. I hope my contribution through this blog will help someone who wants more information on data center technologies.
This entry was posted in Virtualization and tagged , , , , . Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s