Export (0) Print
Expand All

Step 6: Configure and Use Extended Replication

Applies To: Windows Server 2012 R2



This topic explains how to configure and work with extended replication. In extended replication (available in Windows Server 2012 R2), your Replica server forwards changes that occur on the primary virtual machines to a third server (the extended Replica server). After a planned or unplanned failover from the primary server to the Replica server, the extended Replica server provides further business continuity protection. As with ordinary replication, you configure extended replication by using Hyper-V Manager, Windows PowerShell (using the –Extended option), or WMI.

Having the third server allows for new options for planned, unplanned, and test failovers, as well as different ways of moving the virtualized workload among the three servers. Once extended replication is established, you can do essentially all of the same things with the Replica and extended Replica servers just as you would with the primary server and the Replica server.

noteNote
Because the roles of primary, Replica, and extended Replica can be exchanged among the various servers, to keep the explanations as clear as possible, in this topic we will assume a starting configuration of three servers: Server A, Server B, and Server C. This topic assumes that you have already configured standard replication along the lines of Steps 1-5 of this topic collection, where Server A is the primary server and Server B is the Replica server. The extended Replica server created in these steps will initially be Server C.

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.

Do this step using Windows PowerShell

  1. In Hyper-V Manager, connect to the Replica server (in the initial state of this example, Server B).

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

  3. On the Specify Replica Server page, enter the name of the server you intend to use as the extended Replica (in this example, Server C; not the current Replica server, Server B).

  4. Complete the wizard, providing values as you did when you originally configure replication between the primary and the Replica server. You can use different values for replication frequency, authentication method, and initial replication method than those you used for the basic replication configuration.

    noteNote
    There are certain differences in the Replica-extended Replica relationship as compared to the primary-Replica relationship:

    • You must use a longer replication frequency for extended replication than was configured for the primary-Replica relationship. Only frequencies of 5 or 15 minutes are supported for extended replication.

    • If you have configured application-consistent snapshots in the primary-Replica relationship, these snapshots are forwarded to the extended Replica. However, you cannot set a different frequency for the snapshots or enable application-consistent snapshots for extended replication independent of the primary-Replica relationship.

    • The collection of VHDs used in the primary-Replica relationship cannot be different in extended replication.

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.

You extend replication with the same cmdlet used to enable ordinary replication. However, you run it from the current Replica server and use –ReplicaServerName to define the extended Replica server.

Enable-VMReplication –VMName <vmname> -ReplicaServerName <extended_server_name> -ReplicaServerPort <Auth_port> -AuthenticationType <Certificate/Kerberos> -ReplicationFrequencySec <300/900> [--other optional parameters if needed--]

To monitor the status and statistics of extended replication, start Hyper-V Manager, right-click the Replica virtual machine, and then point to View Replication Health.

noteNote
To see the data for the extended replica, you must view the health report from the Replica server. From the primary server, you can only access the report for the primary replication relationship.

With Windows PowerShell, you can use the Measure-VMReplication cmdlet with the extra parameter –ReplicationRelationshipType. If you use the parameter without specifying a value, statistics for both the primary and extended replication are returned. To specify the extended replication relationship, use the parameter with the value Extended; for the primary relationship, use the value Simple.

Examples:

To view the statistics of the extended replication relationship from the Replica server:

Measure-VMReplication –VMName <name> -ReplicationRelationshipType Extended | select *

To view the statistics of the primary replication relationship from the Replica server:

Measure-VMReplication –VMName <name> -ReplicationRelationshipType Simple | select *

To view replication relationship statistics for both the primary and extended replication relationships:

Measure-VMReplication –VMName <name> | select *

Pausing and resuming extended replication works the same way as for primary replication. You can control primary and extended replication separately. If you access the Replica virtual machine with Hyper-V Manager, you will find separate options for pausing or resuming either the primary replication or the extended replication. If you access the extended Replica virtual machine, you will find pause and resume options for only the extended replication.

With Windows PowerShell, you can use the Suspend-VMReplication and Resume-VMReplication cmdlets with the extra parameter –ReplicationRelationshipType. To specify pausing or resuming the extended replication relationship, use the parameter with the value Extended; for the primary relationship, use the value Simple (which is the default if you don’t specify the replication relationship type.

Examples:

To pause or resume extended replication from the Replica server:

Suspend-VMReplication/ Resume-VMReplication –VMName <name> -ReplicationRelationshipType Extended

To pause or resume primary replication from the Replica server:

Suspend-VMReplication/ Resume-VMReplication –VMName <name> -ReplicationRelationshipType Simple

To pause or resume primary replication (if performed on the primary server) or extended replication (if performed on the extended Replica server):

Suspend-VMReplication/ Resume-VMReplication –VMName <name>

To recover from certain errors, it might be necessary to resynchronize replication. If an error has occurred, you can resynchronize either primary or extended Replication with the following commands.

Examples:

To resynchronize replication from the primary server in the event of an error:

Suspend-VMReplication –VMName <name>//puts the virtual machine state to suspended
Resume-VMReplication –VMName <name> -ReplicationRelationshipType Extended -Resync

To resynchronize extended replication from the Replica server:

Suspend-VMReplication –VMName <name> -ReplicationRelationshipType Extended //puts the extended virtual machine state to suspended
Resume-VMReplication –VMName <name> -ReplicationRelationshipType Extended -Resync

In some circumstances, it is possible that replication could be in the “Resynchronization Required” state. If this occurs, you can use Hyper-V Manager to perform resynchronization immediately or schedule it for a later time. If the primary replication relationship is resynchronizing, extended replication will move into the Resynchronization Required state. When primary resynchronization is complete, extended resynchronization commences automatically.

You can also start resynchronization with Windows PowerShell.

Examples:

To resynchronize replication from the primary server when in Resynchronization Required state:

Resume-VMReplication –VMName <name> -Resync

To resynchronize extended replication from the Replica server when in Resynchronization Required state:

Resume-VMReplication –VMName <name> -ReplicationRelationshipType Extended -Resync

Test failovers from the Replica server to the extended Replica server work just as they do in a basic replication relationship (described in Step 3: Test the Replication Deployment). During the test failover, the relationship between the Replica server and the extended Replica server remains intact. During the test, you can also pause or resume operations between Replica and extended Replica.

Having an extended Replica server affords more options when you perform a planned failover. In a basic replication configuration (without an extended Replica server), once you perform a planned failover from Server A to Server B, you typically reverse replication from B to A to provide replication protection for B, which is now hosting the active virtualized workload.

With an extended Replica server, once you have completed a planned failover from A to B, B acts as the primary server, but you can either use C as its Replica server or reverse replication back to A.

  1. Use Hyper-V Manager or Windows PowerShell to shut down the virtual machine on the primary server (in this example, Server A).

  2. Start a planned failover from Server A to Server B, as described in Step 4: Perform a Planned Failover.

  3. In the Planned Failover dialog box, clear Reverse the replication direction after failover checkbox and select the Start the Replica virtual machine after failover checkbox.

  4. Click Fail Over.

  5. After failover is complete, in Hyper-V Manager, right-click the virtual machine that is now on the Replica server (Server B) and point to Resume Extended Replication. This removes the replication relationship between Servers B and A; as result, B is now the primary server, and C is its Replica server.

To do this with Windows PowerShell, run Start-VMFailover –VMName <name> -Prepare on the primary server (Server A), then run Start-VMFailover –VMName <name> on Server B. The virtual machine is now failed over to Server B, which is the new primary server.

To use Server C as the new Replica server to protect Server B, run the following cmdlets on Server B:

Complete-VMFailover –VMName <name> // to commit the failover
Start-VMFailover -Prepare
Resume-VMReplication –VMName <name> -Continue // to resume extended replication

  1. Use Hyper-V Manager or Windows PowerShell to shut down the virtual machine on the primary server (in this example, Server A).

  2. Start a planned failover from Server A to Server B, as described in Step 4: Perform a Planned Failover.

  3. In the Planned Failover dialog box, select the Reverse the replication direction after failover checkbox and select the Start the Replica virtual machine after failover checkbox.

  4. After failover is complete, in Hyper-V Manager, right-click the virtual machine that is now on the Replica server (Server B) and point to Reverse Replication. This removes the extended replication relationship between Servers B and C; as result, B is now the primary server, and A is its Replica server.

To do this with Windows PowerShell, run Start-VMFailover –VMName <name> -Prepare on the primary server (Server A), then run Start-VMFailover –VMName <name> on Server B. The virtual machine is now failed over to Server B, which is the new primary server.

To use Server A as the new Replica server to protect Server B, run the following cmdlets on Server B:

Remove-VMReplication –VMName <name> -ReplicationRelationshipType Extended
Set-VMReplication –VMName <name> -Reverse

In some circumstances, you might want to take both the primary and Replica servers (Servers A and B) offline, and have the extended Replica (Server C) maintain the virtualized workload.

  1. Shut down the virtual machine on the primary server (Server A), and then complete a planned failover to the Replica server (Server B) (see Step 4: Perform a Planned Failover).

  2. Once failover to the Replica server is complete, complete a planned failover to the extended Replica server (Server C).

To do this with Windows PowerShell, run Start-VMFailover –VMName <name> -Prepare on the primary server (Server A), then run Start-VMFailover –VMName <name> and Complete-VMFailover –VMName <name>on Server B. The virtual machine is now failed over to Server B, which is the new primary server.

Fail over from Server B to Server C by running Start-VMFailover –VMName <name> -Prepare on Server B.

Finally, complete the failover to Server C by running the following on Server C:

Start-VMFailover –VMName <name>
Complete-VMFailover –VMName <name>

If the primary server (Server A) goes down, you can complete an unplanned failover to the Replica server (Server B) with Hyper-V Manager by right-clicking the virtual machine on Server B and pointing to Failover. In the dialog that opens, select a recovery point and click Fail Over.

To do this with Windows PowerShell, run Start-VMFailover –VMName <name> -VMRecoverySnapshot <VMSnapshot>.

Once failover to Server B is complete, you can choose to continue replication to Server C (to provide protection to Server B), or if Server A comes back online, reverse replication from Server B to Server A.

To continue replication to Server C, on Server B, right-click the virtual machine in Hyper-V Manager and point to Resume Extended Replication.

noteNote
This action removes replication between Servers A and B. Server B becomes the primary server and Server C becomes the Replica server. Replication from Server B to Server C goes into the resynchronization state and replication continues automatically once resynchronization is complete. The virtual machine on Server A becomes orphaned.

To do this with Windows PowerShell, run the following cmdlets on Server B:

Complete-VMFailover –VMName <name> // to commit the failover
Resume-VMReplication –VMName <name> -Continue // to resume extended replication

At a later point, when all three servers are back online, you can restore each server to its original function by following these steps:

  1. Remove replication from all three servers with Hyper-V Manager or Windows PowerShell.

  2. Run the Enable Replication wizard on Server B, choosing Use an existing virtual machine on the Replica server as the initial copy.

  3. Perform a planned failover from Server B to Server A.

  4. Extend replication from Server B to Server C.

To reverse replication to Server A after the unplanned failover, on Server B, right-click the virtual machine in Hyper-V Manager and point to Reverse Replication. The extended replication relationship is removed; Server B becomes the primary server and Server A becomes the Replica server. The virtual machine on Server C is orphaned.

To do this with Windows PowerShell, on either Server A or Server B, run Set-VMReplication –VMName <name> -AsReplica. Then on Server B, run:

Set-VMReplication –VMName <name> -Reverse -ReplicaServerName <new_recovery_server_name> -ReplicaServerPort <Auth_port> -AuthenticationType <Certificate/Kerberos> -ReplicationFrequencySec <30/300/900> [--other optional parameters if needed--]

At a later point, when all three servers are back online, you can restore each server to its original function by following these steps:

  1. Remove replication from Server C with Hyper-V Manager or Windows PowerShell.

  2. Perform a planned failover from Server B to Server A; choose the Reverse Replication option in the wizard. At this point, Server A is the primary server and Server B is the Replica server.

  3. On Server B, run the Extend Replication wizard, choosing to Use an existing virtual machine on the Replica server as the initial copy.

If a failover has shifted the virtualized workload to the extended Replica server (Server C in these examples), it is now functioning as the primary server. If both Server A and Server B go down, complete the unplanned failover to Server C with Hyper-V Manager by right-clicking the virtual machine on Server C and pointing to Failover. In the dialog that opens, select a recovery point and click Fail Over.

Once failover is complete, you have three options for putting the other servers back into service:

Repurpose the Replica server (Server B, which previously replicated Server A) to be a Replica server replicating Server C:

In Hyper-V Manager, access Server C, right-click the virtual machine, and then point to Reverse Replication.

If a primary replication relationship is detected on Server B, you will receive an error. If this occurs, remove the replication relationship on B, and then repeat the reverse replication step from Server C.

When reverse replication from Server C is complete, Server C will be the primary server, Server B is the Replica server, and the virtual machine on Server A is orphaned.

  1. Perform a planned failover of the virtual machine from Server C to Server B.

  2. Remove replication on all three servers.

  3. Enable replication from Server B to Server A, choosing to Use an existing virtual machine on the Replica server as the initial copy

  4. Perform a planned failover from Server B to Server A, selecting the check box for enabling reverse replication.

  5. On Server B, run the Extend Replication wizard, to extend replication to Server C.

Repurpose the original primary server (Server A) to be a Replica server replicating Server C:

With Hyper-V Monitor, access Server A, right-click the virtual machine, and point to Remove Replication.

On Server B, run the Enable Replication wizard to set up replication to Server A, choosing to Use an existing virtual machine on the Replica server as the initial copy. If an orphaned virtual machine is still present on Server A, the wizard can use it as a data source to complete the initial replication.

  1. Perform a planned failover of the virtual machine from Server C to Server A.

  2. Remove replication on all three servers.

  3. Enable replication from Server A to Server B, choosing to Use an existing virtual machine on the Replica server as the initial copy

  4. Perform a planned failover from Server A to Server B, selecting the check box for enabling reverse replication.

  5. On Server B, run the Extend Replication wizard, to extend replication to Server C.

Use a new server (Server D) as the Replica server

Prepare a new server for Hyper-V and replication as described in Step 2: Enable Replication.

Access Server C and remove replication for the virtual machine.

Enable replication to Server D for the virtual machine.

You can move either primary or Replica virtual machines around to different servers either with quick migration or export/import, but in many cases resynchronization will be required.

You can remove extended replication with Hyper-V Manager by right-clicking the Replica virtual machine and then pointing to Replication. Point to Remove Replication and then select either Remove extended replication or Remove all replication. If you remove the replication relationship between the Replica and the extended Replica, changes in the virtual machine are no longer forwarded to the extended Replica, but the virtual machine on the extended Replica is not deleted.

noteNote
If you want to remove replication between the primary and the Replica, remove replication between the Replica and the extended Replica first.

With Windows PowerShell, use the Remove-VMReplication cmdlet with the parameter -ReplicationRelationshipType. Use the value Extended to remove extended replication or Simple to remove primary replication.

Examples:

To remove extended replication from the Replica server:

Remove-VMReplication –VMName <name> -ReplicationRelationshipType Extended

To remove primary replication from the Replica server:

Remove-VMReplication –VMName <name> -ReplicationRelationshipType Simple

To remove all replication (run from primary or extended Replica server):

Remove-VMReplication –VMName <name>

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft