Set Windows Server 2012 Hyper-V Virtual Machines

Set Windows Server 2012 Hyper-V Virtual Machines

Q: How can I quickly set my virtual machines (VMs) that aren't using my standard automatic start and stop actions in my Windows 2012 Hyper-V environment?

A: Each VM has three options for the automatic start and three options for the automatic stop actions.

Start - Nothing Never start the VM when the Hyper-V host starts
Start - Start Always start the VM when the Hyper-V host starts
Start - StartIfRunning Start the VM if it was running when the Hyper-V host was shutdown (this is the default)
Stop - Save Save the state of the VM if running when the Hyper-V host is shutdown (this is the default)
Stop - Shutdown Perform a clean shutdown of the VM if running when the Hyper-V host is shutdown
Stop - TurnOff Perform a hard turn off of the VM if running when the Hyper-V host is shutdown

The state of VMs can be viewed with the following PowerShell command in Windows Server 2012:

Get-VM | ft name,automaticstartaction,automaticstopaction

The AutomaticStopAction can only be changed while the VM is stopped but if you wanted all VMs to perform a clean shutdown and to never automatically start you could use the command below for those not currently using the default.

Get-VM | Where-Object {$_.AutomaticStartAction -eq "StartIfRunning"} |Set-VM -AutomaticStartAction Nothing -AutomaticStopAction ShutDown

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish