Hello all, for a maintenance operation, I need to shutdown an ESXi (vSphere 4 - Standard) at 5h00 AM. I don't want to wake up at this time only to press one button . I would like to schedule this.
I have already scheduled VMs shutdown in the vSphere client. But I don't see how i can schedule ESX shutdown.
How can I do ?
Thanks.
Take a look at - Schedule Shutdown Esxi (v5) | something somewhere
Do we have a Powershell command to do that ?
PowerCLI can help you.
There is a cmdlet called "Stop-VMHost", which will down ESXi server(s). Add the list of ESXi servers with this cmdlet and save it as PS1 file. Refer Stop-VMHost - vSphere PowerCLI Cmdlets Reference for more parameters.
To add your script in schedule task, refer http://www.virtu-al.net/2009/07/10/running-a-powercli-scheduled-task/
Thanks for your answer. I have Schedule a PS1 script like this :
add-pssnapin VMware.VimAutomation.Core
Connect-VIServer -Server LocalHost
Stop-VMHost -VMHost MyESX.Local -Force -Confirm: $false
And it works great.
Good to know