Hi,
I'm trying to set up a safe shutdown of our ESXi U4 (free) host using the method described by jholland here.
I have set it up as described in the article and am attempting to test it, for testing purposes I have done the following:
created /ups_shutdown.sh on the ESXi machine containing only "echo TEST SUCCESSFUL"
commented out the last line of the doshutdown section of /etc/apcupsd/apccontrol on the vMA VM so that vMA does not shut down everytime I do a test.
So to test that vMA will call the shutdown script from ESXi I do:
Which returns:
Broadcast message from root (Tue Jun 30 20:39:13 2009):
UPS initiated Shutdown Sequenceapcupsd$ The authenticity of host 'esxihost.domain.local (192.xxx.xx.xxx)' can't be established.
RSA key fingerprint is *:::*:etc.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
Obviously I'm doing something wrong with either the ssh key generation in ESXi or importing it on vMA.
My only previous ssh experience is limited to " I use putty and it just works" so I'm a bit lost here.
I have followed jhollands instructions to create the ssh key in ESXi a couple of times and it all completes successfully. The last line reads:
"You can now, using WinSCP or scp from another server transfer off the id_rsa.ssh public key file."
Transfer it where? For what?
Given that we need to insert this line into the "doshutdown" section of /etc/apcupsd/apccontrol:
ssh -i /root/esxi_id_rsa.pub root@<esxi_ipaddress> "/ups_shutdown.sh" &
I am assuming that I need to make /root/esxi_id_rsa.pub the pair to the ssh key created in ESXi.
I have tried copying both id_rsa.ssh and id_rsa.pub from ESXi to vMA and renaming them to /root/esxi_id_rsa.pub. Both return the error above.
I have also disabled the vMA firewall as described in version 7 of jhollands howto.
Is there a command to import the ssh key to vMA? I'm pretty sure this is a config/lack of knowledge error on my part.
Interestingly I can do this:
vi-admin@vma apcupsd$ sshroot@esxihost./ups_shutdown.shroot@esxihost'spassword:
TEST SUCCESS
Thanks to Joseph Holland for his work, when I get it working this will solve a real issue for us.
Cheers for reading.
Simon