I'm new to NUT, but didn't find a clear answer to this either in the recent "ordered shutdown" thread or in Google: How to shut down VMWare guest virtual machines earlier than the host machine they run on? (For example, if everything normally shuts down at 5% UPS battery, then the VMs should shut down at 10%.) I also read upssched.txt but I can't tell from the early shutdown section which settings to use on the master and which on the slaves. This seems like a fairly standard problem -- are there sample configs posted someplace? thanks! dn
Citeren David Newman <dnewman op networktest.com>:> How to shut down VMWare guest virtual machines earlier than the host > machine they run on? (For example, if everything normally shuts down at > 5% UPS battery, then the VMs should shut down at 10%.)First question is, why do you want to do that?> I also read upssched.txt but I can't tell from the early shutdown > section which settings to use on the master and which on the slaves. > > This seems like a fairly standard problem -- are there sample configs > posted someplace?I'm not an expert on VMware, but I would expect that you can configure on the host that it shuts down the guests before going down. Best regards, Arjen -- Please keep list traffic on the list
Citeren David Newman <dnewman op networktest.com>:>>> How to shut down VMWare guest virtual machines earlier than the host >>> machine they run on? (For example, if everything normally shuts down at >>> 5% UPS battery, then the VMs should shut down at 10%.) >> First question is, why do you want to do that? > Because a clean shutdown of the VMs is more important than high uptime > for the VMs. > > If both guest and host machines shut down at the same time, the host > might finish its shutdown before the guests have, leading to possible > filesystem corruption. I will gladly trade off some downtime of the VMs > to ensure clean shutdowns.I would be really surprised if this couldn't be handled by VMWare. Briefly looking at some Googled pages, it seems that the host can signal the guests to shutdown and I assume it should also be possible to check if they have indeed done so. If that's the case, the host should signal the guests that they need to shutdown, wait until the last one has finished and proceed with shutting down itself. Scripting this should be pretty straightforward. [...]>> I'm not an expert on VMware, but I would expect that you can configure >> on the host that it shuts down the guests before going down. > Thanks -- that's what I'm asking for -- what is it that I configure, and > are there sample configs someplace that do this?You should really ask on a VMWare mailinglist how to do this. We can help you shutdown your systems, but not any application (including VMWare) it may be running. Usually, NUT expects system halt scripts to be dealing with this (with or without NUT running). Even for a system that is running 24/7, I would still want that. If they need to be brought down for maintenance, I don't want to have to think about what needs to be stopped, before it is safe to type 'halt -p' on the console. Best regards, Arjen -- Please keep list traffic on the list
Hi David, just a forward to the list since others might be interested in that info. 2009/2/25 David Newman <dnewman at networktest.com>> On 2/17/09 5:26 AM, Arnaud Quette wrote: > > > > I've appended a script excerpt I've once made to address the guest > > shutdown from the host. > > 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. > > Thanks for this -- it is helpful. > > For VMWare Server 2 (and probably future versions of ESX) there is a new > VIX API that replaces vmware-cmd. > > VIX has a bunch of stuff I haven't tried yet, but I do know hosts start > and stop using the vmrun command. The syntax for starting a guest host > is like this: > > vmrun -T server -h https://myvmhost:8333/sdk -u root -p <password> start > "[standard] vmware/FreeBSD.vmx" > > dn > > > > > > Arnaud > > -- > > Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops > > Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ > > Debian Developer - http://people.debian.org/~aquette/<http://people.debian.org/%7Eaquette/> > > Free Software Developer - http://arnaud.quette.free.fr/ > > > > 2009/2/14 Doug Parsons <doug at parsonsemail.com > > <mailto:doug at parsonsemail.com>> > > > > >Thanks, Doug. I'm newly on VMWare Server 2, which has different > tools > > >than the 1.x ones I'm familiar with. AFAIK the 1.x tools did not > have > > >any sort of UPS or shutdown awareness capability; I'll need to check > > >whether that's true with 2.x. > > > > > >dn > > > > > > Unfortunately Server is the only version that I don't have running > > anymore. > > But as Arjen noted most versions can handle the guest shutdown > > natively. One > > catch is that this extends the shutdown and startup times quite a > > bit and so > > the battery level at which you start the shutdown would need to be > > higher. > > Another catch I believe is that the guest must be running the VMWare > > tools. > > If VMWare Server can't do it (check under the advanced tab) then you > may > > want to consider VMWare 3i as it can and is also free. Hit the > > VMWare forums > > as they should be able to fill in all the details. > > > > Doug > > > > > > > > # Customisable Vmware ESX shutdown > > 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 > > # Delay for 1 minute to give the VMs more time > > # to cleanly shutdown > > sleep 60 > > fi > > fi > > } > >cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://people.debian.org/~aquette/ Free Software Developer - http://arnaud.quette.free.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20090226/d8667cc4/attachment-0001.htm