There are no agents for ESXi because it hasn't got a service console. Your best bet would be scripting this and kicking of the script from another physical machine when power fails.
My virtualisation blog:
If you find this information useful, please award points for "correct" or "helpful".
You can use the VI API to script the shutdown when you get to a critical power level. I assume you can get the APC information from a script as well. Here is a pointer to the VI Perl Toolkit:
Also for most configuration options have a look at the RCLI, it can be used to script configuration steps for ESXi:
Here is the documentation for the RCLI:
Please reply to me if you have questions, I accidentally posted that from another account.
I'm in the same situation as you. What did you end up using as your solution?
APC Networkshutdown is only installable in ESX 3.x not in ESX 3i.
At the moment, I install APC Network Shutdown in every VM; but nothing in ESX 3i.. at the moment....
You should also be able to use an iLO or IPMI script to do the poweroff or put the machine in maintence mode from VC through VI API (we have a freely available Perl toolkit) if you want to migrate prior to shutdown. Is this not possible from APC? Basically, I don't understand why APC would need an agent running on the system itself?
I solved the problem with a Web/SNMP network management card connected via IP to a VM box.
Then I compiled the apcupsd driver (http://www.apcupsd.org) inside a Linux VM box and in case of a
power failure I send the /sbin/poweroff command to the ESXi host via ssh using an identity file.
The trick is to enable the SSH server inside the ESXi host, build a dropbear and openSSH RSA
root key with at least 768 bit on it, put all the keys inside the oem.tgz file, disable root login and
for safety reasons enable only the execution of remote commands (append -g to ssh line inside
inetd.conf) and configure the shutdown and startup sequence of every VM boxes.
Beforehand I tried the PERL Toolkit and stumpled over the problem that sending a shutdown command
using the vmcontrol.pl command prevents the ESXi host to shutdown itself properly.
Please consider to use a big UPS in case you have plenty VM boxes to shutdown and don't forget to plan
the startup and shutdown sequence of all involved VM boxes with care.
Hi, i am trying to configure an esxi server to remotely shutdown via ssh.
I don't know where to put authorized_keys file for dropbear. Could you help me
I understand enabling SSH on ESXi works, but it's not supported by VMware (and it could be disabled in the future, no one knows). VMware itself tells you to use the remote CLI tools for this.. You must have a good reason to persist the ssh solution
Can you elaborate on how you made the keypair?
This isn't supported but here you go. I used puttykeygen to create the key pair.
1) Generate the public / private key pair
2) Edit /etc/passwd - add "root" to the root entry so the line will be like this
3) Run mkdir -p /root/.ssh
4) Copy the public key to /root/.ssh/authorized_keys
5) Run chmod -R 700 /root
Attempt to login with your SSH client.
The bundle the /root folder into oem.tgz. You could also do /etc/passwd and /etc/inetd.conf, but I only tested the /root folder.
Simple instructions, appreciate it!
I am getting a message from dropbear saying server refused my key? I tried generating the keys with dropbearkey and putty.
I ended up making them on my CentOS vm and that worked...
Puttykeygen generated both a public key file and text to paste into authorized_keys. I used the text part (the public key file was formatted differently) so I end up with this in the file on ESXi.
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAor/Mm2qGkHZRNbjx/3e0Qz2cNEKEbzsFiYTO3znvwfWqJjzb7sD1bue9VnyyUEBu5ylMs0md9xZpZ/U6HIKwoDwckZQr4/48sHv7B3dU6I4pyD5H7bvpvnfK2Qh5/VCad5aGGKvdDrDzIv4K/l1uPso9PNIpzch9lEuD7il0k= rsa-key-20081106
Good to know, I suspected it was the formatting.
I tried posting a reply on your page about the oem.tgz file and see you issue a chown 201:201 on /etc inside the tar file before you package it. I would need to add /root and /etc/passwd to my tar file but I don't understand who group 201 is? I don't even have a 201?
Thanks for all the help!