1# power_off_config
2
3## Description
4A list of power off rules based on the monitoring state of the fans configured. These power off rules can perform different system power off types to protect a system that is not able to provide enough cooling due to a number of missing or nonfunctional fans.
5
6## Attribute Value(s)
7* `type` - ["hard", "soft", "epow"]
8  * "hard" - Perform a hard shutdown that immediately powers off the system.
9  * "soft" - Perform an orderly shutdown requesting that the host OS power off
10  the system.
11  * "epow" - Sets the thermal alert D-Bus property that a power off is imminent
12  after a `service_mode_delay` amount of time passes.
13* `cause` - ["missing_fan_frus", "nonfunc_fan_rotors"]
14  * "missing_fan_frus" - Power off due to missing fan enclosures
15  * "nonfunc_fan_rotors" - Power off due to nonfunctional fan
16  rotors([`sensors`](sensors.md))
17* `count` - integer
18  * Number of the configured `cause` instances to begin the power off `type`
19
20### "hard" & "soft" `type` power offs
21* `delay` - integer
22  * Time(in seconds) to delay performing the power off after `count` instances
23  of the `cause` criteria is met.
24* `state` - ["at_pgood", "runtime"] (Optional)
25  * "at_pgood" - At system pgood, the power off rule becomes valid. A power off
26  rule of *"at_pgood"* can halt a system power on if the conditions are met.
27  * "runtime" - At system runtime, the power off rule becomes valid. A power
28  off rule of *"runtime"* only goes into affect after the system reaches
29  runtime. (Default)
30
31### "epow" `type` power offs
32* `service_mode_delay` - integer
33  * Time(in seconds) given before the thermal alert D-Bus property is set to
34  indicate that a power off is imminent if the `count` instances of the `cause`
35  criteria still exists. This timer is canceled when the `count` instances of
36  the `cause` is not longer met.
37* `meltdown_delay` - integer
38  * Time(in seconds) before a hard power off occurs after the
39  `service_mode_delay` timer expires. This timer can not be canceled once
40  started.
41
42## Example
43<pre><code>
44{
45  "fault_handling": [
46    {
47      "num_nonfunc_rotors_before_error": 1,
48      <b><i>"power_off_config": [
49        {
50          "type": "hard",
51          "cause": "missing_fan_frus",
52          "count": 1,
53          "delay": 25,
54          "state": "at_pgood"
55        },
56        {
57          "type": "soft",
58          "cause": "nonfunc_fan_rotors",
59          "count": 2,
60          "delay": 30,
61          "state": "runtime"
62        },
63        {
64          "type": "epow",
65          "cause": "nonfunc_fan_rotors",
66          "count": 3,
67          "service_mode_delay": 300,
68          "meltdown_delay": 300
69        }
70      ]</i></b>
71    }
72  ]
73}
74</code></pre>
75