Re: [CentOS] Power Fail Protection Update

2017-08-17 Thread ken

On 08/16/2017 02:31 PM, John R Pierce wrote:
in general, there's two power save states, 'Standby' aka 'Sleep', 
where the system state is held in RAM, but the CPU and peripherals is 
shut down and sleeping, and "Hibernate" where the ram is saved to disk 
and the system is completely powered down.


That's what I thought too, until I read "man rtcwake" and discovered 
there are five standby modes.  A major problem-solver in this context 
would be some code added to that to allow a network connection to 
communicate with a UPS or server.  Given that Wake-on-LAN wouldn't be 
necessary.





In sleep, if the power is lost, then you'll need to reboot when the 
power comes back up.   The system is using very little power, so your 
UPS should last much longer.


In hibernate, you can restore when the power returns. Hibernate, 
however, takes a few more seconds to wakeup, so people often use Sleep 
as it wakes up relatively instantly.


In neither of these states will the system be able to listen to ANY 
network traffic, as the processor is simply not running.   The one 
exception is Wake-On-Lan aka WoL.You probably COULD configure a 
master always-on NUT box to send WoL to a list of such systems, wait a 
suitable amount of time for them to come back to their senses, then 
send them Hibernate commands via NUT.


Utilizing WoL requires configuration on the target hardware to 
recognize and accept the WoL, this is typically done at the BIOS 
level, and only works if the system supports WoL in the first place.   
WoL commands can typically only be sent over the same local network 
segment, as they are layer 2 packets sent to the MAC address of the 
target.




___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Power Fail Protection Update

2017-08-16 Thread John R Pierce

On 8/16/2017 7:49 AM, Chris Olson wrote:

Many thanks to those that responded to my original posting with
information about Network UPS Tools and commercial UPS products.

In our planning a path forward to implement UPS-based power fail
protection, we have come across what appears to be an issue with
the state of the CentOS 6 machines being UPS protected.  Most of
these machines are desktop/deskside machines that are likely to
be idle during non-work hours.  It is also likely that they will
be hibernating or in a power save mode.

In the power save mode, these machines do not respond to keyboard
or mouse activity.  They also do not respond to network traffic
such as a ping from other systems on the network.  The method we
use to wake them up is a quick push on the power button when the
hibernation state is indicated by the button's yellow LED display.

This state of hibernation leaves us wondering if these systems will
be able to respond to network messages sent by the UPS.  We have not
yet made it all the way through the NUT and UPS documentation.
The hibernation answer may very well be therein, but we have not
found it so far.  Any help or direction regarding the hibernation
issue as it relates to UPS power fail protection will be appreciated.



in general, there's two power save states, 'Standby' aka 'Sleep', where 
the system state is held in RAM, but the CPU and peripherals is shut 
down and sleeping, and "Hibernate" where the ram is saved to disk and 
the system is completely powered down.


In sleep, if the power is lost, then you'll need to reboot when the 
power comes back up.   The system is using very little power, so your 
UPS should last much longer.


In hibernate, you can restore when the power returns. Hibernate, 
however, takes a few more seconds to wakeup, so people often use Sleep 
as it wakes up relatively instantly.


In neither of these states will the system be able to listen to ANY 
network traffic, as the processor is simply not running.   The one 
exception is Wake-On-Lan aka WoL.You probably COULD configure a 
master always-on NUT box to send WoL to a list of such systems, wait a 
suitable amount of time for them to come back to their senses, then send 
them Hibernate commands via NUT.


Utilizing WoL requires configuration on the target hardware to recognize 
and accept the WoL, this is typically done at the BIOS level, and only 
works if the system supports WoL in the first place.   WoL commands can 
typically only be sent over the same local network segment, as they are 
layer 2 packets sent to the MAC address of the target.




--
john r pierce, recycling bits in santa cruz

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Power Fail Protection Update

2017-08-16 Thread Chris Murphy
On Wed, Aug 16, 2017 at 8:49 AM, Chris Olson  wrote:
> Many thanks to those that responded to my original posting with
> information about Network UPS Tools and commercial UPS products.
>
> In our planning a path forward to implement UPS-based power fail
> protection, we have come across what appears to be an issue with
> the state of the CentOS 6 machines being UPS protected.  Most of
> these machines are desktop/deskside machines that are likely to
> be idle during non-work hours.  It is also likely that they will
> be hibernating or in a power save mode.
>
> In the power save mode, these machines do not respond to keyboard
> or mouse activity.  They also do not respond to network traffic
> such as a ping from other systems on the network.  The method we
> use to wake them up is a quick push on the power button when the
> hibernation state is indicated by the button's yellow LED display.
>
> This state of hibernation leaves us wondering if these systems will
> be able to respond to network messages sent by the UPS.  We have not
> yet made it all the way through the NUT and UPS documentation.
> The hibernation answer may very well be therein, but we have not
> found it so far.  Any help or direction regarding the hibernation
> issue as it relates to UPS power fail protection will be appreciated.

Suspend to RAM and suspend to disk both sync filesystems before the
system suspends, so what should be true is the file system is
consistent. The log might be dirty, but this would be replayed at next
boot if there's a power failure.

The only thing that would be lost is any unsaved work. The old school
answer is, save your files before you sleep the computer; i.e. the
burden is on the user.

My position is, this is a solved problem on mobile, where apps take
responsibility for saving state including user data. Some do this
locally, some sync it to the cloud. So far I'm not seeing this become
much of a thing on the desktop, other than macOS where it's fairly
standard at this point. Libreoffice by default saves autorecovery
information every 10 minutes, for example.


-- 
Chris Murphy
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Power Fail Protection

2017-08-14 Thread John R Pierce

On 8/14/2017 4:01 PM, Mark LaPierre wrote:

You didn't say what brand/model of UPS you are using so I can't be
specific.  Check with the manufacturer of your UPS to see if they have
an application that can communicate power status with your CPU.  Many
UPS devices are capable of signaling power loss.  The UPS can give you
enough warning to initiate a graceful shutdown.

For example APC brand UPS devices.  Many of them can connect to the CPU
through either Ethernet, USB, or serial cable so they can send the bad
news that the power is going down soon.  Check with your UPS
manufacturer first.



NUT supports virtually *ALL* UPS's without messing with manufacturer 
proprietary software, and its in the EPEL repository, kept up to date.



--
john r pierce, recycling bits in santa cruz

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Power Fail Protection

2017-08-14 Thread Mark LaPierre
On 08/08/17 19:50, Chris Olson wrote:
> 
> Some of our largest systems run Windows because it supports engineering
> applications that we use regularly.  These applications have unattended
> runs that often take between ten and fifteen hours to complete.  We have
> taken the recommendation of the application supplier and equipped these
> Windows machines with UPS protection for 30 minutes at full load.
> 
> The UPSs are Ethernet connected.  A support application on the Windows
> engineering machine communicates with the UPS to detect and address any
> facility power failure.  The long run engineering application is then
> suspended at a restart point and the system is shut down.  We initiate
> job completion manually from the suspension restart point after the
> system has reliable power and is rebooted.
> 
> If we wanted to protect our CentOS systems from facility power failure
> in a similar way, is there operating system or other standard support
> that we might employ?  Most of the Linux-based applications are not as
> critical as the engineering applications on the Windows machines. There
> is a significant amount of processor idle time on several of the CentOS
> systems during non-work hours when the systems are unattended.  Several
> CentOS systems are supported currently with UPSs, but they run out and
> the system loses power if it is unattended.
> ___

You didn't say what brand/model of UPS you are using so I can't be
specific.  Check with the manufacturer of your UPS to see if they have
an application that can communicate power status with your CPU.  Many
UPS devices are capable of signaling power loss.  The UPS can give you
enough warning to initiate a graceful shutdown.

For example APC brand UPS devices.  Many of them can connect to the CPU
through either Ethernet, USB, or serial cable so they can send the bad
news that the power is going down soon.  Check with your UPS
manufacturer first.

-- 
_
   °v°
  /(_)\
   ^ ^  Mark LaPierre
Registered Linux user No #267004
https://linuxcounter.net/

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Power Fail Protection

2017-08-08 Thread John R Pierce

On 8/8/2017 5:06 PM, John R Pierce wrote:
NUT is in EPEL... 



oh, NUT supports virtually every UPS made, too.


--
john r pierce, recycling bits in santa cruz

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Power Fail Protection

2017-08-08 Thread Valeri Galtsev

On Tue, August 8, 2017 6:50 pm, Chris Olson wrote:
>
> Some of our largest systems run Windows because it supports engineering
> applications that we use regularly.  These applications have unattended
> runs that often take between ten and fifteen hours to complete.  We have
> taken the recommendation of the application supplier and equipped these
> Windows machines with UPS protection for 30 minutes at full load.
>
> The UPSs are Ethernet connected.  A support application on the Windows
> engineering machine communicates with the UPS to detect and address any
> facility power failure.  The long run engineering application is then
> suspended at a restart point and the system is shut down.  We initiate
> job completion manually from the suspension restart point after the
> system has reliable power and is rebooted.
>
> If we wanted to protect our CentOS systems from facility power failure
> in a similar way, is there operating system or other standard support
> that we might employ?  Most of the Linux-based applications are not as
> critical as the engineering applications on the Windows machines. There
> is a significant amount of processor idle time on several of the CentOS
> systems during non-work hours when the systems are unattended.  Several
> CentOS systems are supported currently with UPSs, but they run out and
> the system loses power if it is unattended.

I used a lot APC smart UPSes. They have serial or USB connection through
which some daemon you run on your machine (apcupsd) can detect UPS on
battery, and can initiate clean system shutdown when battery is below some
charge level (you define which in configuration). Apcupsd is free open
source software, I never used APC's software that does the same. When
power returns (if UPS fully drained its battery) system can be configured
to boot on power restored. If you have more than one machine behind the
same UPS, apcupsd daemons on other machines can run in "slave" mode and
get information from master apcupsd.

Depending on your UPS make/model there may be similar daemon that can do
the same.

Valeri

> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
>



Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Power Fail Protection

2017-08-08 Thread John R Pierce

On 8/8/2017 4:50 PM, Chris Olson wrote:

If we wanted to protect our CentOS systems from facility power failure
in a similar way, is there operating system or other standard support
that we might employ?  Most of the Linux-based applications are not as
critical as the engineering applications on the Windows machines. There
is a significant amount of processor idle time on several of the CentOS
systems during non-work hours when the systems are unattended.  Several
CentOS systems are supported currently with UPSs, but they run out and
the system loses power if it is unattended.


NUT aka NetworkUPS Tools is the way to go on Linux, for UPS power 
management.   you can configure NUT as master/slave, so one linux system 
talks with the UPS, either USB, Serial, or Ethernet, and it in turn 
tells the other linux systems to shut down cleanly when its time.   Or 
if each box has its own UPS, you can just run NUT in standalone mode on 
each box.


NUT is in EPEL...



--
john r pierce, recycling bits in santa cruz

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos