Virtual Machine Stop Action in a Cluster
One of the interesting philosophical debates on the Hyper-V team is “What is the right thing to do when a user stops a clustered virtual machine?”. Some of us believe that if the user asked to stop the virtual machine – then we should stop the virtual machine (which is what we do by default). But others believe that if the virtual machine is clustered, it should be restarted automatically, in order to deliver the highest uptime (this is actually what we used to do in the first release of Hyper-V).
What most people do not realize is that this is actually something that you can configure. To do this you need to:
- Open the Failover Cluster Manager
- Go to Roles and select the virtual machine in question
- Change to the Resources tab at the bottom of the screen
- Select the Virtual Machine resource, right click on it, and select Properties
- Change to the Settings tab of the properties dialog
- Configure the Virtual machine stop action
- If you want the virtual machine to stay off if a user turns it off, select Take resource offline until virtual machine restarts.
- If you want the virtual machine to restart automatically select Mark resource as failed.
Note, no matter what setting you choose – stopping a virtual machine through the failover cluster manager will stop the virtual machine. This setting effects what happens when someone uses Hyper-V Manager or Hyper-V PowerShell to stop a virtual machine.
Cheers,
Ben
Comments
- Anonymous
January 02, 2015
Hi Ben, Thanks for this post. I was trying to clear up some confusion We have a 2 Node - Windows 2012 R2 Hyper-V Cluster with a load of 2012/2012 R2 Guest VM's running on it. All fine. In Hyper-V Manager on each node, the Automatic Stop Action for these servers (which are all on CSV storage of course) is to 'Shut down the guest VM' but what we want to ensure is if we shut down a node of our Hyper-V Cluster gracefully (for example to install more physical memory into it) we want the Guest VM's to fail over to the other Node and not actually shut down Looking at your post and TechNet the 'Mark resource as failed' will move it permanently to another node in the cluster regardless of the fact the Automatic Stop Action on the Guest VM is set to 'Shut down guest VM' Is this correct? There is no option in the Automatic Stop Action under Hyper-V Manager that seems to be aware its on a cluster so offers a different choice like 'Move to other node' :) Cheers Andy