blob: 95323feb7ee5f4f65013a522fafa080b3cb46b9e [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: >
357 'Shut the system down and log an event.'
358 class: callback
359 callback: group
360 members:
361 - shutdown
362 - log
363
364- name: shutdown
365 description: >
366 'Shut down the system.'
367 class: callback
368 callback: method
369 service: org.freedesktop.systemd1
370 path: /org/freedesktop/systemd1
371 interface: org.freedesktop.systemd1.Manager
372 method: StartUnit
373 args:
374 - value: obmc-host-shutdown@0.target
375 type: string
376 - value: replace
377 type: string
378
379- name: log
380 description: >
381 'Log a shutdown event to the systemd journal.'
382 class: callback
383 callback: journal
384 paths: chassis state
385 properties: chassis powered
386 severity: ERR
387 message: Shutting down system. There are not enough functional fans.
Gunnar Mills8587b622017-08-09 12:52:20 -0500388
389- name: notpresent fan0 error
390 class: callback
391 callback: elog
392 paths: fan0
393 properties: fan present
394 error: xyz::openbmc_project::Inventory::Error::NotPresent
395 metadata:
396 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
397 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
398 type: string
399
400- name: nonfunctional fan0 error
401 class: callback
402 callback: elog
403 paths: fan0
404 properties: fan functional
405 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
406 metadata:
407 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
408 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
409 type: string
410
411- name: notpresent fan1 error
412 class: callback
413 callback: elog
414 paths: fan1
415 properties: fan present
416 error: xyz::openbmc_project::Inventory::Error::NotPresent
417 metadata:
418 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
419 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
420 type: string
421
422- name: nonfunctional fan1 error
423 class: callback
424 callback: elog
425 paths: fan1
426 properties: fan functional
427 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
428 metadata:
429 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
430 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
431 type: string
432
433- name: notpresent fan2 error
434 class: callback
435 callback: elog
436 paths: fan2
437 properties: fan present
438 error: xyz::openbmc_project::Inventory::Error::NotPresent
439 metadata:
440 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
441 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
442 type: string
443
444- name: nonfunctional fan2 error
445 class: callback
446 callback: elog
447 paths: fan2
448 properties: fan functional
449 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
450 metadata:
451 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
452 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
453 type: string
454
455- name: notpresent fan3 error
456 class: callback
457 callback: elog
458 paths: fan3
459 properties: fan present
460 error: xyz::openbmc_project::Inventory::Error::NotPresent
461 metadata:
462 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
463 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
464 type: string
465
466- name: nonfunctional fan3 error
467 class: callback
468 callback: elog
469 paths: fan3
470 properties: fan functional
471 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
472 metadata:
473 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
474 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
475 type: string