blob: 7c067920d7511e65ca7f48a13f1729462cb6ae30 [file] [log] [blame]
Brad Bishop7d1ec922017-05-31 14:10:55 -04001# Water cooled Witherspoon fan policy for PDM.
2#
3# A water cooled Witherspoon requires a minimum of two 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: fan2
15 class: group
16 group: path
17 members:
18 - meta: FAN
19 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
20
21- name: fan3
22 class: group
23 group: path
24 members:
25 - meta: FAN
26 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
27
Brad Bishop7d1ec922017-05-31 14:10:55 -040028- name: fans
29 description: >
30 'A water cooled Witherspoon has three fans to monitor.'
31 class: group
32 group: path
33 members:
34 - meta: FAN
35 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
36 - meta: FAN
37 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
38 - meta: FAN
39 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
40
41- name: chassis state
42 description: >
43 'Witherspoon has a single chassis to monitor.'
44 class: group
45 group: path
46 members:
47 - meta: CHASSISSTATE
48 path: /xyz/openbmc_project/state/chassis0
49
50- name: chassis
51 description: >
52 'Witherspoon has a single chassis to monitor.'
53 class: group
54 group: path
55 members:
56 - meta: CHASSIS
57 path: /xyz/openbmc_project/inventory/system/chassis
58
59- name: fan present
60 description: >
61 'Monitor the presence state of each fan.'
62 class: group
63 group: property
64 type: boolean
65 members:
66 - interface: xyz.openbmc_project.Inventory.Item
67 meta: PRESENT
68 property: Present
69
70- name: fan functional
71 description: >
72 'Monitor the functional state of each fan.'
73 class: group
74 group: property
75 type: boolean
76 members:
77 - interface: xyz.openbmc_project.State.Decorator.OperationalStatus
78 meta: FUNCTIONAL
79 property: Functional
80
81- name: chassis powered
82 description: >
83 'Monitor the chassis power state.'
84 class: group
85 group: property
86 type: string
87 members:
88 - interface: xyz.openbmc_project.State.Chassis
89 meta: CHASSIS_STATE
90 property: CurrentPowerState
91
92- name: chassis water cooled
93 description: >
94 'Monitor the chassis cooling type.'
95 class: group
96 group: property
97 type: boolean
98 members:
99 - interface: xyz.openbmc_project.Inventory.Decorator.CoolingType
100 meta: COOLING_TYPE
101 property: WaterCooled
102
103- name: watch fan present
104 description: >
105 'Trigger logic on fan presence state changes.'
106 class: watch
107 watch: property
108 paths: fans
109 properties: fan present
110 callback: check cooling type
111
112- name: watch fan functional
113 description: >
114 'Trigger logic on fan functional state changes.'
115 class: watch
116 watch: property
117 paths: fans
118 properties: fan functional
119 callback: check cooling type
120
121- name: watch chassis state
122 description: >
123 'Trigger logic on chassis power state changes.'
124 class: watch
125 watch: property
126 paths: chassis state
127 properties: chassis powered
128 callback: check cooling type
129
130- name: watch cooling type
131 description: >
132 'Maintain a cache of the chassis cooling type.'
133 class: watch
134 watch: property
135 paths: chassis
136 properties: chassis water cooled
137
138- name: check cooling type
139 description: >
140 'If this condition passes the chassis is water cooled.'
141 class: condition
142 condition: count
143 paths: chassis
144 properties: chassis water cooled
Gunnar Mills8587b622017-08-09 12:52:20 -0500145 callback: check power
Brad Bishop7d1ec922017-05-31 14:10:55 -0400146 countop: '=='
147 countbound: 1
148 op: '=='
149 bound: true
150
Gunnar Mills8587b622017-08-09 12:52:20 -0500151- name: check power
152 description: >
153 'If the chassis has power, check fans.'
154 class: condition
155 condition: count
156 paths: chassis state
157 properties: chassis powered
158 callback: check fans
159 countop: '>'
160 countbound: 0
161 op: '=='
162 bound: xyz.openbmc_project.State.Chassis.PowerState.On
163
Brad Bishop7d1ec922017-05-31 14:10:55 -0400164- name: check fans
165 description: >
Gunnar Mills8587b622017-08-09 12:52:20 -0500166 'Verify there are at least two functional fans, power off if not.
167 Create an error if a fan is nonfuncitonal or not present'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400168 class: callback
169 callback: group
170 members:
Gunnar Mills8587b622017-08-09 12:52:20 -0500171 - check group presence
172 - check group functional
173 - check individual presence
174 - check individual functional
Brad Bishop7d1ec922017-05-31 14:10:55 -0400175
Gunnar Mills8587b622017-08-09 12:52:20 -0500176- name: check individual presence
177 description: >
178 'Verify each of the 3 fans are present.'
179 class: callback
180 callback: group
181 members:
182 - check fan0 presence
183 - check fan2 presence
184 - check fan3 presence
185
186- name: check individual functional
187 description: >
188 'Verify each of the 3 fans are functional.'
189 class: callback
190 callback: group
191 members:
192 - check fan0 functional
193 - check fan2 functional
194 - check fan3 functional
195
196- name: check group presence
Brad Bishop7d1ec922017-05-31 14:10:55 -0400197 description: >
198 'If this condition passes more than one fan has been unplugged
199 for more than 25 seconds. Shut the system down. Count present
200 fans rather than non-present fans since the latter would pass
201 if the fan has not been created for some reason.
202
203 For a more detailed definition of unplugged, consult the documentation
204 of xyz.openbmc_project.Inventory.Item and/or the documentation
205 of the fan inventory object implementation.'
206 class: condition
207 condition: count
208 paths: fans
209 properties: fan present
210 defer: 25000000us
Gunnar Mills8587b622017-08-09 12:52:20 -0500211 callback: log and shutdown
Brad Bishop7d1ec922017-05-31 14:10:55 -0400212 countop: '<'
213 countbound: 2
214 op: '=='
215 bound: true
216
Gunnar Mills8587b622017-08-09 12:52:20 -0500217- name: check group functional
Brad Bishop7d1ec922017-05-31 14:10:55 -0400218 description: >
219 'If this condition passes more than one fan in the group has been marked
220 as nonfunctional for five seconds. Shut the system down.
221
222 For a more detailed definition of nonfunctional, consult the documentation
223 of xyz.openbmc_project.State.Decorator.OperationalStatus and/or the
224 documentation of the fan inventory object implementation.'
225 class: condition
226 condition: count
227 paths: fans
228 properties: fan functional
229 defer: 5000000us
Gunnar Mills8587b622017-08-09 12:52:20 -0500230 callback: log and shutdown
Brad Bishop7d1ec922017-05-31 14:10:55 -0400231 countop: '>'
232 countbound: 1
233 op: '=='
234 bound: false
235
Gunnar Mills8587b622017-08-09 12:52:20 -0500236- name: check fan0 presence
Brad Bishop7d1ec922017-05-31 14:10:55 -0400237 description: >
Gunnar Mills8587b622017-08-09 12:52:20 -0500238 'If this condition passes fan0 has been unplugged for more than 20 seconds.'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400239 class: condition
240 condition: count
Gunnar Mills8587b622017-08-09 12:52:20 -0500241 paths: fan0
242 properties: fan present
243 defer: 20000000us
244 callback: notpresent fan0 error
245 countop: '<'
246 countbound: 1
247 op: '=='
248 bound: true
249
250- name: check fan0 functional
251 description: >
252 'If this condition passes fan0 has been marked as nonfunctional.'
253 class: condition
254 condition: count
255 paths: fan0
256 properties: fan functional
257 callback: nonfunctional fan0 error
Brad Bishop7d1ec922017-05-31 14:10:55 -0400258 countop: '>'
259 countbound: 0
260 op: '=='
Gunnar Mills8587b622017-08-09 12:52:20 -0500261 bound: false
262
263- name: check fan2 presence
264 description: >
265 'If this condition passes fan2 has been unplugged for more than 20 seconds.'
266 class: condition
267 condition: count
268 paths: fan2
269 properties: fan present
270 defer: 20000000us
271 callback: notpresent fan2 error
272 countop: '<'
273 countbound: 1
274 op: '=='
275 bound: true
276
277- name: check fan2 functional
278 description: >
279 'If this condition passes fan2 has been marked as nonfunctional.'
280 class: condition
281 condition: count
282 paths: fan2
283 properties: fan functional
284 callback: nonfunctional fan2 error
285 countop: '>'
286 countbound: 0
287 op: '=='
288 bound: false
289
290- name: check fan3 presence
291 description: >
292 'If this condition passes fan3 has been unplugged for more than 20 seconds.'
293 class: condition
294 condition: count
295 paths: fan3
296 properties: fan present
297 defer: 20000000us
298 callback: notpresent fan3 error
299 countop: '<'
300 countbound: 1
301 op: '=='
302 bound: true
303
304- name: check fan3 functional
305 description: >
306 'If this condition passes fan3 has been marked as nonfunctional.'
307 class: condition
308 condition: count
309 paths: fan3
310 properties: fan functional
311 callback: nonfunctional fan3 error
312 countop: '>'
313 countbound: 0
314 op: '=='
315 bound: false
Brad Bishop7d1ec922017-05-31 14:10:55 -0400316
317- name: log and shutdown
318 description: >
319 'Shut the system down and log an event.'
320 class: callback
321 callback: group
322 members:
323 - shutdown
324 - log
325
326- name: shutdown
327 description: >
328 'Shut down the system.'
329 class: callback
330 callback: method
331 service: org.freedesktop.systemd1
332 path: /org/freedesktop/systemd1
333 interface: org.freedesktop.systemd1.Manager
334 method: StartUnit
335 args:
Matthew Barthb1e38df2017-10-17 09:53:47 -0500336 - value: obmc-chassis-hard-poweroff@0.target
Brad Bishop7d1ec922017-05-31 14:10:55 -0400337 type: string
338 - value: replace
339 type: string
340
341- name: log
342 description: >
343 'Log a shutdown event to the systemd journal.'
344 class: callback
345 callback: journal
346 paths: chassis state
347 properties: chassis powered
348 severity: ERR
349 message: Shutting down system. There are not enough functional fans.
Gunnar Mills8587b622017-08-09 12:52:20 -0500350
351- name: notpresent fan0 error
352 class: callback
353 callback: elog
354 paths: fan0
355 properties: fan present
356 error: xyz::openbmc_project::Inventory::Error::NotPresent
357 metadata:
358 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
359 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
360 type: string
361
362- name: nonfunctional fan0 error
363 class: callback
364 callback: elog
365 paths: fan0
366 properties: fan functional
367 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
368 metadata:
369 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
370 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
371 type: string
372
373- name: notpresent fan2 error
374 class: callback
375 callback: elog
376 paths: fan2
377 properties: fan present
378 error: xyz::openbmc_project::Inventory::Error::NotPresent
379 metadata:
380 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
381 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
382 type: string
383
384- name: nonfunctional fan2 error
385 class: callback
386 callback: elog
387 paths: fan2
388 properties: fan functional
389 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
390 metadata:
391 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
392 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
393 type: string
394
395- name: notpresent fan3 error
396 class: callback
397 callback: elog
398 paths: fan3
399 properties: fan present
400 error: xyz::openbmc_project::Inventory::Error::NotPresent
401 metadata:
402 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
403 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
404 type: string
405
406- name: nonfunctional fan3 error
407 class: callback
408 callback: elog
409 paths: fan3
410 properties: fan functional
411 error: xyz::openbmc_project::Inventory::Error::Nonfunctional
412 metadata:
413 - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
414 value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
415 type: string