2007/1/18, Steve Loughran <[EMAIL PROTECTED]>:
Hi

Having used NUT for many years (Irix/Linux/Solaris/win32), but only used
VMWare ESX v3 for about 4 weeks, what scripted command are you telling
NUT to run to tell ESX to shutdown/suspend the VMs before it really
powers itself down? (Not sure calling "shutdown" would be such a good
idea :)

I'm not at all en ESX expert, but from what I know, VMs are brought up
automatically at vmware startup, but not shutdown.

Below is a code snipped that iterate on all VM and try to shut these
down softly:

stopVMWare()
{
 # Test if we have a Vmware ESX v3 setup
 if [ -x /usr/bin/vmware ]
 then
   ESXV3=`/usr/bin/vmware -v | grep "ESX Server 3"`
   if [ -n "$ESXV3" ]
   then
          # Get the VM list
         VMLIST=`/usr/bin/vmware-cmd -l`

          for VM in $VMLIST
          do
            # Get the VM state
            VMSTATE=`/usr/bin/vmware-cmd "$VM" getstate -q`

       # Guest OS shutdown if VMSTATE is equal to "on"
       if [ "$VMSTATE" == "on" ]
       then
         /usr/bin/vmware-cmd $VM stop trysoft

         # delay a bit the next sequence
         sleep 2
       fi
     done
   fi
 fi
}

hope this help,
Arnaud
--
Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
OpenSource Developer - http://arnaud.quette.free.fr/

_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to