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.
- 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
- 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.
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.
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