How to monitor Hyper-V replications with NetCrunch
Learn how to track replication performance and status' changes to detect issues resulting from connectivity problems, server failures, or other events.
Hyper-V Replica is commonly used for Disaster Recovery and migrating VMs from one data center to another. A replica of the virtual machine is a complete, ready-to-run copy of the source virtual machine. You should not use it as a replacement for backup, clustering, or automated failover though.
Monitoring Performance Counters related to replication on Hyper-V clusters
In NetCrunch, it is possible to monitor Performance Counters on your Hyper-V Source Server and Hyper-V Replica Server machines. These counters concern, inter alia, Last Replication Size, Network Bytes Sent/Received, Replication Latency, and others. To do this:
- Open Node Settings of your Hyper-V Source Server machine
- Navigate to Windows Section
- Click on Hyper-V tile
- Click on Add Alert button
- Select
New Event for Hyper-V Server Performance Counter
- Click on
- From the
Performance Object
field, please selectHyper-V.Replica VM
- In
Counters
andInstances
fields select the interesting instance - Set threshold condition
- Save all settings
At this moment, your counter will be monitored. If a threshold will be reached, an alert will be generated. If you want, you can monitor more parameters. You do this by adding more Alerts or Data Collectors.
You can repeat the same steps for the Hyper-V Replica Server machine.
Monitoring replication statuses on Hyper-V clusters
In addition to monitoring performance counters, it can be useful to monitor replication statuses. First, we need to consider what statuses will be of interest to us. On the Microsoft website, we can find information on what do the numerical values of ReplicationState mean:
- 0: Not enabled
- 1: Pending Initial Replication
- 2: Pending Initial Replication
- 3: Replication Enabled
- 4: Prepared for planned failover
- 5: Failover Complete
- 6: Failover Complete
- 7: Replication Paused
- 8: Replication Error
- 9: Resynchronization required
- 10: Resynchronizing
- 11: Resynchronize Suspended
The most interesting status from the monitoring point of view is of course 8: Replication Error
. We will now show you how to use this knowledge in NetCrunch:
- Open Node Settings of your Hyper-V Source Server or Replica Server machine
- Navigate to the Monitoring Sensors section
- Click on Add Monitoring Sensor button
- Find
WMI Object
sensor - In
Namespace
field selectroot\virtualization\v2
- In
WMI Class
selectMsvm_ComputerSystem
(or e.g.Msvm_ReplicationService
) - In
Instance Key
selectElementName
- In
Instance
select your instance (Hyper-V host) - Click on Add Alert button
- Select
New Event for Monitoring Sensor Counter
- Click on
- From the
Performance Object
field please selectWMI Object.Msvm_ComputerSystem
- In
Counters
selectReplicationState
, then selectInstance
- Change Trigger type to
Flat Value
- Change condition, we previously determined that the value of 8 is the one we are interested in, so we set the value to
8
for last1 minutes
- Save all settings
From now on, alerts will be generated when the Replication Status is 8, which is when a Replication Error occurs. If needed, you can also monitor other statuses/counters from this WMI Class - by selecting them in point 13. It is also possible to monitor statuses/counters from other WMI Classes related to replication - in point 6 you can enter the word replication
in the search field and try to find other information that is useful to you.
Monitoring replication statuses on Hyper-V virtual machines
Monitoring replication statuses on Hyper-V virtual machines is configured analogously to those on Hyper-V Clusters. You should select virtual machine instead of Hyper-V host in step 8. In Step 6 you can select also e.g. Msvm_ReplicationRelationship
.