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