VMware Cloud Community
ScottBentley
Hot Shot
Hot Shot

ESXi and UPS shutdown howto?

We have implemented a small test environment using ESXi with a few windows 2008 guests, we would like to protect the host machine using an APC UPS with network management adaptor installed in it.

A couple of questions, what is the best way of cleanly shutting down the host machine and guests in the event of a power failure?

I am considering installing a third linux guest that can monitor the UPS and then issue commands to the host to initiate the shutdown process, however being a bit new to linux, I have been trying to find a hoto step by step type gude for acheiving this.

I have seen a couple of posts mentioning apcupsd and the vmware perl toolkit?? or am I barking up the wrong tree?

Thanks

Scott

I hope this helps
0 Kudos
4 Replies
depping
Leadership
Leadership

A little birdie told me that APC is working on an agent for ESXi which will run inside VIMA.

Vima: http://www.vmware.com/support/developer/vima/

Might be worth contacting APC and ask when it will be released, I haven't heard a release date unfortunately/



Duncan

Blogging: http://www.yellow-bricks.com

If you find this information useful, please award points for "correct" or "helpful".

ScottBentley
Hot Shot
Hot Shot

Thanks Duncan

I did see this myself and tried to get a release date all I can find out is later this year!

I am also mindful about doing anything that is in "Unsupported" mode via ssh, so was thinking about installin apcupsd in a vm to pass the commands to a vima install?

I hope this helps
0 Kudos
lamw
Community Manager
Community Manager

Recently there was a similar thread about this issue: http://communities.vmware.com/message/1152466#1152466

The problem like the user has stated is a possible catch 22 scenario, where VIMA would be executing the shutdown of the guest's and host but the host may not poweroff until all guests have been powered off.

You do have the option of scripting something and having VIMA ssh into the ESXi host to power down all VM(s) and then the host, but again that is in the unsupported SSH console.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

ScottBentley
Hot Shot
Hot Shot

I did a bit more research, and have found a way of doing this, I am not sure its the most elegant solution but it does work.

To sum it up I did the following.

Installed VI Toolkit on one of the Guest 2008 servers found here VMware VI Toolkit for Windows

Added the following to the default powershell $profile

add-PSSnapin VMware.VimAutomation.Core

filter Shutdown-VMHost { ( Get-View -VIObject $_ ).ShutdownHost_Task( $TRUE ) }

Then created a powershell script with the following...

Connect-VIServer -Server 192.168.200.101 -Protocol https -User root -Password password

Get-VMHost

Get-VMHost | Shutdown-VMHost

In the VI client changed the Configuration > Virtual Machine Startup/Shutdown parameters to shut down the guest OS with a suitable delay period.

Finally created a batch file that calls the powershell script and then set it as an event in the APC powercute software when on battery for more than X minutes.

I know this is not best practice as it saves the username and password in plain text for the ESXi host, but I don't know another way of doing it.

I hope this helps
0 Kudos