Good to hear! I copied my shutdown script to a newly created directory named SCRIPTS, then it is executed with ./PowerOff. Use with caution, because when launched there is no confirmation if this is what you want to do. It will immediately start shutting VM's off, the way it does that is it will attempt a graceful shutdown of all running VM's, if unsuccessfull it will then perform a hard poweroff. Basically it will pull the plug on the VM, after all VM's have been powered off it will issue a "shutdown -h now" to the host. You can modify this script with "vi" to reboot your esx hosts as well, just edit the line near the bottom that reads "shutdown -h now" to read either "reboot" or "shutdown -r now".
Here is a link for some help creating cron jobs -->
Hope this helps!
Thanks for that. It sounds like a plan.
Our datacentre needs to power cycle their systems so I want to shut it all down gracefully before hand. I'd thought of scheduling each VM to shutdown automatically, then login and shutdown the host manually, but this may help.
However, i've little experience of Linux, and so not sure how to get your script to a runable state. I've copied it to the host, but not sure what to do with it then.
Good to hear! I copied my shutdown script to a newly created directory named SCRIPTS, then it is executed with ./PowerOff. Use with caution, because when launched there is no confirmation if this is what you want to do. It will immediately start shutting VM's off, the way it does that is it will attempt a graceful shutdown of all running VM's, if unsuccessfull it will then perform a hard poweroff. Basically it will pull the plug on the VM, after all VM's have been powered off it will issue a "shutdown -h now" to the host. You can modify this script with "vi" to reboot your esx hosts as well, just edit the line near the bottom that reads "shutdown -h now" to read either "reboot" or "shutdown -r now".
Here is a link for some help creating cron jobs -->
Hope this helps!
Thanks. I've got the script in a folder, so will take the easy route and RDP to my PC at work , then PTY to the ESX machine and run the script. All the VM's should shut down gracefully as they're all Windows Servers with VM tools installed. All but one, which is a linux machine, so i've no idea how that will shutdown (with a thud i'd expect). :smileylaugh:
At some point i'll take a look at CRON and have a play on our test esx server and figure it out.
Thanks again. :smileycool:
spoke too soon. I PTY'd to my test server, logged in, su'd to root, then ran ./PowerOff and got
-bash: ./PowerOff: Permission denied
I guess i'm missing something, just need to figure out what.
just to answer my own question. "chmod +x PowerOff" seemed to sort that message.