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
PowerCLI and Windows scheduler, for example.
---
MCSA, MCTS Hyper-V, VCP 3/4, VMware vExpert
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.
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.
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
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
The hosts are standalone, no HA or DRS. The guests have all been schedule to shut down from within their OS.
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.
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
Thanks, I am going have a look at the PowerShell option.