VMware Cloud Community
MartinT80
Contributor
Contributor
Jump to solution

Failed Controlled Shutdown on ESXi 4.1 U1

We have a 3 Server HA cluster running ESXi 4.1 U1 patched to 433742 with the HP ESXi 4.1 bundle 1.1 and the HP NMI souring Driver installed on all.

Upon triggering our UPS to initiate a shutdown, all 3 ESXi servers killed all VM's without gracefully shutting them down.  The 3 ESXi hosts appeared to then gracefully shut themselves down.

With the power restored, all VM's started at once.

We use a 5000 VA APC UPS with the network managament card installed and PCNS 3.0.0 on the vMA.

To configure the shutdown, I followed the instructions on APC's website here http://nam-en.apc.com/app/answers/detail/a_id/11398/kw/powerchute%203.0%20esx/session/L3RpbWUvMTMxMT...

All 3 ESXi hosts have start and stop virtual machines with the system enabled with the default shutdown delay set to 30 seconds and the shutdown action set to guest shutdown.  All VM's are set to manual startup as per VMware best practice.

The default HA cluster settings have a VM restart priority of low.  Most VM's are set to use cluster setting for the VM restart priority, however we have our servers that have other servers dependant on them set to medium and our DC's and vMA set to high.

Any ideas where i've gone wrong?

0 Kudos
1 Solution

Accepted Solutions
mwpreston
Hot Shot
Hot Shot
Jump to solution

Not sure if this helps or not...I've never really had success in using the vMA to shutdown our guests....  I've resorted to writing a powershell script that runs from a Windows VM with the APC network shutdown software installed.  I've uploaded on my blog http://blog.mwpreston.net/2011/10/19/powercli-to-shutdown-vm/  Feel free to change and use this however you want....if this is the route you want to go...it's similar to the vMA solution, just using powershell instead of the sdk and a windows guest instead of the vMA.

View solution in original post

0 Kudos
2 Replies
mwpreston
Hot Shot
Hot Shot
Jump to solution

Not sure if this helps or not...I've never really had success in using the vMA to shutdown our guests....  I've resorted to writing a powershell script that runs from a Windows VM with the APC network shutdown software installed.  I've uploaded on my blog http://blog.mwpreston.net/2011/10/19/powercli-to-shutdown-vm/  Feel free to change and use this however you want....if this is the route you want to go...it's similar to the vMA solution, just using powershell instead of the sdk and a windows guest instead of the vMA.

0 Kudos
MartinT80
Contributor
Contributor
Jump to solution

Many thanks for your helpful post.  I will investigate using your script later do to its flexibility, however for now I have found the root cause of my problem.

By default, when a guest OS is told to "guest shutdown" by the ESXi host from a vMA command, nothing happens!

If you right click the server in the Vsphere client and tell it to shut down, it will gracefully shut the server down however.

As per http://simongreaves.co.uk/blog/74

The post by duck atJuly 24, 2011 at 2:34 pm

You need to configure vmware tools to run a script for the Guest shutdown action.

My batch file sits in the c:\scripts directory

------------------------

date /t >>c:\scripts\shutdown.txt
time /t >>c:\scripts\shutdown.txt
echo --------------------- >>c:\scripts\shutdown.txt
shutdown -s -t 10

-------------------------

It simply logs when the shutdown was triggered and begins a graceful shutdown after a 10 second warning.

To use the script, open VMware tools, click the scripts tab, select the Shut Down Guest Operating System by script event, click the custom script radio button, browse and select the script in c:\scripts (or where you put the script)

OK it and test 🙂

0 Kudos