Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We just picked up a new development server that I've loaded ESXi on.

The room it's in is well ventilated during the day but at night the door is closed and it gets quite toasty in there. I've been asked to have the box shut down nightly, as we won't be using it anyways when we're not in the office.

Is there a way to do this?

share|improve this question
You can use a cron job to shut down the server, but how will you boot it again in the next day!? – Khaled Dec 23 '11 at 14:58
@Khaled: Some BIOS implementations can schedule automatic power-on. – pauska Dec 23 '11 at 15:04
@Khaled Manual booting would be fine. It's a lot easier to remember to turn it on (we can't do any work with it off) than it is to turn it off at the end of a long day! – ceejayoz Dec 23 '11 at 15:06
up vote 9 down vote accepted

I'd personally let the server run or move it to a better running environment. This may not be worth automating.

If you must shut down the entire host, please make sure that your VMs have the VMWare tools installed (to allow graceful shutdown and power up) and that they're set to stop and start with the host.

You can use the vCli and schedule a cron job to place the host in maintenance mode and/or shut down the host entirely. I would probably just manually run the host shutdown command from the GUI client at the end of the day, though.

share|improve this answer
Thanks for this. :-) – ceejayoz Dec 27 '11 at 1:41
Quick side question: I know home VM solutions like virtual box give the option to just save the machine state and boot to that state later. Would this be possible or better with ESXi? – TheLQ Dec 28 '11 at 19:48
Yep. You can pause/suspend VMs in vSphere/ESXi. In the context of this question, this could be scheduled as well. – ewwhite Dec 29 '11 at 2:02

vCli has already been mentioned and it is a best way to go in my opion.
However it seems you are dealing with a bigger problem , i.e overheating server room.This needs to be dealt with on a correct level.Fix HVAC asap or you will damage your equipment eventually.Read on

share|improve this answer
It's a single server in our back room. Landlord's not going to install AC there, and it's a perfectly fine temperature (server temp averages 26 degrees C, fans at minimum) with the door open. We just like to leave the room locked when we're all out of the office, but it gets warm in the winter as the thermostat is in another room. That article refers to 60, 100, 200 node server rooms. We've got one, and it can be turned off when the door is shut. All of our production servers are in a proper datacenter. – ceejayoz Dec 24 '11 at 17:37

Before auto shutdown you should look at the host power settings and adjust them acordingly. See powercycling (and also thermalcycling from what you say) will reduce the lifespan of the server

share|improve this answer

You can power it on by LAN. If you have such option in ESXi's BIOS (Usually Wake On LAN option). So you can add schedule in another machine to wake up your ESXi. And do not forget configure auto start your VMs when ESXi starting. Some times BIOSes have schedule option for power on machine.

You can use VMware Distributed Power Management (DPM) for power saving.

share|improve this answer
I'm looking to power off, not save money or wake up. – ceejayoz Dec 27 '11 at 1:41
Usually people like to automate all things. May be somebody will help you with shuting down your ESX. So you'll have complete solution. – BBK Dec 27 '11 at 9:12

You can enable ssh server on ESXi and copy your ssh key to the server, read the following on how to do that: Monitor LSI 3ware raid controller on ESXi

Then to shutdown the virtual machines and power off the ESXi server I would schedule a cronjob on a remote physical server:

20 9    12 22 * root    ssh /sbin/
30 9    12 22 * root    ssh /sbin/poweroff

In this case shutdown the virtual machines at Dec. 22, 9:20 AM and power down the ESXi server at Dec. 22, 9:30 AM.

The /sbin/ file is a script that cleanly shuts down the virtual machines and it comes with the ESXi instance. The poweroff command is just "busybox poweroff".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.