Hyper-V: What will happen with my VMs when I restart Hyper-V host

Running virtualized environment is so convenient that at times you may even forget that hardware on which all your VMs are running or Hyper-V host may need to be restarted… At this point reasonable question to ask is “What will happen with my VMs during host restart?” If we set aside clustered high-available Hyper-V implementations what actually will happen is defined on a per VM basis in VM properties (for stand-alone Hyper-V servers not participating in Hyper-V cluster or managed by SCVMM). Options which define this behavior on a per VM basis called “Automatic Stop Actions” and “Automatic Start Actions” respectively.

By default your running VM will save state & start automatically after reboot if they were started before Hyper-V restart. See screenshot of corresponding VM Settings section below.

Hyper-V_Auto_Stop_Actions

As for other options you may configure in VM properties these are “Save the VM state (default)”, “Turn off the VM”, “Shut down the guest OS” (Automatic Stop Actions) and “Nothing”, “Automatically start if it was running when the service stopped”, “Always start this VM automatically” (Automatic Start Action). In Hyper-V v3 (part of Windows Server 2012) even more additional VM startup control options available to address “VM boot storms” and some other related issues (e.g. you may set startup memory allocation to be greater than memory allocated to VM when it up and running)…

As for logging you may find loads of Hyper-V related events under in Event Viewer > Applications and Services Logs > Microsoft > Windows. In particular when you shutdown your Hyper-V host event 14100 is recorded in Hyper-V-VMMS > Admin logs (“Shut down physical computer. Stopping/saving all virtual machines…”), and if you just Stopped VM Management Service via Stop button in Hyper-V management console then event 14090 is being registered in the same section (“Virtual Machine Management service is shutting down while some virtual machines begin running. All running virtual machines will remain running with no management access”).

And yes after you know that your second question naturally would be about conrolling VMs stop / start up order. There is no easy few click solution for this on stand-alone Hyper-V, but it’s doable. You may find one example of  ordered VMs startup solution by John Savill on windowsitpro.com, and I believe you may find more options for that.

Please follow and like us:
error0

7 thoughts on “Hyper-V: What will happen with my VMs when I restart Hyper-V host

  1. kashifdayo

    Nice and helpful post. Can please tell me that: what happens when VM is restarted and migrated from one physical host to another specially in IaaS cloud environment. Means when VM is migrated and restarted it boots on different host platform. On booting on different platform will its boot time components such bios, loaders etc be changed or remain same? Thanks

    Reply
  2. Mikhail

    Well Hyper-V provides you with level of abstraction which supposed to isolate you from real hardware by providing virtual hardware of different types. But in fact depending on virtual hardware type and migration scenario it might be required to have matching physical hardware configurations anyway. E.g. for the sake of performance VMs usually got more and more “direct” access to some hardware and this is obviously may require matching hardware on the hosts when you migrate VMs between them. For better understanding of virtual hardware and its types you may give a read to following article: http://www.altaro.com/hyper-v/hyper-v-virtual-hardware-emulated-synthetic-and-sr-iov/

    Reply
  3. Andrew Koransky

    Thanks for the helpful post. But you might want to update your included image URL to /wp-content/uploads/2013/01/hyper-v_auto_stop.jpg?w=300 which works, instead of the private network URL which doesn’t: //192.168.1.2/wordpress/wp-content/uploads/2013/01/hyper-v_auto_stop.jpg?w=300just a thought. 🙂

    Reply
    1. Mikhail Post author

      @Andrew, thanks for flagging this – fixed it now. What you noticed it just some remnants of my experiments with move from wordpress.com to my own server…

      Reply
  4. Deepak

    Nice articleMy one of VM’s in Hyper-V is in OFF state. Where I can get the log to find the reason/root cause of changed state?

    Reply
  5. T_mony

    Gentlemen

    TO be honest most of the time when this happens it could be caused by the Virtual Network. If you create a virtual network and then when creating a new VM select the newly created virtual network , then add the VHD file later, the VM will start to work. this might happen after you install new network drivers

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *