blob: 3ee490f9ee945cff9f8266711dd088145c2cdd41 [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
Gunnar Mills8587b622017-08-09 12:52:20 -05007- name: fan0
8 class: group
9 group: path
10 members:
11 - meta: FAN
12 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
13
14- name: fan1
15 class: group
16 group: path
17 members:
18 - meta: FAN
19 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
20
21- name: fan2
22 class: group
23 group: path
24 members:
25 - meta: FAN
26 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
27
28- name: fan3
29 class: group
30 group: path
31 members:
32 - meta: FAN
33 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
34
Brad Bishop7d1ec922017-05-31 14:10:55 -040035- name: fans
36 description: >
37 'An air cooled Witherspoon has four fans to monitor.'
38 class: group
39 group: path
40 members:
41 - meta: FAN
42 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
43 - meta: FAN
44 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
45 - meta: FAN
46 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
47 - meta: FAN
48 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
49
50- name: chassis state
51 description: >
52 'Witherspoon has a single chassis to monitor.'
53 class: group
54 group: path
55 members:
56 - meta: CHASSISSTATE
57 path: /xyz/openbmc_project/state/chassis0
58
59- name: chassis
60 description: >
61 'Witherspoon has a single chassis to monitor.'
62 class: group
63 group: path
64 members:
65 - meta: CHASSIS
66 path: /xyz/openbmc_project/inventory/system/chassis
67
68- name: fan present
69 description: >
70 'Monitor the presence state of each fan.'
71 class: group
72 group: property
73 type: boolean
74 members:
75 - interface: xyz.openbmc_project.Inventory.Item
76 meta: PRESENT
77 property: Present
78
79- name: fan functional
80 description: >
81 'Monitor the functional state of each fan.'
82 class: group
83 group: property
84 type: boolean
85 members:
86 - interface: xyz.openbmc_project.State.Decorator.OperationalStatus
87 meta: FUNCTIONAL
88 property: Functional
89
90- name: chassis powered
91 description: >
92 'Monitor the chassis power state.'
93 class: group
94 group: property
95 type: string
96 members:
97 - interface: xyz.openbmc_project.State.Chassis
98 meta: CHASSIS_STATE
99 property: CurrentPowerState
100
101- name: chassis air cooled
102 description: >
103 'Monitor the chassis cooling type.'
104 class: group
105 group: property
106 type: boolean
107 members:
108 - interface: xyz.openbmc_project.Inventory.Decorator.CoolingType
109 meta: COOLING_TYPE
110 property: WaterCooled
111
112- name: watch fan present
113 description: >
114 'Trigger logic on fan presence state changes.'
115 class: watch
116 watch: property
117 paths: fans
118 properties: fan present
119 callback: check cooling type
120
121- name: watch fan functional
122 description: >
123 'Trigger logic on fan functional state changes.'
124 class: watch
125 watch: property
126 paths: fans
127 properties: fan functional
128 callback: check cooling type
129
130- name: watch chassis state
131 description: >
132 'Trigger logic on chassis power state changes.'
133 class: watch
134 watch: property
135 paths: chassis state
136 properties: chassis powered
137 callback: check cooling type
138
139- name: watch cooling type
140 description: >
141 'Maintain a cache of the chassis cooling type.'
142 class: watch
143 watch: property
144 paths: chassis
145 properties: chassis air cooled
146
147- name: check cooling type
148 description: >
149 'If this condition passes the chassis is air cooled.'
150 class: condition
151 condition: count
152 paths: chassis
153 properties: chassis air cooled
Gunnar Mills8587b622017-08-09 12:52:20 -0500154 callback: check power
Brad Bishop7d1ec922017-05-31 14:10:55 -0400155 countop: '=='
156 countbound: 0
157 op: '=='
158 bound: true
159
Gunnar Mills8587b622017-08-09 12:52:20 -0500160- name: check power
161 description: >
162 'If the chassis has power, check fans.'
163 class: condition
164 condition: count
165 paths: chassis state
166 properties: chassis powered
167 callback: check fans
168 countop: '>'
169 countbound: 0
170 op: '=='
171 bound: xyz.openbmc_project.State.Chassis.PowerState.On
172
Brad Bishop7d1ec922017-05-31 14:10:55 -0400173- name: check fans
174 description: >
Gunnar Mills8587b622017-08-09 12:52:20 -0500175 'Verify there are at least three functional fans, power off if not.
176 Create an error if a fan is nonfuncitonal or not present'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400177 class: callback
178 callback: group
179 members:
Gunnar Mills8587b622017-08-09 12:52:20 -0500180 - check group presence
181 - check group functional
182 - check individual presence
183 - check individual functional
Brad Bishop7d1ec922017-05-31 14:10:55 -0400184
Gunnar Mills8587b622017-08-09 12:52:20 -0500185- name: check individual presence
186 description: >
187 'Verify each of the 4 fans are present.'
188 class: callback
189 callback: group
190 members:
191 - check fan0 presence
192 - check fan1 presence
193 - check fan2 presence
194 - check fan3 presence
195
196- name: check individual functional
197 description: >
198 'Verify each of the 4 fans are functional.'
199 class: callback
200 callback: group
201 members:
202 - check fan0 functional
203 - check fan1 functional
204 - check fan2 functional
205 - check fan3 functional
206
207- name: check group presence
Brad Bishop7d1ec922017-05-31 14:10:55 -0400208 description: >
209 'If this condition passes more than one fan has been unplugged
210 for more than 25 seconds. Shut the system down. Count present
211 fans rather than non-present fans since the latter would pass
212 if the fan has not been created for some reason.
213
214 For a more detailed definition of unplugged, consult the documentation
215 of xyz.openbmc_project.Inventory.Item and/or the documentation
216 of the fan inventory object implementation.'
217 class: condition
218 condition: count
219 paths: fans
220 properties: fan present
221 defer: 25000000us
Gunnar Mills8587b622017-08-09 12:52:20 -0500222 callback: log and shutdown
Brad Bishop7d1ec922017-05-31 14:10:55 -0400223 countop: '<'
224 countbound: 3
225 op: '=='
226 bound: true
227
Gunnar Mills8587b622017-08-09 12:52:20 -0500228- name: check group functional
Brad Bishop7d1ec922017-05-31 14:10:55 -0400229 description: >
230 'If this condition passes more than one fan in the group has been
231 marked as nonfunctional for five seconds. Shut the system down.
232
233 For a more detailed definition of nonfunctional, consult the documentation
234 of xyz.openbmc_project.State.Decorator.OperationalStatus and/or the
235 documentation of the fan inventory object implementation.'
236 class: condition
237 condition: count
238 paths: fans
239 properties: fan functional
240 defer: 5000000us
Gunnar Mills8587b622017-08-09 12:52:20 -0500241 callback: log and shutdown
Brad Bishop7d1ec922017-05-31 14:10:55 -0400242 countop: '>'
243 countbound: 1
244 op: '=='
245 bound: false
246
Gunnar Mills8587b622017-08-09 12:52:20 -0500247- name: check fan0 presence
Brad Bishop7d1ec922017-05-31 14:10:55 -0400248 description: >
Gunnar Mills8587b622017-08-09 12:52:20 -0500249 'If this condition passes fan0 has been unplugged for more than 20 seconds.'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400250 class: condition
251 condition: count
Gunnar Mills8587b622017-08-09 12:52:20 -0500252 paths: fan0
253 properties: fan present
254 defer: 20000000us
255 callback: notpresent fan0 error
256 countop: '<'
257 countbound: 1
258 op: '=='
259 bound: true
260
261- name: check fan0 functional
262 description: >
263 'If this condition passes fan0 has been marked as nonfunctional.'
264 class: condition
265 condition: count
266 paths: fan0
267 properties: fan functional
268 callback: nonfunctional fan0 error
Brad Bishop7d1ec922017-05-31 14:10:55 -0400269 countop: '>'
270 countbound: 0
271 op: '=='
Gunnar Mills8587b622017-08-09 12:52:20 -0500272 bound: false
273
274- name: check fan1 presence
275 description: >
276 'If this condition passes fan1 has been unplugged for more than 20 seconds.'
277 class: condition
278 condition: count
279 paths: fan1
280 properties: fan present
281 defer: 20000000us
282 callback: notpresent fan1 error
283 countop: '<'
284 countbound: 1
285 op: '=='
286 bound: true
287
288- name: check fan1 functional
289 description: >
290 'If this condition passes fan1 has been marked as nonfunctional.'
291 class: condition
292 condition: count
293 paths: fan1
294 properties: fan functional
295 callback: nonfunctional fan1 error
296 countop: '>'
297 countbound: 0
298 op: '=='
299 bound: false
300
301- name: check fan2 presence
302 description: >
303 'If this condition passes fan2 has been unplugged for more than 20 seconds.'
304 class: condition
305 condition: count
306 paths: fan2
307 properties: fan present
308 defer: 20000000us
309 callback: notpresent fan2 error
310 countop: '<'
311 countbound: 1
312 op: '=='
313 bound: true
314
315- name: check fan2 functional
316 description: >
317 'If this condition passes fan2 has been marked as nonfunctional.'
318 class: condition
319 condition: count
320 paths: fan2
321 properties: fan functional
322 callback: nonfunctional fan2 error
323 countop: '>'
324 countbound: 0
325 op: '=='
326 bound: false
327
328- name: check fan3 presence
329 description: >
330 'If this condition passes fan3 has been unplugged for more than 20 seconds.'
331 class: condition
332 condition: count
333 paths: fan3
334 properties: fan present
335 defer: 20000000us
336 callback: notpresent fan3 error
337 countop: '<'
338 countbound: 1
339 op: '=='
340 bound: true
341
342- name: check fan3 functional
343 description: >
344 'If this condition passes fan3 has been marked as nonfunctional.'
345 class: condition
346 condition: count
347 paths: fan3
348 properties: fan functional
349 callback: nonfunctional fan3 error
350 countop: '>'
351 countbound: 0
352 op: '=='
353 bound: false
Brad Bishop7d1ec922017-05-31 14:10:55 -0400354
355- name: log and shutdown
356 description: >
Gunnar Mills43bc33d2017-10-13 10:02:07 -0500357 'Shut the system down, log an event in the journal, and create an
358 error log.'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400359 class: callback
360 callback: group
361 members:
362 - shutdown
363 - log
Gunnar Mills43bc33d2017-10-13 10:02:07 -0500364 - create shutdown error
Brad Bishop7d1ec922017-05-31 14:10:55 -0400365
366- name: shutdown
367 description: >
368 'Shut down the system.'
369 class: callback
370 callback: method
371 service: org.freedesktop.systemd1
372 path: /org/freedesktop/systemd1
373 interface: org.freedesktop.systemd1.Manager
374 method: StartUnit
375 args:
Matthew Barthb1e38df2017-10-17 09:53:47 -0500376 - value: obmc-chassis-hard-poweroff@0.target
Brad Bishop7d1ec922017-05-31 14:10:55 -0400377 type: string
378 - value: replace
379 type: string
380
381- name: log
382 description: >
383 'Log a shutdown event to the systemd journal.'
384 class: callback
385 callback: journal
386 paths: chassis state
387 properties: chassis powered
388 severity: ERR
389 message: Shutting down system. There are not enough functional fans.
Gunnar Mills8587b622017-08-09 12:52:20 -0500390
391- name: notpresent fan0 error
392 class: callback
393 callback: elog
394 paths: fan0
395 properties: fan present
396 error: xyz::openbmc_project::Inventory::Error::NotPresent
397 metadata:
398 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
399 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
400 type: string
401
402- name: nonfunctional fan0 error
403 class: callback
404 callback: elog
405 paths: fan0
406 properties: fan functional
407 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
408 metadata:
409 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
410 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
411 type: string
412
413- name: notpresent fan1 error
414 class: callback
415 callback: elog
416 paths: fan1
417 properties: fan present
418 error: xyz::openbmc_project::Inventory::Error::NotPresent
419 metadata:
420 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
421 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
422 type: string
423
424- name: nonfunctional fan1 error
425 class: callback
426 callback: elog
427 paths: fan1
428 properties: fan functional
429 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
430 metadata:
431 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
432 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
433 type: string
434
435- name: notpresent fan2 error
436 class: callback
437 callback: elog
438 paths: fan2
439 properties: fan present
440 error: xyz::openbmc_project::Inventory::Error::NotPresent
441 metadata:
442 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
443 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
444 type: string
445
446- name: nonfunctional fan2 error
447 class: callback
448 callback: elog
449 paths: fan2
450 properties: fan functional
451 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
452 metadata:
453 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
454 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
455 type: string
456
457- name: notpresent fan3 error
458 class: callback
459 callback: elog
460 paths: fan3
461 properties: fan present
462 error: xyz::openbmc_project::Inventory::Error::NotPresent
463 metadata:
464 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
465 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
466 type: string
467
468- name: nonfunctional fan3 error
469 class: callback
470 callback: elog
471 paths: fan3
472 properties: fan functional
473 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
474 metadata:
475 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
476 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
477 type: string
Gunnar Mills43bc33d2017-10-13 10:02:07 -0500478
479- name: create shutdown error
480 description: >
481 'Create a Fan Shutdown Error log.'
482 class: callback
483 callback: elog
484 paths: chassis state
485 properties: chassis powered
486 error: xyz::openbmc_project::State::Shutdown::Inventory::Error::Fan