blob: a279cfefa0268491dc1639ebf99df264c77c5cc6 [file] [log] [blame]
Brad Bishop7d1ec922017-05-31 14:10:55 -04001# Water cooled Witherspoon fan policy for PDM.
2#
Matthew Barthc3bc6942017-12-12 13:27:48 -06003# A water cooled Witherspoon requires a minimum of two functional fan
4# enclosures or four functional fan rotors across all enclosures.
5# If the number of functional fan enclosures is below two, soft poweroff
6# the system, whereas if the number of fan rotors drop below four, an
7# immediate hard poweroff of the system occurs.
Brad Bishop7d1ec922017-05-31 14:10:55 -04008
Matthew Barthc3bc6942017-12-12 13:27:48 -06009- name: fan enclosures
Brad Bishop7d1ec922017-05-31 14:10:55 -040010 description: >
Matthew Barthc3bc6942017-12-12 13:27:48 -060011 'A water cooled Witherspoon has three fan enclosures to monitor.'
Brad Bishop7d1ec922017-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/fan2
19 - meta: FAN
20 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
21
Matthew Barthc3bc6942017-12-12 13:27:48 -060022- name: fan rotors
23 description: >
24 'A water cooled Witherspoon has six fan rotors to monitor.'
25 class: group
26 group: path
27 members:
28 - meta: FAN
29 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_0
30 - meta: FAN
31 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_1
32 - meta: FAN
33 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2/fan2_0
34 - meta: FAN
35 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2/fan2_1
36 - meta: FAN
37 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3/fan3_0
38 - meta: FAN
39 path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3/fan3_1
40
Brad Bishop7d1ec922017-05-31 14:10:55 -040041- 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: >
Matthew Barthc3bc6942017-12-12 13:27:48 -0600105 'Trigger logic on fan enclosure presence state changes.'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400106 class: watch
107 watch: property
Matthew Barthc3bc6942017-12-12 13:27:48 -0600108 paths: fan enclosures
Brad Bishop7d1ec922017-05-31 14:10:55 -0400109 properties: fan present
110 callback: check cooling type
111
112- name: watch fan functional
113 description: >
Matthew Barthc3bc6942017-12-12 13:27:48 -0600114 'Trigger logic on fan enclosure functional state changes.'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400115 class: watch
116 watch: property
Matthew Barthc3bc6942017-12-12 13:27:48 -0600117 paths: fan enclosures
118 properties: fan functional
119 callback: check cooling type
120
121- name: watch fan rotor functional
122 description: >
123 'Trigger logic on fan rotor functional state changes.'
124 class: watch
125 watch: property
126 paths: fan rotors
Brad Bishop7d1ec922017-05-31 14:10:55 -0400127 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 water cooled
146
147- name: check cooling type
148 description: >
149 'If this condition passes the chassis is water cooled.'
150 class: condition
151 condition: count
152 paths: chassis
153 properties: chassis water cooled
Gunnar Mills8587b622017-08-09 12:52:20 -0500154 callback: check power
Brad Bishop7d1ec922017-05-31 14:10:55 -0400155 countop: '=='
156 countbound: 1
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: >
Matthew Barthc3bc6942017-12-12 13:27:48 -0600175 'Verify there are at least two functional fan enclosures and at least
176 four functional fan rotors, power off if not.'
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
Matthew Barthc3bc6942017-12-12 13:27:48 -0600181 - check group functional enclosures
182 - check group functional rotors
Gunnar Mills8587b622017-08-09 12:52:20 -0500183
184- name: check group presence
Brad Bishop7d1ec922017-05-31 14:10:55 -0400185 description: >
186 'If this condition passes more than one fan has been unplugged
187 for more than 25 seconds. Shut the system down. Count present
188 fans rather than non-present fans since the latter would pass
189 if the fan has not been created for some reason.
190
191 For a more detailed definition of unplugged, consult the documentation
192 of xyz.openbmc_project.Inventory.Item and/or the documentation
193 of the fan inventory object implementation.'
194 class: condition
195 condition: count
Matthew Barthc3bc6942017-12-12 13:27:48 -0600196 paths: fan enclosures
Brad Bishop7d1ec922017-05-31 14:10:55 -0400197 properties: fan present
198 defer: 25000000us
Gunnar Mills8587b622017-08-09 12:52:20 -0500199 callback: log and shutdown
Brad Bishop7d1ec922017-05-31 14:10:55 -0400200 countop: '<'
201 countbound: 2
202 op: '=='
203 bound: true
204
Matthew Barthc3bc6942017-12-12 13:27:48 -0600205- name: check group functional enclosures
Brad Bishop7d1ec922017-05-31 14:10:55 -0400206 description: >
Matthew Barthc3bc6942017-12-12 13:27:48 -0600207 'If this condition passes more than one fan enclosure in the group has been
Matthew Barth40d95052018-05-22 16:33:45 -0500208 marked as nonfunctional for five seconds. Shut the system down.
Brad Bishop7d1ec922017-05-31 14:10:55 -0400209
210 For a more detailed definition of nonfunctional, consult the documentation
211 of xyz.openbmc_project.State.Decorator.OperationalStatus and/or the
212 documentation of the fan inventory object implementation.'
213 class: condition
214 condition: count
Matthew Barthc3bc6942017-12-12 13:27:48 -0600215 paths: fan enclosures
Brad Bishop7d1ec922017-05-31 14:10:55 -0400216 properties: fan functional
Matthew Barth40d95052018-05-22 16:33:45 -0500217 defer: 5000000us
Gunnar Mills8587b622017-08-09 12:52:20 -0500218 callback: log and shutdown
Brad Bishop7d1ec922017-05-31 14:10:55 -0400219 countop: '>'
220 countbound: 1
221 op: '=='
222 bound: false
223
Matthew Barthc3bc6942017-12-12 13:27:48 -0600224- name: check group functional rotors
225 description: >
226 'If this condition passes more than two fan rotors in the group have been
227 marked as nonfunctional for five seconds. Immediately power off.
228
229 For a more detailed definition of nonfunctional, consult the documentation
230 of xyz.openbmc_project.State.Decorator.OperationalStatus and/or the
231 documentation of the fan inventory object implementation.'
232 class: condition
233 condition: count
234 paths: fan rotors
235 properties: fan functional
236 defer: 5000000us
237 callback: log and poweroff
238 countop: '>'
239 countbound: 2
240 op: '=='
241 bound: false
242
243- name: log and poweroff
244 description: >
245 'Immediately poweroff, log an event in the journal, and create an
246 error log.'
247 class: callback
248 callback: group
249 members:
250 - hard poweroff
251 - log hard poweroff
252 - create shutdown error
253
Brad Bishop7d1ec922017-05-31 14:10:55 -0400254- name: log and shutdown
255 description: >
Gunnar Mills43bc33d2017-10-13 10:02:07 -0500256 'Shut the system down, log an event in the journal, and create an
257 error log.'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400258 class: callback
259 callback: group
260 members:
261 - shutdown
Matthew Barthc3bc6942017-12-12 13:27:48 -0600262 - log shutdown
Gunnar Mills43bc33d2017-10-13 10:02:07 -0500263 - create shutdown error
Brad Bishop7d1ec922017-05-31 14:10:55 -0400264
Matthew Barthc3bc6942017-12-12 13:27:48 -0600265- name: hard poweroff
Brad Bishop7d1ec922017-05-31 14:10:55 -0400266 description: >
Matthew Barthc3bc6942017-12-12 13:27:48 -0600267 'Immediately power off the system.'
Brad Bishop7d1ec922017-05-31 14:10:55 -0400268 class: callback
269 callback: method
270 service: org.freedesktop.systemd1
271 path: /org/freedesktop/systemd1
272 interface: org.freedesktop.systemd1.Manager
273 method: StartUnit
274 args:
Matthew Barth60d62062017-11-20 14:17:21 -0600275 - value: obmc-chassis-hard-poweroff@0.target
Brad Bishop7d1ec922017-05-31 14:10:55 -0400276 type: string
277 - value: replace
278 type: string
279
Matthew Barthc3bc6942017-12-12 13:27:48 -0600280- name: shutdown
281 description: >
282 'Shut down the system.'
283 class: callback
284 callback: method
285 service: org.freedesktop.systemd1
286 path: /org/freedesktop/systemd1
287 interface: org.freedesktop.systemd1.Manager
288 method: StartUnit
289 args:
290 - value: obmc-host-shutdown@0.target
291 type: string
292 - value: replace
293 type: string
294
295- name: log hard poweroff
296 description: >
297 'Log a hard poweroff event to the systemd journal.'
298 class: callback
299 callback: journal
300 paths: chassis state
301 properties: chassis powered
302 severity: ERR
303 message: Immediate poweroff of system. There are not enough functional fans.
304
305- name: log shutdown
Brad Bishop7d1ec922017-05-31 14:10:55 -0400306 description: >
307 'Log a shutdown event to the systemd journal.'
308 class: callback
309 callback: journal
310 paths: chassis state
311 properties: chassis powered
312 severity: ERR
Matthew Barthc3bc6942017-12-12 13:27:48 -0600313 message: Request shutdown of system. There are not enough functional fans.
Gunnar Mills8587b622017-08-09 12:52:20 -0500314
Gunnar Mills43bc33d2017-10-13 10:02:07 -0500315- name: create shutdown error
316 description: >
317 'Create a Fan Shutdown Error log.'
318 class: callback
319 callback: elog
320 paths: chassis state
321 properties: chassis powered
322 error: xyz::openbmc_project::State::Shutdown::Inventory::Error::Fan