<br>I&#39;ve appended a script excerpt I&#39;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&amp;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">&lt;<a href="mailto:doug@parsonsemail.com">doug@parsonsemail.com</a>&gt;</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">&gt;Thanks, Doug. I&#39;m newly on VMWare Server 2, which has different tools<br>
&gt;than the 1.x ones I&#39;m familiar with. AFAIK the 1.x tools did not have<br>
&gt;any sort of UPS or shutdown awareness capability; I&#39;ll need to check<br>
&gt;whether that&#39;s true with 2.x.<br>
&gt;<br>
&gt;dn<br>
<br>
<br>
</div>Unfortunately Server is the only version that I don&#39;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&#39;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>&nbsp; # Test if we have a Vmware ESX v3 setup<br>&nbsp; if [ -x /usr/bin/vmware ]<br>&nbsp; then&nbsp; <br>&nbsp;&nbsp;&nbsp; ESXV3=`/usr/bin/vmware -v | grep &quot;ESX Server 3&quot;`<br>
&nbsp;&nbsp;&nbsp; if [ -n &quot;$ESXV3&quot; ]<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; # Get the VM list<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VMLIST=`/usr/bin/vmware-cmd -l`<br><br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; for VM in $VMLIST<br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; do<br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # Get the VM state<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; VMSTATE=`/usr/bin/vmware-cmd &quot;$VM&quot; getstate -q`<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Guest OS shutdown if VMSTATE is equal to &quot;on&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ &quot;$VMSTATE&quot; == &quot;on&quot; ]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/bin/vmware-cmd &quot;$VM&quot; stop trysoft<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # delay a bit the next sequence<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep 2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; done<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Delay for 1 minute to give the VMs more time<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # to cleanly shutdown<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep 60<br>&nbsp;&nbsp;&nbsp; fi<br>&nbsp; fi<br>}<br>