Hi. I'm running Hyper-V on Windows Server 2012. I have a guest VM that I can shut down gracefully via the Hyper-V Manager (right-click on VM and select "Shut Down").
I can also shut this VM down gracefully via PowerShell using the older WMI method that is documented here:
http://blogs.msdn.com/b/virtual_pc_guy/archive/2008/01/30/shutting-down-a-hyper-v-virtual-machine.aspx
However, when I shut it down via PowerShell using the nifty, new Stop-VM command, I get the following error:
- Confirm
- Hyper-V cannot shut down virtual machine ChiefCollig because the Shutdown integration service is unavailable. To avoid potential data loss, you can pause or save the state of the virtual machine. The other option is to turn off the virtual machine,
but data loss might occur.
If I select "Y", the VM is crashed as if I turned off the virtual power switch.
If I query the integration services of the VM using the Get-VMIntegrationService command, here's the result.
VMName Name Enabled PrimaryStatusDescription SecondaryStatusDescription
------ ----
------- ------------------------ --------------------------
ChiefCollig Time Synchronization True OK
ChiefCollig Heartbeat True OK
ChiefCollig Key-Value Pair Exchange True OK
The protocol version of the component installed...
ChiefCollig Shutdown True OK
ChiefCollig VSS True
No Contact
"Hey, Van. It appears that the Hyper-V integration services have been installed on the VM, but why isn't the VSS component in contact with the host?"
OK, full disclosure time! I suspect that the VSS component is out of contact because the guest OS is some flavor of Linux, although I'm not sure which flavor. The VM is actually a Sophos UTM virtual appliance that I installed from scratch into
the Guest. The installation process sensed that it was a Hyper-V environment and it installed appropriate drivers. It also appears that Hyper-V Integration Services was installed as part of this process.
All of this said, the integration services shutdown component is in contact with the host. Isn't this enough for a graceful shutdown?
"Hey, Van. How do you know that Stop-VM crashes the VM while the Hyper-V Manager and the WMI methods gracefully shut it down?"
That's a great question. I monitor the console the VM to make the determination.
When I use Stop-VM, the VM is powered off within a couple of seconds. And when I turn it back on, it complains about recovering from a unscheduled shutdown.
When I use Hyper-V Manager or WMI via PowerShell, the VM takes a minute or so to shutdown, and the console shows all of the various services and components being stopped during the shutdown process.
So in summary, 2012 Hyper-V is able to shutdown the VM gracefully from the Hyper-V Manager Console and also from PowerShell via the WMI method. Hyper is NOT able to shut the VM down gracefully via the new PowerShell Stop-VM command.
Does anyone have any theories or suggestions?
See Ya!
Van
Venice, FL, USA