24 Aug 2011 @ 8:36 AM 

One of our architects asked me to configure settings on some VDI virtual machines in our Hyper-V environment, specifically the “Automatic Start Action” and “Automatic Stop Action” setting. After some searching in SCVMM, I was unable to find a configuration on the template where I could set this.
So, I turned to PowerShell.

1) We want to set the “Automatic Stop Action” to “Power Off” in order to disable the Save State when a Hyper-V server reboots. Since this is a VDI environment, it is desirable to shut down the VM’s since when a host reboots, the VM’s will be provisioned with the latest vDisk instead of picking up where they left and therefor still using the “old” vDisk.
2) We want to set the “Automatic Start Action” to “None” in order to not let the virtual machines come online when the host is rebooted, for example because the Desktop Group could be set in maintenance mode within the time the Hyper-V server rebooted.

I actually found several scripts on the internet, but all of them a bit complicated and rather large… since I’m a guy of few lines, this is what I came up with:

$VMMServer = Get-VMMServer -Computername "scvmm"
Get-VM | Set-VM -StartAction NeverAutoTurnOnVM -StopAction TurnOffVM

Post to Twitter

Posted By: Jeff Wouters
Last Edit: 05 Sep 2011 @ 05:12 PM

EmailPermalinkComments (0)
Tags

Get Adobe Flash player
 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 164
  • Comments » 150
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

Contact



    No Child Pages.