<br>I've appended a script excerpt I've once made to address the guest shutdown from the host.<br>it was for ESX, and at that time, I was really surprised to not see anything to address automagically an ordered shutdown (of the VMs)... hope this helps.<br>
<br>Arnaud<br>-- <br>Linux / Unix Expert R&D - Eaton - <a href="http://www.eaton.com/mgeops">http://www.eaton.com/mgeops</a><br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/">http://www.networkupstools.org/</a><br>
Debian Developer - <a href="http://people.debian.org/~aquette/">http://people.debian.org/~aquette/</a><br>Free Software Developer - <a href="http://arnaud.quette.free.fr/">http://arnaud.quette.free.fr/</a><br><br><div class="gmail_quote">
2009/2/14 Doug Parsons <span dir="ltr"><<a href="mailto:doug@parsonsemail.com">doug@parsonsemail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">>Thanks, Doug. I'm newly on VMWare Server 2, which has different tools<br>
>than the 1.x ones I'm familiar with. AFAIK the 1.x tools did not have<br>
>any sort of UPS or shutdown awareness capability; I'll need to check<br>
>whether that's true with 2.x.<br>
><br>
>dn<br>
<br>
<br>
</div>Unfortunately Server is the only version that I don't have running anymore.<br>
But as Arjen noted most versions can handle the guest shutdown natively. One<br>
catch is that this extends the shutdown and startup times quite a bit and so<br>
the battery level at which you start the shutdown would need to be higher.<br>
Another catch I believe is that the guest must be running the VMWare tools.<br>
If VMWare Server can't do it (check under the advanced tab) then you may<br>
want to consider VMWare 3i as it can and is also free. Hit the VMWare forums<br>
as they should be able to fill in all the details.<br>
<br>
Doug<br>
<br></blockquote></div><br><br clear="all"># Customisable Vmware ESX shutdown<br>stopVMWare()<br>{<br> # Test if we have a Vmware ESX v3 setup<br> if [ -x /usr/bin/vmware ]<br> then <br> ESXV3=`/usr/bin/vmware -v | grep "ESX Server 3"`<br>
if [ -n "$ESXV3" ]<br> then<br> # Get the VM list<br> VMLIST=`/usr/bin/vmware-cmd -l`<br><br> for VM in $VMLIST<br> do<br> # Get the VM state<br> VMSTATE=`/usr/bin/vmware-cmd "$VM" getstate -q`<br>
<br> # Guest OS shutdown if VMSTATE is equal to "on"<br> if [ "$VMSTATE" == "on" ]<br> then<br> /usr/bin/vmware-cmd "$VM" stop trysoft<br> <br>
# delay a bit the next sequence<br> sleep 2<br> fi<br> done<br> # Delay for 1 minute to give the VMs more time<br> # to cleanly shutdown<br> sleep 60<br> fi<br> fi<br>}<br>