blob: ec11164d91ad4159047d188f880d639210e652aa [file] [log] [blame]
Brad Bishop7d1ec922017-05-31 14:10:55 -04001# Air cooled Witherspoon fan policy for PDM.
2#
3# An air cooled Witherspoon requires a minimum of three functional fans.
4# If the number of functional fans drops below that
5# power the system off.
6
7- name: fans
8 description: >
9 'An air cooled Witherspoon has four fans to monitor.'
10 class: group
11 group: path
12 members:
13 - meta: FAN
14 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
15 - meta: FAN
16 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
17 - meta: FAN
18 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
19 - meta: FAN
20 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
21
22- name: chassis state
23 description: >
24 'Witherspoon has a single chassis to monitor.'
25 class: group
26 group: path
27 members:
28 - meta: CHASSISSTATE
29 path: /xyz/openbmc_project/state/chassis0
30
31- name: chassis
32 description: >
33 'Witherspoon has a single chassis to monitor.'
34 class: group
35 group: path
36 members:
37 - meta: CHASSIS
38 path: /xyz/openbmc_project/inventory/system/chassis
39
40- name: fan present
41 description: >
42 'Monitor the presence state of each fan.'
43 class: group
44 group: property
45 type: boolean
46 members:
47 - interface: xyz.openbmc_project.Inventory.Item
48 meta: PRESENT
49 property: Present
50
51- name: fan functional
52 description: >
53 'Monitor the functional state of each fan.'
54 class: group
55 group: property
56 type: boolean
57 members:
58 - interface: xyz.openbmc_project.State.Decorator.OperationalStatus
59 meta: FUNCTIONAL
60 property: Functional
61
62- name: chassis powered
63 description: >
64 'Monitor the chassis power state.'
65 class: group
66 group: property
67 type: string
68 members:
69 - interface: xyz.openbmc_project.State.Chassis
70 meta: CHASSIS_STATE
71 property: CurrentPowerState
72
73- name: chassis air cooled
74 description: >
75 'Monitor the chassis cooling type.'
76 class: group
77 group: property
78 type: boolean
79 members:
80 - interface: xyz.openbmc_project.Inventory.Decorator.CoolingType
81 meta: COOLING_TYPE
82 property: WaterCooled
83
84- name: watch fan present
85 description: >
86 'Trigger logic on fan presence state changes.'
87 class: watch
88 watch: property
89 paths: fans
90 properties: fan present
91 callback: check cooling type
92
93- name: watch fan functional
94 description: >
95 'Trigger logic on fan functional state changes.'
96 class: watch
97 watch: property
98 paths: fans
99 properties: fan functional
100 callback: check cooling type
101
102- name: watch chassis state
103 description: >
104 'Trigger logic on chassis power state changes.'
105 class: watch
106 watch: property
107 paths: chassis state
108 properties: chassis powered
109 callback: check cooling type
110
111- name: watch cooling type
112 description: >
113 'Maintain a cache of the chassis cooling type.'
114 class: watch
115 watch: property
116 paths: chassis
117 properties: chassis air cooled
118
119- name: check cooling type
120 description: >
121 'If this condition passes the chassis is air cooled.'
122 class: condition
123 condition: count
124 paths: chassis
125 properties: chassis air cooled
126 callback: check fans
127 countop: '=='
128 countbound: 0
129 op: '=='
130 bound: true
131
132- name: check fans
133 description: >
134 'Verify there are at least three functional fans.'
135 class: callback
136 callback: group
137 members:
138 - check presence
139 - check functional
140
141- name: check presence
142 description: >
143 'If this condition passes more than one fan has been unplugged
144 for more than 25 seconds. Shut the system down. Count present
145 fans rather than non-present fans since the latter would pass
146 if the fan has not been created for some reason.
147
148 For a more detailed definition of unplugged, consult the documentation
149 of xyz.openbmc_project.Inventory.Item and/or the documentation
150 of the fan inventory object implementation.'
151 class: condition
152 condition: count
153 paths: fans
154 properties: fan present
155 defer: 25000000us
156 callback: check power
157 countop: '<'
158 countbound: 3
159 op: '=='
160 bound: true
161
162- name: check functional
163 description: >
164 'If this condition passes more than one fan in the group has been
165 marked as nonfunctional for five seconds. Shut the system down.
166
167 For a more detailed definition of nonfunctional, consult the documentation
168 of xyz.openbmc_project.State.Decorator.OperationalStatus and/or the
169 documentation of the fan inventory object implementation.'
170 class: condition
171 condition: count
172 paths: fans
173 properties: fan functional
174 defer: 5000000us
175 callback: check power
176 countop: '>'
177 countbound: 1
178 op: '=='
179 bound: false
180
181- name: check power
182 description: >
183 'If the chassis has power, power it off.'
184 class: condition
185 condition: count
186 paths: chassis state
187 properties: chassis powered
188 callback: log and shutdown
189 countop: '>'
190 countbound: 0
191 op: '=='
192 bound: xyz.openbmc_project.State.Chassis.PowerState.On
193
194- name: log and shutdown
195 description: >
196 'Shut the system down and log an event.'
197 class: callback
198 callback: group
199 members:
200 - shutdown
201 - log
202
203- name: shutdown
204 description: >
205 'Shut down the system.'
206 class: callback
207 callback: method
208 service: org.freedesktop.systemd1
209 path: /org/freedesktop/systemd1
210 interface: org.freedesktop.systemd1.Manager
211 method: StartUnit
212 args:
213 - value: obmc-host-shutdown@0.target
214 type: string
215 - value: replace
216 type: string
217
218- name: log
219 description: >
220 'Log a shutdown event to the systemd journal.'
221 class: callback
222 callback: journal
223 paths: chassis state
224 properties: chassis powered
225 severity: ERR
226 message: Shutting down system. There are not enough functional fans.