Your basic ITPro blog... What's going on at work, what I'm interested in.

Wednesday, December 2, 2009

Oddity with Hyper-V and Virtual Machine Manager (VMM)

Every once in a while, one of my Hyper-V hosts will show up in VMM as needing attention. Specifically, the status will show “Needs Attention”, rather than OK. Attempting to refresh the host gives me an “Error (2912)” and/or an “Error (2927)”. In the past, I would attempt to fix this by restarting the WS-Management (WinRM) service. This would almost always result in the service hanging, stuck on ‘Stopping’. From there, my only solution has been a host reboot. Not exactly what I would like. Well, today, I found a solution that did not involve me shutting down ten VMs and rebooting my Hyper-V host box.

I got to the same point as in the past. But, while researching for a better solution, I ran across this blog post about killing a service hung on ‘stopping’.

After reading through it, I found the PID of my service and ran the ‘taskkill /PID xxxx /F’ command, using the PID of my WinRM service. (UPDATE: To get the PID, run ‘sc queryex WinRM’) It looked like it worked, because my RDP connection to the server instantly went dead. But, in a few seconds I got my RDP session back (not sure what happened there…)

I was then able to start WinRM and refresh my host in VMM.

Not exactly elegant, but I didn’t have to reboot my VM host… and that’s something!

3 comments:

Anonymous said...

This was very timely, and very helpful for me, as I had precisely this problem when I tried to upgrade my VMM agent on a clustered host...4 of the cluster servers upgraded fine, but #5 did precisely this, and your instructions allowed me to get the WinRM back into a running state so I could do a manual uninstall/reinstall of the agent directly on the host (instead of pushing it from the VMM console). Thanks!

Derek Mangrum said...

Glad to hear this helped.

Anonymous said...

The WinRM service runs under a svchost.exe process, which is what the PID relates to. If you kill this svchost.exe process, you'll not only kill the WinRM service but potentially other things too. Check in task manager and add in the PID column to see what's running under that particular svchost.exe process.

Additional Info

My photo
email: support (AT) mangrumtech (DOT) com
mobile: 480-270-4332