LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Shutdown guests on powerfailure. (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/shutdown-guests-on-powerfailure-928269/)

ThomasRonshof 02-08-2012 04:19 AM

Shutdown guests on powerfailure.
 
Hi,

When power fails, the UPS (nut) save the state of all aktive guests.
This takes a lot of time.

Is it possible to make nut do a normal shutdown instead ?

Regards.

catkin 02-08-2012 09:05 PM

Which software does nut use on the host when the power fails?

Which virtualisation software is used to run the guests?

ThomasRonshof 02-09-2012 02:13 AM

We use Cent OS 6.2 with KVM.

Here are the config-files. I think it's Netwatch, not 100% sure.

’root@nyborg ~¸# cd /etc
’root@nyborg etc¸# cd ups
’root@nyborg ups¸# ls -l
total 40
-rwxrwxrwx 1 nobody root 157 Jan 30 14:42 notify.sh
-rw-r----- 1 root nut 1413 Aug 5 2011 nut.conf
-rw-r----- 1 root nut 3738 Nov 24 12:08 ups.conf
-rw-r----- 1 root nut 2589 Nov 24 13:29 upsd.conf
-rw-r----- 1 root nut 2271 Nov 24 12:12 upsd.users
-rw-r----- 1 root nut 12308 Dec 2 15:03 upsmon.conf
-rw-r----- 1 root nut 3891 Aug 5 2011 upssched.conf
’root@-nyborg ups¸#
’root@-nyborg ups¸#

ThomasRonshof 02-09-2012 02:20 AM

The UPS-software is nut !

catkin 02-09-2012 02:59 AM

According to the upsmon.conf man page, SHUTDOWNCMD command can be used to configure a command for upsmon to run when the system needs to be brought down. That command could be a script which shuts down the VMs and then shuts down the host.

IDK KVM so cannot advise on the command(s) to shut down the VMs. If netsearching dosn't give you a solution, it might be worth a new thread, asking how to shut down KVM VMs programatically.

brak44 02-22-2012 12:02 AM

Non-default shutdown
 
We had the same problem with nut waiting until the battery had about 2 minutes life left in it. This corrupted the VM's because they needed time to save their state to the disk.
The approach of using a Non-default shutdown worked for us.
Check this out
http://linuxman.wikispaces.com/NUT
and scroll down to the Non-default shutdown section.

ThomasRonshof 02-23-2012 01:59 AM

Thanks :-)

I'll test it.


All times are GMT -5. The time now is 02:00 AM.