Hyper-V Replica is
one of the best features of Hyper-V so far. It is easy to set up,
reliable, and comes with everything you need to have a great disaster
recovery plan for your private cloud.
In case of a disaster, your servers or even the entire datacenter
will be protected if Hyper-V Replica is in place. However, you need to
ensure all your replica servers, virtual machines, logs, performance,
and replication are working properly to certify that your servers will
be up and running with the latest replication data in case of a failure.
This
recipe will show you all the components on Window Server 2012 to
provide the information, status, and reports you need to monitor Hyper-V
Replica health.
These steps are based on an existing Hyper-V Replica environment. Perform the following steps on the primary Hyper-V server.
This
recipe will show five options to monitor Hyper-V Replica: the
Replication Health column, the Replication tab, the Replication Health
window, Event Viewer, and Hyper-V Replica counters for Perfmon.
- To enable the Replication Health column, open Hyper-V Manager, click on View, and select Add/Remove Columns.
- In the Add/Remove Columns window, under Available Columns, select Replication Health, click on Add, and then click on OK. The column will be listed as shown in the following screenshot:
- To visualize the Replication tab, select a virtual machine in Hyper-V Manager and click on Replication at the bottom, as shown in the following screenshot:
- To view the replication health details, right-click on a virtual machine, select Replication, and click on View Replication Health. The VM's replication health will be shown as in the following screenshot:
- To verify the Event Viewer entries for Hyper-V Replica, open Event Viewer, expand Application and Services Logs | Microsoft | Windows | Hyper-V-VMMS, and click on Admin, as shown in the following screenshot:
- To monitor Hyper-V Replica counters, open Perfmon, expand Monitoring Tools, and click on Performance Monitor.
- In the Performance Monitor view, press the Ctrl + N keys.
- In the Add Counters window, scroll down and select Hyper-V Replica VM.
- To monitor all virtual machines, click on Add >>, as shown in the following screenshot:
Windows
Server 2012 comes with different methods to monitor Hyper-V Replica,
giving you all the necessary information you need to check its health.
The first and simplest one is the column Replication Health
in Hyper-V Manager. This is the quickest and easiest view you can use
to check if there is any problem with VM replication. Though it does not
provide advanced details, it helps to quickly identify whether
something is wrong.
Another easy way to check the replica status, but with more details, is the Replication tab, accessed from Hyper-V Manager as well. It shows the following information:
- Replication Type
- Replication State
- Replication Health
- Current Primary Server
- Current Replica Server
- Last synchronized at
To get a better replication health overview for Hyper-V, you can use the Replication Health window. It
works like a small report that can be exported into a CSV file, showing
replication details, statistics, and pending replication.
For advanced logs and data, an Event Viewer log named Admin under Hyper-V-VMMS shows all event entries for Hyper-V Replica. It is very helpful for advanced Hyper-V Replica troubleshooting.
The
last one, for real-time and logged monitoring, is the group of counters
in Perfmon to monitor everything about Hyper-V Replica and help you to
identify performance errors, create baselines, and get advanced
replication details when replication occurs.
From simple views to
advanced logs and counters, Windows helps you to achieve all required
info to make sure Hyper-V Replica is up and running.
Using PowerShell to monitor Hyper-V Replica
You can also use
simple commandlets from PowerShell to get replication details. The two
available commands to check this data are Get-VMReplication
and Measure-VMReplication
. The following screenshot shows the output for both commands: