VMware Cloud Community
dCourtel
Contributor
Contributor

Schedule ESX shutdown

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 Smiley Wink. 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.

0 Kudos
5 Replies
GaneshNetworks

Take a look at - Schedule Shutdown Esxi (v5) | something somewhere

~GaneshNetworks™~ If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
dCourtel
Contributor
Contributor

Do we have a Powershell command to do that ?

0 Kudos
GaneshNetworks

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/

~GaneshNetworks™~ If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
dCourtel
Contributor
Contributor


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.

0 Kudos
GaneshNetworks

Good to know Smiley Happy

~GaneshNetworks™~ If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos