Quantcast
Channel: VMware Communities : Discussion List - Automation Tools
Viewing all articles
Browse latest Browse all 9071

Suspend multiple VMGuests at once

$
0
0

Hello all,

 

I'm tasked with creating a script to invoke the suspension of over 50 VM's (all Win2012r2) in a very narrow timeframe (probably between 5-8 minutes) following a UPS event.hutfown

 

Suspend over shutdown is the preferred option, but as there's no -RunAsync switch for this, I'd be grateful for any advice anyone could offer as to how to achieve this.pped

 

I have this snippet  for the SQL boxes working fine, but the servers suspend in sequence, rather than simultaneously.

 

$vms = Get-VM

Foreach ($vm in $vms){

     if ((Get-View $vm).Name -match "SQL"){

               Write-Host $vm.Name, " => " , (Get-View $vm).Guest.GuestFullName

               Get-VM $vm | Suspend-VMGuest -Confirm: $false

     }

}

 

Many thanks,

 

Tim


Viewing all articles
Browse latest Browse all 9071


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>