Hyper-V, Hyper-V v2, Scripting, Server 2008 R2, Virtualization
Leave a comment

Update – Detecting Hyper-V VM Heartbeat loss

In an earlier post, I have provided a script which can run in the background to detect heart beat loss of a virtual machine and then trigger a hard reset. In this post, I am making an update to the original script available. There is just a minor update to the logging mechanism. You can now choose to log all the success / fail events to Windows application event log instead of a text file. You can download the script update at the end of this post

To enable logging to Windows event log, run the script using

cscript.exe c:\scripts\VMHeartBeat.vbs /log:event

Anytime there is a VM heart beat failure or loss, an event log will appear under Application logs of the event viewer. It will look something like this

VM Hear beat event log

VM Hear beat event log

As you can see, these event logs carry WSH as the source. Hope this helps.

[Code]

[download id=”5″ format=”4″]

[/Code]

Filed under: Hyper-V, Hyper-V v2, Scripting, Server 2008 R2, Virtualization

by

Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.