Export (0) Print
Expand All
21 out of 22 rated this helpful - Rate this topic

Step 2: Enable Replication

Published: May 31, 2012

Updated: May 31, 2012

Applies To: Windows Server 2012, Windows Server 2012 R2



This topic discusses the steps to actually enable replication, including both standalone servers and servers that are part of a failover cluster. You enable replication in both cases both for each virtual machine that is to be replicated and the physical server that is hosting the virtual machines. The activities in Step 1: Prepare to Deploy Hyper-V Replica will enable you to work through this step very quickly.

Although Hyper-V Replica will work if you configure only the Replica server (to receive replication from primary servers), it is a good practice to also configure the primary servers to receive replication. This allows you to reverse the replication direction after a failover, which provides replication protection for the newly active Replica server.

 

Task Description

2.1 Configure the Replica server

Configure server that receives the replication data and hosts virtual machines after a failover.

2.2. Configure a Replica server that is part of a failover cluster (optional)

Replica servers that are part of failover clusters are configured for Replica slightly differently.

2.3 Enable replication for virtual machines

Each virtual machine that is to be replicated must be enabled for replication.

2.4 Configure primary server to receive replication

Configure a primary server to receive replication so that it can participate in reverse replication.

noteNote
This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see Using Cmdlets.

You configure a server to receive replication with Hyper-V Manager, which is available locally on any server that has Hyper-V installed or installable separately as part of the Remote Server Administration Tools (RSAT). Servers that are part of failover clusters use Failover Cluster Manager to also configure Hyper-V replication. With any of these tools, you can connect to the Replica server remotely to enable replication for it.

noteNote
The Replica server need not have exactly the same resources (such as memory and CPU) as the primary server. If the Replica server has fewer resources than the primary server, Hyper-V Replica will compensate automatically to the extent possible. However, if the Replica server is completely missing a resource that is present on the primary server (for example, a network switch with a particular name), enabling replication will succeed, but the Replica server will not be able to use the missing resource in the event of a failover.

  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 you decided on in Step 1: Prepare to Deploy Hyper-V Replica. For either authentication method, specify the port to be used (the default ports are 80 for Kerberos over HTTP and 443 for certificate-based authentication over HTTPS).

  5. If you are using certificate-based authentication, click Select Certificate and provide the request certificate information.

  6. In the Authorization and storage section, use the radio buttons to specify whether to allow any authenticated (primary) server to send replication data to this Replica server or to limit acceptance to data from specific primary servers. You can use wildcard characters to limit acceptance to servers from a particular domain without having to specify them all individually (for example, *.contoso.com). If you specify individual primary servers, you can designate a separate storage location for Replica data for each one, as well grouping them with the Trust Group tag.

  7. Click OK or Apply when you are finished.

Set-VMReplicationServer -ReplicationEnabled $true -AllowedAuthenticationType Certificate -ReplicationAllowedFromAnyServer $true -CertificateThumbprint "<CertThumbprint>” -DefaultStorageLocation “<Storage Location>” -CertificateAuthenticationPort <Listenerport>

Verify that the https listener is running with netsh http show servicestate.

Ensure that Windows Firewall is allowing traffic through the port with the following cmdlet:

Enable-Netfirewallrule -displayname "Hyper-V Replica HTTPS Listener (TCP-In)"

If the Replica server is part of a failover cluster, ensure that Windows Firewall is allowing traffic with this cmdlet instead:

Get-ClusterNode | ForEach-Object  {Invoke-command -computername $_.name -scriptblock {Enable-Netfirewallrule -displayname "Hyper-V Replica HTTPS Listener (TCP-In)"}}

Having configured the Hyper-V Replica Broker (see Step 1.4), you enable replication directly from Failover Cluster Manager. If you haven’t configured the Hyper-V Replica Broker, follow the directions in Step 1.4. When you complete these steps, Replica is configured for all nodes of the cluster.

noteNote
If you use certificate-based authentication, ensure that each cluster node and the Hyper-V Replica Broker’s client access point all have appropriate machine certificates.

noteNote
If you use network address translation (NAT), ensure that the inbound and outbound ports are configured to use the same port number. Replica only listens on one port.

  1. In Server Manager, open Failover Cluster Manager.

  2. In the left pane, connect to the cluster, and while the cluster name is highlighted, click Roles in the Navigate category of the Details pane

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

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

  5. In the Authentication and ports section, select the authentication method you decided on in Step 1: Prepare to Deploy Hyper-V Replica. For either authentication method, specify the port to be used (the default ports are 80 for Kerberos over HTTP and 443 for certificate-based authentication over HTTPS).

  6. If you are using certificate-based authentication, click Select Certificate and provide the request certificate information.

  7. In the Authorization and storage section, use the radio buttons to specify whether to allow any authenticated (primary) server to send replication data to this Replica server or to limit acceptance to data from specific primary servers. You can use wildcard characters to limit acceptance to servers from a particular domain without having to specify them all individually (for example, *.contoso.com). If you specify individual primary servers, you can designate a separate storage location for Replica data for each one, as well grouping them with the Trust Group tag.

Once the hosting server is configured for Replica, you can enable replication for each virtual machine that you want to be replicated. The details of replication are configured on a per-virtual-machine basis, so each one can have slightly different settings.

Do this step using Windows PowerShell

  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, per your decision from 1.1. Make basic planning decisions, and 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, per your decisions from 1.1. Make basic planning decisions, and then click Next.

    noteNote
    In Windows Server 2012 R2, this page of the wizard has been replaced by two pages: Configure Replication Frequency and Configure Additional Recovery Points.

  7. On the Choose Initial Replication page, select the initial replication method to use per your decisions from 1.1. Make basic planning decisions. If you choose to have initial replication over the network occur at a later time, configure that here as well, 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 dialog box appears indicating that replication was successfully enabled. In this dialog, click the Settings button and provide settings to configure the network that the virtual machine will connect to on the Replica server. The Replica virtual machine does not automatically connect to any network on the Replica server (after a failover) by default, so these settings are important. You can configure the network settings so that the virtual machine will connect to a different network after a failover to the Replica server than it used when it was on the primary server.

    noteNote
    The configuration data for a virtual machine is replicated only once, at the time of initial replication. After that point, you manage the primary and Replica virtual machines independently.

  10. 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. If you elected to use external media for the initial copy, the necessary files are copied to a local location. Copy the files to the media you will use to transfer the initial copy and then send the media to the Replica site.

  11. Using Hyper-V Manager or Windows PowerShell on the Replica server, perform initial replication for each virtual machine, using the files you sent to the Replica site.

PowerShell Logo Windows PowerShell equivalent commands

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

This example sequence of cmdlets will enable and start replication for a virtual machine (“CRMVM”) that is hosted by a Replica server named “Recovery1.contoso.com”. In this example, Kerberos authentication is configured. All steps must be completed by a user with administrative privileges.

Import-Module Hyper-V

$ReplicaServer = “Recovery1.contoso.com”
$RecoveryPort = 8080
$PrimaryVM1 = “CRMVM”
$PrimaryServer = “Primary1.contoso.com”

Enable-VMReplication -VMName $PrimaryVM1 -ReplicaServerName $ReplicaServer -ReplicaServerPort $RecoveryPort -AuthenticationType Integrated -CompressionEnabled $true -RecoveryHistory 0

Start-VMInitialReplication –VMName $PrimaryVM1

Hyper-V Replica normally sends changes that occur on the primary virtual machines to the Replica virtual machines, but after a failover, it can send the data the other direction. By doing this, when you fail over operations from the current primary server to the Replica server, the replication direction can be reversed back to the primary server from the Replica server once the primary has come back online. In this way, you provide replication protection for the Replica server which is now servicing the virtual machine load.

To do this, simply repeat 2.1 Configure the Replica server (or 2.2. Configure a Replica server that is part of a failover cluster (optional)) on one or more of the primary servers, using the same settings you used for the Replica server.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.