VMware Cloud Community
jforney
Contributor
Contributor

How to schedule a one-time shutdown of ESX server?

I need to schedule a shutdown of 2 ESX 3.5 servers in the middle of the night. This is a job that only needs to run once, so I don't think cron is the right tool. Something like the AT command but I don't find that in ESX. Can anyone point me in the right direction?

Thanks

0 Kudos
9 Replies
AntonVZhbankov
Immortal
Immortal

PowerCLI and Windows scheduler, for example.


---

MCSA, MCTS Hyper-V, VCP 3/4, VMware vExpert

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
0 Kudos
jforney
Contributor
Contributor

I have a hard time to believe that this cannot be done from the ESX CLI.

" shutdown -h +600" should work to schedule a 3:00 am shutdown when I leave at 5:00 pm but I wonder if there is a more elegant way to do it.

0 Kudos
jkumhar75
Hot Shot
Hot Shot

The more elegant way to do is through the virtual center, you can schedule the task through virtual center and shutdown the ESX server.

Jay

VCP 310,VCP 410,MCSE

Consider awarding points for "helpful" and/or "correct" answers.

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful". Jayprakash VCP3,VCP4,MCSE 2003 http://kb.vmware.com/
0 Kudos
AntonVZhbankov
Immortal
Immortal

Do you have DRS enabled for these hosts? Are there any VMs running on them?

If not - why at 12:00?


---

MCSA, MCTS Hyper-V, VCP 3/4, VMware vExpert

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
0 Kudos
jforney
Contributor
Contributor

That was my first thought. But the only available options are:

- Change the power state of a virtual machine

- Clone a virtual machine

- Deploy a virtual machine

- Move a virtual machine with vMotion

- Relocate a virtual machine

- Create a virtual machine

- Make a snapshot of a virtual machine

- Add a host

- Export a virtual machine

- Import a machine

Nothing about shutting down a host

0 Kudos
jforney
Contributor
Contributor

The hosts are standalone, no HA or DRS. The guests have all been schedule to shut down from within their OS.

0 Kudos
jkumhar75
Hot Shot
Hot Shot

Then the other best option you have is " shutdown -h +600"use this command only.

Jay

VCP 310,VCP 410,MCSE

Consider awarding points for "helpful" and/or "correct" answers.

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful". Jayprakash VCP3,VCP4,MCSE 2003 http://kb.vmware.com/
AntonVZhbankov
Immortal
Immortal

You can shutdown all the guests and hosts with one PowerShell script actually.

Run this script against 3 ESX hosts you want to shutdown.

Get-VM | Where-Object {$_.PowerState -eq "PoweredOn" -and $_.Guest.State -eq "Running"} | Shutdown-VMGuest
Start-Sleep -Seconds 300
Get-VM | Where-Object {$_.PowerState -eq "PoweredOn"} | Stop-VM -RunAsync
Start-Sleep -Seconds 60
Get-VMHost | Stop-VMHost -RunAsync


---

MCSA, MCTS Hyper-V, VCP 3/4, VMware vExpert

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
jforney
Contributor
Contributor

Thanks, I am going have a look at the PowerShell option.

0 Kudos