[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apcupsd-users
Subject:    [Apcupsd-users] Configuration questions
From:       Timothe Litt <litt () acm ! org>
Date:       2014-03-21 2:25:44
Message-ID: 532BA328.5020808 () acm ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


I am unclear about how to make this configuration work:

UPS --usb--> server (apcupsd master) -----virtual net---> VM1 (apcupsd 
client/slave)
|---virtual net--> VM2 ...

This is an unattended environment, so it has to shutdown safely and 
always restart.  (FWIW, the VMM is VirtualBox, the OSes are various 
versions of Fedora, and the VMs are headless.)

The apcupsd manual suggests setting the VMs to shutdown sooner than the 
server, which has to happen in any case so that the VMs can write their 
disk caches to their (virtual) disks (which are on the master) before 
the master unmounts/write-locks the physical disks.

Let's say I do this in the apcupsd config files:
     server:  POLLTIME 60; BATTERYLEVEL 15; MINUTES 10

     VMs:     POLLTIME 10; BATTERYLEVEL 25; MINUTES 15

Now, power fails and we hit the 15 minute mark.  The VMs have 5 minutes 
/ 10% to shutdown cleanly.

The VMs should shutdown and halt.  They don't tell the server (though 
the server could see if they are running).

Power returns at 11 minutes.  So the server does not shutdown.  Now:

There is insufficient battery to start the VMs - if we did, they should 
shut down immediately because the runtime is below their shutdown 
point.  Even on AC power, another failure would catch them with 
insufficient battery to shut down before the server hit its threshold.  
We need to wait until they charge to some sensible level.  Say, 50% or 
30 minutes.  Seems long, but that's enough hysteresis to prevent 
oscillations. (boot/shutdown loops.)

In one scenario, one might want to shut down the server anyway - if this 
would charge the batteries faster?  The VMs would start normally  when 
the server powered up.  Assuming the UPS supports the RETPCT variable - 
the RS1500 doesn't.

In another, one would leave the server running - it can spool inbound 
mail until the VMs start, for example.  But then it needs a trigger for 
"battery has charged to threshhold" at which point it can start the 
VMs.  Which trigger doesn't seem to be an event...  I guess one could 
script acpaccess status & parse for BCHARGE and TIMELEFT.  But shouldn't 
apcupsd do this?

And I suppose one would also like to have a hook in the sysinit process 
that can hold off mounting anything rw until the server's battery 
threshhold is reached...  That would allow safe startup when UPSs don't 
support RETPCT.

What am I missing?

-- 
Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.



["smime.p7s" (application/pkcs7-signature)]

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech

_______________________________________________
Apcupsd-users mailing list
Apcupsd-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/apcupsd-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic