Step 3: Test the Replication Deployment
Published: May 31, 2012
Updated: May 31, 2012
Applies To: Windows Server 2012, Windows Server 2012 R2
This topic includes steps to verify the proper functioning of your Hyper-V Replica deployment, primarily by means of the test failover feature.
To ensure that the replicated virtual machines (and applications running within them) will function properly on the Replica server just as they do on the primary server, you can conduct a test failover at any time. When you conduct a test failover, a temporary virtual machine is created on the Replica server. You can test any applications in that test virtual machine without interrupting the ongoing replication. When you conclude the test, the temporary virtual machine is deleted.
|This test virtual machine will not by default be connected to any network. If you need to conduct tests that require a network, you can modify the settings of this test virtual machine in the same way you would modify settings of any ordinary virtual machine.|
|This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see Using Cmdlets.|
For a test failover to succeed, you must have enabled replication for at least one virtual machine and have completed the initial replication by any of the available methods. To verify failover with a recovery point other than the most recent one, replication must have been running long enough for at least one additional recovery point to have been created.
Access the Replica server, and in Hyper-V Manager, right-click the virtual machine you want to test failover for, point to Replication…, and then point to Test Failover….
Choose a recovery point to use. This creates and starts a virtual machine with the name “<virtual machine name>-Test” (for example, “CRMVM-Test”).
Conduct your tests on the test virtual machine. For example, you might verify that the virtual machine starts, pauses, and stops, and that any applications in the virtual machine run properly.
After you have concluded your testing, discard the test virtual machine by choosing Stop Test Failover under the Replication option.
Important Operations that move the test virtual machine, such as quick migration, are not supported and could result in the test virtual machine becoming orphaned.
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 conduct a test failover of a virtual machine named “CRMVM”.
$ReplicaVM1 = “CRMVM”
$TestReplicaVM1 = Start-VMFailover -AsTest -VMName $ReplicaVM1
To stop the test failover operation and discard the test virtual machine:
Stop-VMFailover –VMName $ReplicaVM1