IT Pro Windows Server 2012 Lab Part 5 - Enabling Hyper-V Replica
Now to the more exciting stuff! Hyper-V Replication enables virtual machines workloads on Windows Server 2012 to be consistently copied to a remote server in the event a site or hardware system should crash.
Tasks in this Lab Module
1) Enable Hyper-V Replication.
2) Configuring Hyper-V Replication.
3) Implement a planned failover.
4) Implement an unplanned failover.
5) Remove Replication (Optional)
You will need a virtual machine named WS2012VMServer3 that is joined to the domain as Server3 for this exercise.
1) Enable replication on WS2012VMHost1 and WS2012VMHost2
- Log on to one of the Hyper-V hosts as your Domain\Administrator account using the password Passw0rd!
- On the Taskbar, click Windows PowerShell.
To enable replication on host machines, type the following commands and press ENTER after each.
If the script below fails to run, type Set-ExecutionPolicy RemoteSigned and then re-run the script .
Invoke-Command -ComputerName WS2012VMHost1 -ScriptBlock {
Set-VMReplicationServer -ReplicationEnabled $True -ComputerName WS2012VMHost1 -AllowedAuthenticationType Kerberos -ReplicationAllowedFromAnyServer $True -DefaultStorageLocation C:\Replica
Enable-NetFirewallRule -Name VIRT-HVRHTTPL-IN-TCP-NOSCOPE
}
Invoke-Command -ComputerName WS2012VMHost2 -ScriptBlock {
Set-VMReplicationServer -ReplicationEnabled $True -ComputerName WS2012VMHost2 -AllowedAuthenticationType Kerberos -ReplicationAllowedFromAnyServer $True -DefaultStorageLocation C:\Replica
Enable-NetFirewallRule -Name VIRT-HVRHTTPL-IN-TCP-NOSCOPE
}
In Server Manager, click Tools, and then click Hyper-V Manager.
In the Actions pan, click Connect to Server, type WS2012VMHost1, and then click OK.
Click Hyper-V Manager.
Click Connect to Server, type WS2012VMHost2, and then click OK.
Click WS2012VMHost1, click WS2012VMServer3, and then click Start.
Wait for the VM to fully start.
2) Configure Hyper-V Replication.
- Switch to Windows PowerShell.
- Type Resolve-DNSName Server3, and then press ENTER. Note the IP address.
- Switch to Hyper-V Manager.
- Click WS2012VMhost1, and then click WS2012VMServer3.
- Select WS2012VmServer3, and then in Actions, click Enable Replication.
- In the Enable Replication for WS2012VMServer3 dialog box, click Next.
- In Replica Server, type WS2012VMHost2, and then click Next.
- Accept all defaults in the remaining screens, and then click Finish.
- Click Close.
- In Hyper-V Manager, click WS2012VMHost2.
- Click WS2012VMServer3.
- In the Actions plane, click Settings.
- Expand Network Adapter, and then click Failover TCP/IP.
- Under IPv4 TCP/IP settings, check Use the following IP Address scheme for the virtual machine.
- Enter the following values, and then click OK.
IPv4 Address: 192.168.10.31 (Assuming this is your IP Scheme for the secondary site)
Subnet Mask: 255.255.255.0
Preferred DNS: 192.168.10.1
3) Implement a Planned Failover
- In Hyper-V Manager, click WS2012VMhost1.
- Click WS2012VMServer3, and then in the Actions pane, click Shut Down.
- Click Shut Down. Wait for the VM to power off.
- Click WS2012VMServer3, in the Actions pane click Replication, and then click Planned Failover.
- Click Failover.
- When fail over completes, click Close.
4) Implement an Unplanned Failover
- In Hyper-V Manager, click WS2012VMHost2.
Note: WS2012VMServer3 was started automatically after failover.
- Click WS2012VMServer3, and then click Turn Off.
- In Hyper-V Manager, click WS2012VMhost1, and then click WS2012VMServer3.
- In the Actions pane, click Replication, and then click Planned Failover.
- Click Failover.
- Click Close.
- Wait for the replica VM to start.
- Open Windows PowerShell.
- Type Resolve-DNSName Server3, and then press ENTER. Note the IP address.
Optional! Remove Replication if so desired.
- Click WS2012VMServer3.
- In the Actions pane, click Replication, and then click Remove Replication.
- Click Remove Replication.
- Click WS2012VMHost2.
- Click WS2012VMServer3.
- In the Actions pane, click Delete.
More Information
Tommy’s Blog
Windows Server Blogs
https://blogs.technet.com/b/windowsserver /
Windows Server 2012 Product Download
Microsoft Virtual Academy
Windows Server 2012 Virtual Labs
https:// technet.microsoft.com/en-us/windowsserver/hh968267.aspx
Windows Azure 90-Day Free Trial Page