blob: d60aa9179a99768308c035471277565db5fcd49a [file] [log] [blame]
Brad Bishopff463bf2017-05-31 14:10:55 -04001# Air cooled Witherspoon fan policy for PDM.
2#
Matthew Barthaa229642017-12-12 13:27:48 -06003# An air cooled Witherspoon requires a minimum of three functional fans
4# enclosures or six functional fan rotors across all enclosures.
5# If the number of functional fan enclosures is below three, soft poweroff
6# the system, whereas if the number of fan rotors drop below six, an
7# immediate hard poweroff of the system occurs.
Brad Bishopff463bf2017-05-31 14:10:55 -04008
Matthew Barthaa229642017-12-12 13:27:48 -06009- name: fan enclosures
Brad Bishopff463bf2017-05-31 14:10:55 -040010 description: >
Matthew Barthaa229642017-12-12 13:27:48 -060011 'An air cooled Witherspoon has four fan enclosures to monitor.'
Brad Bishopff463bf2017-05-31 14:10:55 -040012 class: group
13 group: path
14 members:
15 - meta: FAN
16 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
17 - meta: FAN
18 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
19 - meta: FAN
20 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
21 - meta: FAN
22 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
23
Matthew Barthaa229642017-12-12 13:27:48 -060024- name: fan rotors
25 description: >
26 'An air cooled Witherspoon has eight fan rotors to monitor.'
27 class: group
28 group: path
29 members:
30 - meta: FAN
31 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_0
32 - meta: FAN
33 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_1
34 - meta: FAN
35 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1/fan1_0
36 - meta: FAN
37 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1/fan1_1
38 - meta: FAN
39 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2/fan2_0
40 - meta: FAN
41 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2/fan2_1
42 - meta: FAN
43 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3/fan3_0
44 - meta: FAN
45 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3/fan3_1
46
Brad Bishopff463bf2017-05-31 14:10:55 -040047- name: chassis state
48 description: >
49 'Witherspoon has a single chassis to monitor.'
50 class: group
51 group: path
52 members:
53 - meta: CHASSISSTATE
54 path: /xyz/openbmc_project/state/chassis0
55
56- name: chassis
57 description: >
58 'Witherspoon has a single chassis to monitor.'
59 class: group
60 group: path
61 members:
62 - meta: CHASSIS
63 path: /xyz/openbmc_project/inventory/system/chassis
64
65- name: fan present
66 description: >
67 'Monitor the presence state of each fan.'
68 class: group
69 group: property
70 type: boolean
71 members:
72 - interface: xyz.openbmc_project.Inventory.Item
73 meta: PRESENT
74 property: Present
75
76- name: fan functional
77 description: >
78 'Monitor the functional state of each fan.'
79 class: group
80 group: property
81 type: boolean
82 members:
83 - interface: xyz.openbmc_project.State.Decorator.OperationalStatus
84 meta: FUNCTIONAL
85 property: Functional
86
87- name: chassis powered
88 description: >
89 'Monitor the chassis power state.'
90 class: group
91 group: property
92 type: string
93 members:
94 - interface: xyz.openbmc_project.State.Chassis
95 meta: CHASSIS_STATE
96 property: CurrentPowerState
97
98- name: chassis air cooled
99 description: >
100 'Monitor the chassis cooling type.'
101 class: group
102 group: property
103 type: boolean
104 members:
105 - interface: xyz.openbmc_project.Inventory.Decorator.CoolingType
106 meta: COOLING_TYPE
107 property: WaterCooled
108
109- name: watch fan present
110 description: >
Matthew Barthaa229642017-12-12 13:27:48 -0600111 'Trigger logic on fan enclosure presence state changes.'
Brad Bishopff463bf2017-05-31 14:10:55 -0400112 class: watch
113 watch: property
Matthew Barthaa229642017-12-12 13:27:48 -0600114 paths: fan enclosures
Brad Bishopff463bf2017-05-31 14:10:55 -0400115 properties: fan present
116 callback: check cooling type
117
118- name: watch fan functional
119 description: >
Matthew Barthaa229642017-12-12 13:27:48 -0600120 'Trigger logic on fan enclosure functional state changes.'
Brad Bishopff463bf2017-05-31 14:10:55 -0400121 class: watch
122 watch: property
Matthew Barthaa229642017-12-12 13:27:48 -0600123 paths: fan enclosures
124 properties: fan functional
125 callback: check cooling type
126
127- name: watch fan rotor functional
128 description: >
129 'Trigger logic on fan rotor functional state changes.'
130 class: watch
131 watch: property
132 paths: fan rotors
Brad Bishopff463bf2017-05-31 14:10:55 -0400133 properties: fan functional
134 callback: check cooling type
135
136- name: watch chassis state
137 description: >
138 'Trigger logic on chassis power state changes.'
139 class: watch
140 watch: property
141 paths: chassis state
142 properties: chassis powered
143 callback: check cooling type
144
145- name: watch cooling type
146 description: >
147 'Maintain a cache of the chassis cooling type.'
148 class: watch
149 watch: property
150 paths: chassis
151 properties: chassis air cooled
152
153- name: check cooling type
154 description: >
155 'If this condition passes the chassis is air cooled.'
156 class: condition
157 condition: count
158 paths: chassis
159 properties: chassis air cooled
Gunnar Mills0ef5e442017-08-09 12:52:20 -0500160 callback: check power
Brad Bishopff463bf2017-05-31 14:10:55 -0400161 countop: '=='
162 countbound: 0
163 op: '=='
164 bound: true
165
Gunnar Mills0ef5e442017-08-09 12:52:20 -0500166- name: check power
167 description: >
168 'If the chassis has power, check fans.'
169 class: condition
170 condition: count
171 paths: chassis state
172 properties: chassis powered
173 callback: check fans
174 countop: '>'
175 countbound: 0
176 op: '=='
177 bound: xyz.openbmc_project.State.Chassis.PowerState.On
178
Brad Bishopff463bf2017-05-31 14:10:55 -0400179- name: check fans
180 description: >
Matthew Barthaa229642017-12-12 13:27:48 -0600181 'Verify there are at least three functional fan enclosures and at least
182 six functional fan rotors, power off if not.'
Brad Bishopff463bf2017-05-31 14:10:55 -0400183 class: callback
184 callback: group
185 members:
Gunnar Mills0ef5e442017-08-09 12:52:20 -0500186 - check group presence
Matthew Barthaa229642017-12-12 13:27:48 -0600187 - check group functional enclosures
188 - check group functional rotors
Gunnar Mills0ef5e442017-08-09 12:52:20 -0500189
190- name: check group presence
Brad Bishopff463bf2017-05-31 14:10:55 -0400191 description: >
192 'If this condition passes more than one fan has been unplugged
193 for more than 25 seconds. Shut the system down. Count present
194 fans rather than non-present fans since the latter would pass
195 if the fan has not been created for some reason.
196
197 For a more detailed definition of unplugged, consult the documentation
198 of xyz.openbmc_project.Inventory.Item and/or the documentation
199 of the fan inventory object implementation.'
200 class: condition
201 condition: count
Matthew Barthaa229642017-12-12 13:27:48 -0600202 paths: fan enclosures
Brad Bishopff463bf2017-05-31 14:10:55 -0400203 properties: fan present
204 defer: 25000000us
Gunnar Mills0ef5e442017-08-09 12:52:20 -0500205 callback: log and shutdown
Brad Bishopff463bf2017-05-31 14:10:55 -0400206 countop: '<'
207 countbound: 3
208 op: '=='
209 bound: true
210
Matthew Barthaa229642017-12-12 13:27:48 -0600211- name: check group functional enclosures
Brad Bishopff463bf2017-05-31 14:10:55 -0400212 description: >
Matthew Barthaa229642017-12-12 13:27:48 -0600213 'If this condition passes more than one fan enclosure in the group has been
Matthew Barth5e0a7312018-05-22 16:33:45 -0500214 marked as nonfunctional for five seconds. Shut the system down.
Brad Bishopff463bf2017-05-31 14:10:55 -0400215
216 For a more detailed definition of nonfunctional, consult the documentation
217 of xyz.openbmc_project.State.Decorator.OperationalStatus and/or the
218 documentation of the fan inventory object implementation.'
219 class: condition
220 condition: count
Matthew Barthaa229642017-12-12 13:27:48 -0600221 paths: fan enclosures
Brad Bishopff463bf2017-05-31 14:10:55 -0400222 properties: fan functional
Matthew Barth5e0a7312018-05-22 16:33:45 -0500223 defer: 5000000us
Gunnar Mills0ef5e442017-08-09 12:52:20 -0500224 callback: log and shutdown
Brad Bishopff463bf2017-05-31 14:10:55 -0400225 countop: '>'
226 countbound: 1
227 op: '=='
228 bound: false
229
Matthew Barthaa229642017-12-12 13:27:48 -0600230- name: check group functional rotors
231 description: >
232 'If this condition passes more than two fan rotors in the group have been
233 marked as nonfunctional for five seconds. Immediately power off.
234
235 For a more detailed definition of nonfunctional, consult the documentation
236 of xyz.openbmc_project.State.Decorator.OperationalStatus and/or the
237 documentation of the fan inventory object implementation.'
238 class: condition
239 condition: count
240 paths: fan rotors
241 properties: fan functional
242 defer: 5000000us
243 callback: log and poweroff
244 countop: '>'
245 countbound: 2
246 op: '=='
247 bound: false
248
249- name: log and poweroff
250 description: >
251 'Immediately poweroff, log an event in the journal, and create an
252 error log.'
253 class: callback
254 callback: group
255 members:
256 - hard poweroff
257 - log hard poweroff
258 - create shutdown error
259
Brad Bishopff463bf2017-05-31 14:10:55 -0400260- name: log and shutdown
261 description: >
Gunnar Millsa5527812017-10-13 10:02:07 -0500262 'Shut the system down, log an event in the journal, and create an
263 error log.'
Brad Bishopff463bf2017-05-31 14:10:55 -0400264 class: callback
265 callback: group
266 members:
267 - shutdown
Matthew Barthaa229642017-12-12 13:27:48 -0600268 - log shutdown
Gunnar Millsa5527812017-10-13 10:02:07 -0500269 - create shutdown error
Brad Bishopff463bf2017-05-31 14:10:55 -0400270
Matthew Barthaa229642017-12-12 13:27:48 -0600271- name: hard poweroff
Brad Bishopff463bf2017-05-31 14:10:55 -0400272 description: >
Matthew Barthaa229642017-12-12 13:27:48 -0600273 'Immediately power off the system.'
Brad Bishopff463bf2017-05-31 14:10:55 -0400274 class: callback
275 callback: method
276 service: org.freedesktop.systemd1
277 path: /org/freedesktop/systemd1
278 interface: org.freedesktop.systemd1.Manager
279 method: StartUnit
280 args:
Matthew Barthf0bf1a22017-11-20 14:17:21 -0600281 - value: obmc-chassis-hard-poweroff@0.target
Brad Bishopff463bf2017-05-31 14:10:55 -0400282 type: string
283 - value: replace
284 type: string
285
Matthew Barthaa229642017-12-12 13:27:48 -0600286- name: shutdown
287 description: >
288 'Shut down the system.'
289 class: callback
290 callback: method
291 service: org.freedesktop.systemd1
292 path: /org/freedesktop/systemd1
293 interface: org.freedesktop.systemd1.Manager
294 method: StartUnit
295 args:
296 - value: obmc-host-shutdown@0.target
297 type: string
298 - value: replace
299 type: string
300
301- name: log hard poweroff
302 description: >
303 'Log a hard poweroff event to the systemd journal.'
304 class: callback
305 callback: journal
306 paths: chassis state
307 properties: chassis powered
308 severity: ERR
309 message: Immediate poweroff of system. There are not enough functional fans.
310
311- name: log shutdown
Brad Bishopff463bf2017-05-31 14:10:55 -0400312 description: >
313 'Log a shutdown event to the systemd journal.'
314 class: callback
315 callback: journal
316 paths: chassis state
317 properties: chassis powered
318 severity: ERR
Matthew Barthaa229642017-12-12 13:27:48 -0600319 message: Request shutdown of system. There are not enough functional fans.
Gunnar Mills0ef5e442017-08-09 12:52:20 -0500320
Gunnar Millsa5527812017-10-13 10:02:07 -0500321- name: create shutdown error
322 description: >
323 'Create a Fan Shutdown Error log.'
324 class: callback
325 callback: elog
326 paths: chassis state
327 properties: chassis powered
328 error: xyz::openbmc_project::State::Shutdown::Inventory::Error::Fan