In the lab during the week I came across a VM that was hanging intermittently. Being up the walls with other projects right now i decided to implement a script to check the VM intermittently and reset if it was hung until I get the chance to troubleshoot the issue. Added the following in a powershell script as a scheduled task in windows
# Load Windows PowerShell cmdlets for VMware
add-psSnapin VMWare* | out-null
# Connect To vCenter
Connect-VIServer -Server ServerName -User UserName -Pass Password | Out-Null
# Test Connection to the VM and reset if no response
$vm = Get-VM -Name VMName
if(!(Test-Connection -ComputerName VmHostName -Quiet))
{
Stop-VM -VM $vm -Confirm:$false -Kill
Start-VM -VM $vm
}
# Disconnect from vCenter
Disconnect-VIServer -Confirm:$False