Windows Server 2012 Hyper-V: VM Monitoring
In Windows Server 2012 Failover Clustering Microsoft offers a new feature called Hyper-V VM Monitoring. This feature allows you to monitor the health of applications running inside the guest operating system of a Hyper-V Virtual Machine. Now how does this exactly work and what is happening in case a service is failing.
When a monitored service fails the Recovery features of the service will take action.
In this case for the first failure the service will be restarted by the Service Control Manager inside the guest operating system, if the service fails for a second time the service will again be restarted via guest operating system. In case of a third failure the Service Control Manager will take no action and the Cluster service running on the Hyper-V host will takeover recovery actions.
The Cluster Service monitors the service thought periodic health checks, when the Cluster Service recognizes a failed service he will change the status of the Virtual Machine to unhealthy. This will trigger some recovery actions.
- A Event log entry with Event ID 1250 will be created on the host Event log. This event can be monitored by Monitoring software like System Center Operations Manager or other tools. This will also allow to run other action or trigger System Center Orchestrator Runbooks.
- The Virtual Machine State will be changed to “Application in VM Critical”
- And the Virtual Machine will be restarted on the same node if the service fails again the Virtual Machine will be restarted and failed over to another node in the cluster.
Of course you can configure the Recovery Settings in the Cluster.
How to setup Hyper-V VM Monitoring in the Failover Cluster Manager
Before you can setup VM Monitoring on the Failover Cluster Manager you have to check for some pre-requisites.
- The Hyper-V Host operating system must be Windows Server 2012 or Microsoft Hyper-V Server 2012
- The guest operating system inside the Virtual Machine must be Windows Server 2012 (for Application Monitoring) for VM heartbeat the Windows Server 2012 Hyper-V integration services need to be installed on the guest operating system.
- The VM Guest operating system needs to be in the same or a trusted domain as the Hyper-V host
- The administrator of the Hyper-V Cluster needs to have local administrator rights on the VM guest.
- The VM guest firewall needs to allow Virtual Machine Monitoring.
You can configure the Firewall inside the guest via GUI
or via Windows PowerShell
Set-NetFirewallRule -DisplayGroup "Virtual Machine Monitoring" -Enabled True
The configuration of VM Monitoring is very simple. Open the Failover Cluster Manager and right click on the Virtual Machine you want to configure monitoring, select “More Actions” and click on “Configure Monitoring…”.
After that you will see a list of the services running inside of the Virtual Machine and you can now select the service which should be monitored by the Cluster service.
The Virtual Machine Monitoring can also be enabled via Windows PowerShell.
Add-ClusterVMMonitoredItem –VirtualMachine TestVM01 -Service spooler
Important: Another great thing about VM Monitoring in Windows Server 2012 it the possibility that this feature can be extended by third party vendors.
You can find more information about VM Monitoring in Windows Server 2012 on the following sites:
- TechEd North America 2012 Session by Steven Ekren – Guest Clustering and VM Monitoring in Windows Server 2012
- MSDN Blog Clustering and High-Availability How to configure VM Monitoring in Windows Server 2012 by Subhasish Bhattacharya