configuring hyper-v
TRANSCRIPT
-
8/11/2019 Configuring Hyper-v
1/59
Configuring Hyper-V Replica in Windows Server 2012 R2
Hyper-V Replica is a new feature added to the Hyper-V Role in Windows Server 2012
Standard / Data Center and Hyper-V Server 2012. It uses an asynchronous data
replication technology for organizations to implement an affordable Business Continuity
and Disaster Recovery (BCDR) solution for virtualized workloads. This allows virtual
machines running at a Primary Site to be efficiently replicated to Secondary Site (Replica
Site) across a LAN/WAN link without relying on software or hardware technologies
outside of the Windows Server 2012 Operating system. In Windows Server 2012 R2,
Microsoft has enhanced Hyper-V Replica features like Extended Replication and
configurable Hyper-V Replica frequency options. In Windows Server 2012 R2 Hyper-V,
we can configure VM to replicate from Primary Site A to Secondary (Replica) Site B and
then further replicate from Secondary Site B to Extended Replica Site C as shown in the
figure. In Windows Server 2012 (not R2), Hyper-V Replica provided a fixed replication
interval of 5 minutes. In Windows Server 2012 R2 it has been enhanced and as such we
can configure the replication interval from the old default of 5 minutes to every 30seconds, 5 minutes or 15 minutes as per the environment, criticality of operations and the
available bandwidth.
Management of Adding Hyper-V Host in Hyper-V Manager
1. On KTM-HOST1, In the Hyper-V Manager console, Right-Click on Hyper-V Manager,
select Connect to Server
-
8/11/2019 Configuring Hyper-v
2/59
2. On Select Computerdialog box, selectAnother computerand type KTM-HOST2 and
click OK, where KTM-HOST2 is Hyper-V Server. Do the same process to Hyper-V Server,
KTM-HOST3.
Configuring a Standalone Hyper-V Replica Servers
1. In the Hyper-V Managerinterface, Right Clickon KTM-HOST1, select Hyper-V
Settings
-
8/11/2019 Configuring Hyper-v
3/59
2. In the Hyper-V Settingsfor KTM-HOST1 dialog box, Click on Replication
Configuration. In the Replication Pane, select Enable this computer as a Replica server.
In the Authentication and portssection, select Use Kerberos (HTTP).
-
8/11/2019 Configuring Hyper-v
4/59
3. In the Authorization and storagesection, select Allow replication from the specified
serversand Click Add.
-
8/11/2019 Configuring Hyper-v
5/59
4. On the Add Authorization Entrydialog box, in the Specify the primary server:
*.msservpro.comand then click Browseand select D:\Hyper-V Replica\ folder. In the
Specify the trust group: type KIRTIPUR Replica Groupand click OK.
-
8/11/2019 Configuring Hyper-v
6/59
5. On the Hyper-V Settings for KTM-HOST1dialog box, click Applyand then click OK.
-
8/11/2019 Configuring Hyper-v
7/59
6. In the SettingsWindow, read the messageand click OKand click OK.
-
8/11/2019 Configuring Hyper-v
8/59
7. Do the same process on KTM-HOST2 and KTM-HOST3. On KTM-HOST2, In the Add
Authorization Entry dialog box, in the Specify the primary server; KTM-
HOST1.msserverpro.comand then click Browseand select C:\Hyper-V Replica\ folder. Inthe Specify the trust group must be same as previous. On KTM-HOST3, In the Add
Authorization Entrydialog box, Specify the primary server; KTM-
HOST2.msserverpro.comand then click Browseand select D:\Hyper-V Replica\folder. In
the Specify the trust group must be same as previous.
-
8/11/2019 Configuring Hyper-v
9/59
Enabling the Windows Firewall Rule to Enable Replication between the Primary,
Replica and Extended Replica Server
1. On KTM-HOST1, Open Windows Firewall with Advance Security, Open Runbox, and
type wf.mscand click OK.
2. OnWindows Firewall with Advanced Securitypage, click on Inbound Rulesunder
Windows Firewall with Advanced Security on Local Computer.
-
8/11/2019 Configuring Hyper-v
10/59
3. In Inbound Rules, Right-Click on Hyper-V Replica HTTP Listener (TCP-In)and click
Enable Rule. Do the same process on KTM-HOST2 and KTM-HOST3. If Certificate
based authentication is used, we should Enable Rule Hyper-V Replica HTTPS Listener
(TCP-In).
-
8/11/2019 Configuring Hyper-v
11/59
Enable Replication for a virtual machine on KTM-HOST1
1. On KTM-HOST1, Open the Hyper-V Manageconsole, in theDetails pane, Right-Click
the selected virtual machine, KTM-SQL-DB1, and choose Enable Replication.. This startsthe Enable Replication wizard.
2. On the Before You Beginpage, click Next.
-
8/11/2019 Configuring Hyper-v
12/59
3. On the Specify Replica Serverpage, in the Replica Serverbox, enter either the NetBIOS
or the Fully-Qualified Domain Name (FQDN)for the Replica server, KTM-HOST2and
click Next.
-
8/11/2019 Configuring Hyper-v
13/59
4. On the Specify Connection Parameterspage, click Next.
-
8/11/2019 Configuring Hyper-v
14/59
5. On the Choose Replication VHDspage, click Next.
-
8/11/2019 Configuring Hyper-v
15/59
6. On the Configure Replication Frequencypage, select 30 secondsand click Next.
-
8/11/2019 Configuring Hyper-v
16/59
7. On the Configure Additional Recover Pointspage, select Create additional hourly
recovery pointsand click Next.
-
8/11/2019 Configuring Hyper-v
17/59
8. On the Choose Initial Replication Methodpage, click Next.
-
8/11/2019 Configuring Hyper-v
18/59
9. On the Completing the Enable Replication wizardpage, review the information in the
summary and then click Finish.
-
8/11/2019 Configuring Hyper-v
19/59
10. TheEnabling Replicationprocess will start and should complete successfully (i.e. a
virtual machine is created on the Replica Server and delta replication commences).After
Finish the Replica between Primary HOST, KTM-HOST1and Secondary Host, KTM-
HOST2and then start for Extended Replication from KTM-HOST2.
-
8/11/2019 Configuring Hyper-v
20/59
Enabled Extended Replication from the Replica Server to Extended Replica Server
(KTM-HOST2 to KTM-HOST3)
11. In the Hyper-V Manager interface, click KTM-HOST2and Right clickon Replicatedvirtual machine, KTM-SQL-DB1, click Replication and then select Extend Replication
12. On the Before You Beginpage, click Next.
-
8/11/2019 Configuring Hyper-v
21/59
13. On the Specify Replica Serverpage, type KTM-HOST3in Replica serverand click
Next.
-
8/11/2019 Configuring Hyper-v
22/59
14. On the Specify Connection Parameterspage, click Next.
-
8/11/2019 Configuring Hyper-v
23/59
15. On the Configure Replication Frequencypage, select 5 minutesand click Next.
-
8/11/2019 Configuring Hyper-v
24/59
16. On the Configure Additional Recovery Pointspage, click Next.
-
8/11/2019 Configuring Hyper-v
25/59
17. On the Choose Initial Replication Methodpage, click Next.
-
8/11/2019 Configuring Hyper-v
26/59
18. On the Completing the Extend Replication wizardpage, click Finish.
-
8/11/2019 Configuring Hyper-v
27/59
19. Extended Replicating.. Begins..
-
8/11/2019 Configuring Hyper-v
28/59
-
8/11/2019 Configuring Hyper-v
29/59
View Replication Heath of Virtual Machine, KTM-SQL-DB1
1. Replication Heath between KTM-HOST1 and KTM-HOST2.
-
8/11/2019 Configuring Hyper-v
30/59
-
8/11/2019 Configuring Hyper-v
31/59
-
8/11/2019 Configuring Hyper-v
32/59
2. Replication Health between KTM-HOST2 and KTM-HOST3.
-
8/11/2019 Configuring Hyper-v
33/59
-
8/11/2019 Configuring Hyper-v
34/59
-
8/11/2019 Configuring Hyper-v
35/59
Test Failover:
To verify the consistency of replication across the sites, test Failover feature is available
which initiates on demand by the Hyper-V Administrator. It creates a temporary virtual
machine which is a replica of the original and checks its consistency and usability without
interrupting the production workload running on the Primary Site. During testing of
failover, there is no need to shut down the VM in production site and also the temporary
machine created is stopped on its own without further intervention, along with the option
to delete the test remnants. The purpose of this test failover is to check the VMs
replication status in Replica and Extended Replica Site. The network configuration for
the Test Failover virtual machine is disconnected by default so as not to interfere with the
production workload as noted above.
-
8/11/2019 Configuring Hyper-v
36/59
1. Log on to Primary Site, KTM-HOST1, Open Hyper-V Managerconsole and
ConnectKTM-SQL-DB1 and then Create the Test document named Hyper-v Test
Failover on the desktop and type This is test of Hyper-V Test Failover and saved it.
2. In Hyper-V Manager console, In the details pane, select the virtual machine on theReplica Server, KTM-HOST2,and Right-click on replica virtual machine (KTM-SQL-
DB1),select Replicationand choose Test Failover
-
8/11/2019 Configuring Hyper-v
37/59
3. On Test Failoverdialog box, select a recovery point, and then click Test Failover.
-
8/11/2019 Configuring Hyper-v
38/59
4. The New copy of the VM createdin Hyper-V Manager in the Off Stateand then Right
clickon just created virtual machine, KTM-SQL-DB1-Test and click Connect
-
8/11/2019 Configuring Hyper-v
39/59
5. On the KTM-SQL-DB1-Test on KTM-HOST2 Virtual Machine Connection, click
Start button.
-
8/11/2019 Configuring Hyper-v
40/59
6. Verify that Hyper-V Test Failover document on the desktop.
7. After verify this, In the details pane, select the virtual machine begin tested. Right-click on
the virtual machine,KTM-SQL-DB1, select Replication and then choose Stop Test
Failoverto Stop the Test Failover.
-
8/11/2019 Configuring Hyper-v
41/59
8. On the Stop Test Failoverdialog box, Click Stop Test Failoverand then it automatically
removed from Hyper-V Manager as the test is completed.We can do the same process on
Extended Replica server, KTM-HOST3.
-
8/11/2019 Configuring Hyper-v
42/59
Planned Failover and Failback:
Planned Failover initiates a failover of a virtual machine from a Primary Site to Replica
Site. When planned failover is executed, replication option at the primary site virtual
machine must be turned off. Once the Replica Site virtual machine is operational, the
direction of the replication should be reversed so as to send the traffic from Replica Site
(which is now our primary site) to the original primary site which has been turned off
now for the purpose of planned failover. For Planned test Failover, if the Reverse
replication direction after failover is ticked, we must disabled Extended replication on
Replica Virtual Machine or Remove Extended replication on Replica virtual machine.
However, if the Reverse replication direction after failover is not ticked, the process will
run without errors but it will not be possible to failback to primary. So, test must be
carefully planned. Please follow the steps given below carefully.
1.To perform a planned failover, first we must Shut down the Primary VM (KTM-SQL-
DB1) from Primary Server, KTM-HOST1.
-
8/11/2019 Configuring Hyper-v
43/59
-
8/11/2019 Configuring Hyper-v
44/59
2. On KTM-HOST1, In the Hyper-V Manager, In the details pane, select the virtual
machineand Right Click on KTM-SQL-DB1, select Replicationand then Choose Planned
Failover..
3. On Planned Failoverdialog box, make sure select Reverse the replication direction
after failoverand Start the Replica virtual machine after failoverand Click on Fail Over.
-
8/11/2019 Configuring Hyper-v
45/59
4. On Planned Failoverdialog box, we get error message The virtual machine is not
prepared for planned failover. Click Closeand Click Cancel.
-
8/11/2019 Configuring Hyper-v
46/59
5. In Hyper-V Manager console, Click KTM-HOST2and Right-Click on KTM-SQL-DB1,
select Replicationand then Choose to Remove Replication.
6. On the RemoveReplicationdialog box, select Remove extended replicationand then
Choose to Remove Replication.
7. Repeat the process from Step 1 to 3.Then Planned Failover process begins. After few
minutes Planned Failover completed successfullydialog box, click Close.
-
8/11/2019 Configuring Hyper-v
47/59
8. In Hyper-V Manager interface, Click KTM-HOST2and make sure KTM-SQL-DB1 VM
is Running.. State.
9. In Hyper-V Manager interface, click KTM-HOST1and make sure that VM (KTM-SQL-
DB1)is Off State.
-
8/11/2019 Configuring Hyper-v
48/59
10. After successfully Testing the Planned Failover VM (KTM-SQL-DB1)on KTM-
HOST2, Shut Down..virtual machine to reverse back to Primary HostKTM-HOST1.
11. On the Shut Down Machinedialog box, click Shut Down..
-
8/11/2019 Configuring Hyper-v
49/59
12. In Hyper-V Manager interface, Click KTM-HOST2, Right-Click on KTM-SQL-DB1,
Click Replicationand then click Planned Failover..
13. On the Planned Failoverdialog box, select Reverse the replication direction after
failoverand Start the Replica virtual machine after failoverand then click Fail Over.
-
8/11/2019 Configuring Hyper-v
50/59
14. Planned Failover begins..
15. On the Planned Failover completed successfullydialog box, click Close.
-
8/11/2019 Configuring Hyper-v
51/59
16. In Hyper-V Manager interface, click KTM-HOST1and make sure VM (KTM-SQL-
DB1) is Running Stateand then check View Replication Health..
-
8/11/2019 Configuring Hyper-v
52/59
17. In Hyper-V Manager interface, Click KTM-HOST2and make sure VM (KTM-SQL-
DB1) is Off Stateand then check View Replication Health..
-
8/11/2019 Configuring Hyper-v
53/59
-
8/11/2019 Configuring Hyper-v
54/59
Unplanned Failover:
Unplanned Failover initiates a failover when the Primary Site virtual machine fails
unexpectedly and cannot be brought back online. An unplanned failover is initiated at
the replica site. (It is the test closest to the real case scenario).
1. To perform an unplanned failover, the Primary Site must be offline state. Here, we
will shut downthe Primary Site Hyper-V Server, KTM-HOST1.
-
8/11/2019 Configuring Hyper-v
55/59
2. Go to the Replica Server, KTM-HOST2. In Hyper-V Manager interface, Right-Click
the Replica virtual machine (KTM-SQL-DB1), Click Replicationand then Click
Failover..
-
8/11/2019 Configuring Hyper-v
56/59
3.On the Failover dialog box, choose the recovery point to useand then Click Failover.
The virtual machine is then started on the Replica Server.
4. After the Replica virtual machine is started, the replication between Primary and
Secondary is broken and replication problems.
-
8/11/2019 Configuring Hyper-v
57/59
-
8/11/2019 Configuring Hyper-v
58/59
-
8/11/2019 Configuring Hyper-v
59/59
Summary:
Hyper-V Replica is a host-based virtual machine asynchronous replication solution from
Microsoft without extra licensing cost. In Windows Server 2012 R2 Hyper-V, Microsoft
has enhanced Extended Replication features and configurable Hyper-V Replica
frequency options. Microsoft has provided a highly dependable, immediately restorable
and alternatively highly configurable disaster recovery solution for the high availability
production systems for businesses of all size. Hope this article will get you started with