Virtual Machine state not saved on host machine reboot

A common problem you may find under Virtual Server 2005 (including R2) is one which hit me over Christmas after rebuilding on of my Virtual Server hosts. An age old problem which I first encountered probably back in the early days of Exchange 2000 was that the default setting in the Windows Server registry doesn’t always allow enough time for services to shut down cleanly before they are forcibly terminated when a machine is shutting down. In Exchange, the effect can be corruption of the information store – obviously not nice. With Virtual Server, if you think about the default action on a service closure, it is to save the state of any virtual machines which are running. This takes time, especially if you have 5 or 6 VMs active on the host. After rebuilding my host over the break, I had forgotten to tweak the registry to allow plenty of time for Virtual Server to make sure all running VMs are saved, rather than finding them restarting cold on the host reboot.

The registry key is in HKLM\System\CurrentControlSet\Control, WaitToKillServiceTimeout. The default value is 20000, which is in milliseconds – in other words 20 seconds. I found a KB article I didn’t know of before here which describes how to change the value, and recommends 90000 if you want to save state, but 240000 if you choose to shut down guest OS’s. Obviously the value depends on the hardware capability you have available and the number of guests.

I’m over in Seattle all next week, so blogging may be a bit lighter than usual for a few days – not sure how much Internet connectivity I’ll have. Back 16th Jan.

Comments (2)

  1. Anonymous says:

    Here’s one more collection of links.  It took me quite a while, and I threw out 90% of the links…

  2. Rob Durkin says:

    Good tip, I think I’ll add those reg keys to our VS host. I have created a batch file with "NET STOP VIRTUAL SERVER" and run that before I shutdown, though it is easy to forget and not foolproof. And of course doesn’t work with any automated patching system.