Our Windows Server 2012 R2 machine just got its own UPS (APC Back-UPS RS 550G). I'm using the Windows release of apcupsd and since I would prefer if the UPS would turn off after shutdown I also added the
-p parameter to the service. As the documentation clearly states, due to deficiencies in the operating system it cannot be guaranteed that the system has successfully completed shutdown when the UPS kills power as the "kill power" instruction can only be sent to the UPS while the system is still running. I therefore added a
doshutdown.bat which first terminates essential services and then executes a customized shutdown command:
c:\windows\System32\shutdown.exe /s /d u:6:12 /c "apcupsd doshutdown" /t 5 /f
When testing a power failure, triggering the shutdown works fine but the UPS appears to kill power before the server's power indicator LED turns from green to amber which keeps me asking if shutdown, including a final flush to disks (we don't have a RAID backup battery), was complete at that point (server is a Fujitsu Primergy TX1330 M1).
The Windows event log lists entries suggesting the shutdown may still have been successful at that point, however those entries appear after the first entries regarding the boot after power loss which usually would mean that the log could not be flushed to disk in time? (German screenshot only, sorry)
Do these log entries, despite appearing in the wrong order, confirm that the system has successfully completed shutdown?
The system's RAID 1 does not report any errors. IPMI event log does not contain any unusual entries (last event is "Operating system shutdown - reason: 0x0006000C 'Power fail: Environment'" at 14:02:58, matching the time of Windows' wrongly ordered log entries; next IPMI event is "Automatic restart after a primary power fail", as expected).
I know that not telling the UPS to "kill power" would be the safest way but I don't feel comfortable allowing the UPS to run idle on batteries, humming along for up to 11 hours with nobody in the office to power it off manually. Furthermore, if the server doesn't get the power killed & restored it won't boot up on its own.
Bonus question: Time between shutdown command and logged time of shutdown is 16 seconds. I know that UPS model (APC Back-UPS RS 550G) does leave some grace time between being issued a "kill power" command and actually terminating the line. However, I was unable to find any information on how this works - is it just a plain timer (and how much time does it leave?) or is it even watching for a drop in power consumption?