Hi guys,
I have set up our UPS with our ESXi server according to document (revision 4)
http://viops.vmware.com/home/docs/DOC-1341/version/4
Note
that revision 4 of the document is not the one using lamw's scripts,
but using the ssh hack. Everything works beautifully when I invoke the
script ups_shutdown manually from the ESXi unsupported console:
First of all, right of the bat the first line of the script throws and error (-ash file not found error). So I had to remove that (any idea why??).
When I run this script from the ESXi console (unsupported), everything is fine, all the VMs shut down and at the end, so does the ESXi.
When I run this script from VIMA (ssh to the console, remote script execution), only the VIMA machine shuts down. If I modify the above script to not shut down VIMA, all the VMs (except for VIMA of course) shut down, and so does the ESXi...
VIMA is the first machine that gets shutdown - it has the lowest Vmid. It seems as though this causes the rest of the script to stop executing... How is this possible when in fact it is being executed on the ESXi server?
I'm pulling my hair out on this one (or what's left of them). Does anyone have any idea why this doesn't work...? lamw?
Thanks in advance guys,
Andrzej
I have set up our UPS with our ESXi server according to document (revision 4)
http://viops.vmware.com/home/docs/DOC-1341/version/4
Note
that revision 4 of the document is not the one using lamw's scripts,
but using the ssh hack. Everything works beautifully when I invoke the
script ups_shutdown manually from the ESXi unsupported console:
#!/bin/bash
VMID=$(/usr/bin/vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}')
for i in $VMID
do
STATE=$(/usr/bin/vim-cmd vmsvc/power.getstate $i | tail -1 | awk '{print $2}')
if [ $STATE == on ]
then
/usr/bin/vim-cmd vmsvc/power.shutdown $i
fi
done
sleep 30
/sbin/shutdown.sh
/sbin/poweroff
First of all, right of the bat the first line of the script throws and error (-ash file not found error). So I had to remove that (any idea why??).
When I run this script from the ESXi console (unsupported), everything is fine, all the VMs shut down and at the end, so does the ESXi.
When I run this script from VIMA (ssh to the console, remote script execution), only the VIMA machine shuts down. If I modify the above script to not shut down VIMA, all the VMs (except for VIMA of course) shut down, and so does the ESXi...
VIMA is the first machine that gets shutdown - it has the lowest Vmid. It seems as though this causes the rest of the script to stop executing... How is this possible when in fact it is being executed on the ESXi server?
I'm pulling my hair out on this one (or what's left of them). Does anyone have any idea why this doesn't work...? lamw?
Thanks in advance guys,
Andrzej