Hi David,<br><br>just a forward to the list since others might be interested in that info.<br><br><div class="gmail_quote">2009/2/25 David Newman <span dir="ltr">&lt;<a href="mailto:dnewman@networktest.com">dnewman@networktest.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">On 2/17/09 5:26 AM, Arnaud Quette wrote:<br>
&gt;<br>
&gt; I&#39;ve appended a script excerpt I&#39;ve once made to address the guest<br>
&gt; shutdown from the host.<br>
&gt; it was for ESX, and at that time, I was really surprised to not see<br>
&gt; anything to address automagically an ordered shutdown (of the VMs)...<br>
&gt; hope this helps.<br>
<br>
</div>Thanks for this -- it is helpful.<br>
<br>
For VMWare Server 2 (and probably future versions of ESX) there is a new<br>
VIX API that replaces vmware-cmd.<br>
<br>
VIX has a bunch of stuff I haven&#39;t tried yet, but I do know hosts start<br>
and stop using the vmrun command. The syntax for starting a guest host<br>
is like this:<br>
<br>
vmrun -T server -h <a href="https://myvmhost:8333/sdk" target="_blank">https://myvmhost:8333/sdk</a> -u root -p &lt;password&gt; start<br>
&quot;[standard] vmware/FreeBSD.vmx&quot;<br>
<br>
dn<br>
<div class="Ih2E3d"><br>
<br>
&gt;<br>
&gt; Arnaud<br>
&gt; --<br>
&gt; Linux / Unix Expert R&amp;D - Eaton - <a href="http://www.eaton.com/mgeops" target="_blank">http://www.eaton.com/mgeops</a><br>
&gt; Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/" target="_blank">http://www.networkupstools.org/</a><br>
&gt; Debian Developer - <a href="http://people.debian.org/%7Eaquette/" target="_blank">http://people.debian.org/~aquette/</a><br>
&gt; Free Software Developer - <a href="http://arnaud.quette.free.fr/" target="_blank">http://arnaud.quette.free.fr/</a><br>
&gt;<br>
&gt; 2009/2/14 Doug Parsons &lt;<a href="mailto:doug@parsonsemail.com">doug@parsonsemail.com</a><br>
</div>&gt; &lt;mailto:<a href="mailto:doug@parsonsemail.com">doug@parsonsemail.com</a>&gt;&gt;<br>
<div><div></div><div class="Wj3C7c">&gt;<br>
&gt; Â  Â  &gt;Thanks, Doug. I&#39;m newly on VMWare Server 2, which has different tools<br>
&gt; Â  Â  &gt;than the 1.x ones I&#39;m familiar with. AFAIK the 1.x tools did not have<br>
&gt; Â  Â  &gt;any sort of UPS or shutdown awareness capability; I&#39;ll need to check<br>
&gt; Â  Â  &gt;whether that&#39;s true with 2.x.<br>
&gt; Â  Â  &gt;<br>
&gt; Â  Â  &gt;dn<br>
&gt;<br>
&gt;<br>
&gt; Â  Â  Unfortunately Server is the only version that I don&#39;t have running<br>
&gt; Â  Â  anymore.<br>
&gt; Â  Â  But as Arjen noted most versions can handle the guest shutdown<br>
&gt; Â  Â  natively. One<br>
&gt; Â  Â  catch is that this extends the shutdown and startup times quite a<br>
&gt; Â  Â  bit and so<br>
&gt; Â  Â  the battery level at which you start the shutdown would need to be<br>
&gt; Â  Â  higher.<br>
&gt; Â  Â  Another catch I believe is that the guest must be running the VMWare<br>
&gt; Â  Â  tools.<br>
&gt; Â  Â  If VMWare Server can&#39;t do it (check under the advanced tab) then you may<br>
&gt; Â  Â  want to consider VMWare 3i as it can and is also free. Hit the<br>
&gt; Â  Â  VMWare forums<br>
&gt; Â  Â  as they should be able to fill in all the details.<br>
&gt;<br>
&gt; Â  Â  Doug<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; # Customisable Vmware ESX shutdown<br>
&gt; stopVMWare()<br>
&gt; {<br>
&gt; Â  # Test if we have a Vmware ESX v3 setup<br>
&gt; Â  if [ -x /usr/bin/vmware ]<br>
&gt; Â  then<br>
&gt; Â  Â  ESXV3=`/usr/bin/vmware -v | grep &quot;ESX Server 3&quot;`<br>
&gt; Â  Â  if [ -n &quot;$ESXV3&quot; ]<br>
&gt; Â  Â  then<br>
&gt; Â  Â  Â  Â  # Get the VM list<br>
&gt; Â  Â  Â  VMLIST=`/usr/bin/vmware-cmd -l`<br>
&gt;<br>
&gt; Â  Â  Â  Â  for VM in $VMLIST<br>
&gt; Â  Â  Â  Â  do<br>
&gt; Â  Â  Â  Â  Â  # Get the VM state<br>
&gt; Â  Â  Â  Â  Â  Â  Â  VMSTATE=`/usr/bin/vmware-cmd &quot;$VM&quot; getstate -q`<br>
&gt;<br>
&gt; Â  Â  Â  Â  # Guest OS shutdown if VMSTATE is equal to &quot;on&quot;<br>
&gt; Â  Â  Â  Â  if [ &quot;$VMSTATE&quot; == &quot;on&quot; ]<br>
&gt; Â  Â  Â  Â  then<br>
&gt; Â  Â  Â  Â  Â  /usr/bin/vmware-cmd &quot;$VM&quot; stop trysoft<br>
&gt;<br>
&gt; Â  Â  Â  Â  Â  # delay a bit the next sequence<br>
&gt; Â  Â  Â  Â  Â  sleep 2<br>
&gt; Â  Â  Â  Â  fi<br>
&gt; Â  Â  Â  done<br>
&gt; Â  Â  Â  # Delay for 1 minute to give the VMs more time<br>
&gt; Â  Â  Â  # to cleanly shutdown<br>
&gt; Â  Â  Â  sleep 60<br>
&gt; Â  Â  fi<br>
&gt; Â  fi<br>
&gt; }<br>
<br>
</div></div></blockquote></div><br>cheers,<br clear="all">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>