Skip to content
  • Leigh B Stoller's avatar
    Power "saving" additions from Barry Trent, who got them from Kevin · 03478fb9
    Leigh B Stoller authored
    Lahey.
    
    Power saving turns off nodes that have been sitting in PXEWAIT (and
    are thus free) for more then a set amount of time (see sitevar
    general/idlepower_idletime, which defaults to 3600 seconds).
    
    The driver script is tbsetup/idlepower.in and needs to be added to
    /etc/crontab at sites that want to do this. Even so, operation is
    enabled by the sitevar general/idlepower_enable. Each time it runs, it
    checks for nodes that need to be turned off, and then calls power.
    Note: This should be a daemon not a cron job.
    
    To be considered for power saving, you must add an attribute to the
    node_type_attributes table called 'idlepower_enable', set to 1.
    
    Locally, I hacked up stated and power to make the state transitions
    legal so that stated does not whine. I added POWEROFF as a valid
    transition from any state, to opmodes NORMAL, NORMALv1, and NORMALv2.
    Barry's original patch already had a state transition for PXEKERNEL.
    In power, I added code to look at the actual operation, and in the
    case of "on", do not send an event if the node is not in POWEROFF,
    since a user can foolishly say power on anytime, and the node is on
    nothing is every going to change, and the state transition would be
    wrong.
    
    node_reboot takes of powering nodes on, when they are in POWEROFF.
    
    Barry on copyright issues:
     "I'm not sure those rights are mine to grant! Remember that this code
     came originally from Kevin Lahey (kml@patheticgeek.net) and
     originated at DETER (although he's apparently not there anymore). I
     don't foresee a problem from our point of view (but I'll double
     check, of course). Shall I try to contact Kevin try to sort this mess
     out, or do you think it's better to coordinate from your end?"
    03478fb9