Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 1 | # 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 Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 7 | - 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 28 | - 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 Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 145 | callback: check power |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 146 | countop: '==' |
| 147 | countbound: 1 |
| 148 | op: '==' |
| 149 | bound: true |
| 150 | |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 151 | - 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 164 | - name: check fans |
| 165 | description: > |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 166 | '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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 168 | class: callback |
| 169 | callback: group |
| 170 | members: |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 171 | - check group presence |
| 172 | - check group functional |
| 173 | - check individual presence |
| 174 | - check individual functional |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 175 | |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 176 | - 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 197 | 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 Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 211 | callback: log and shutdown |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 212 | countop: '<' |
| 213 | countbound: 2 |
| 214 | op: '==' |
| 215 | bound: true |
| 216 | |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 217 | - name: check group functional |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 218 | 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 Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 230 | callback: log and shutdown |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 231 | countop: '>' |
| 232 | countbound: 1 |
| 233 | op: '==' |
| 234 | bound: false |
| 235 | |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 236 | - name: check fan0 presence |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 237 | description: > |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 238 | 'If this condition passes fan0 has been unplugged for more than 20 seconds.' |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 239 | class: condition |
| 240 | condition: count |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 241 | 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 258 | countop: '>' |
| 259 | countbound: 0 |
| 260 | op: '==' |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 261 | 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 316 | |
| 317 | - name: log and shutdown |
| 318 | description: > |
Gunnar Mills | 43bc33d | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 319 | 'Shut the system down, log an event in the journal, and create an |
| 320 | error log.' |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 321 | class: callback |
| 322 | callback: group |
| 323 | members: |
| 324 | - shutdown |
| 325 | - log |
Gunnar Mills | 43bc33d | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 326 | - create shutdown error |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 327 | |
| 328 | - name: shutdown |
| 329 | description: > |
| 330 | 'Shut down the system.' |
| 331 | class: callback |
| 332 | callback: method |
| 333 | service: org.freedesktop.systemd1 |
| 334 | path: /org/freedesktop/systemd1 |
| 335 | interface: org.freedesktop.systemd1.Manager |
| 336 | method: StartUnit |
| 337 | args: |
Matthew Barth | b1e38df | 2017-10-17 09:53:47 -0500 | [diff] [blame] | 338 | - value: obmc-chassis-hard-poweroff@0.target |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 339 | type: string |
| 340 | - value: replace |
| 341 | type: string |
| 342 | |
| 343 | - name: log |
| 344 | description: > |
| 345 | 'Log a shutdown event to the systemd journal.' |
| 346 | class: callback |
| 347 | callback: journal |
| 348 | paths: chassis state |
| 349 | properties: chassis powered |
| 350 | severity: ERR |
| 351 | message: Shutting down system. There are not enough functional fans. |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 352 | |
| 353 | - name: notpresent fan0 error |
| 354 | class: callback |
| 355 | callback: elog |
| 356 | paths: fan0 |
| 357 | properties: fan present |
| 358 | error: xyz::openbmc_project::Inventory::Error::NotPresent |
| 359 | metadata: |
| 360 | - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH |
| 361 | value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0 |
| 362 | type: string |
| 363 | |
| 364 | - name: nonfunctional fan0 error |
| 365 | class: callback |
| 366 | callback: elog |
| 367 | paths: fan0 |
| 368 | properties: fan functional |
| 369 | error: xyz::openbmc_project::Inventory::Error::Nonfunctional |
| 370 | metadata: |
| 371 | - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH |
| 372 | value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0 |
| 373 | type: string |
| 374 | |
| 375 | - name: notpresent fan2 error |
| 376 | class: callback |
| 377 | callback: elog |
| 378 | paths: fan2 |
| 379 | properties: fan present |
| 380 | error: xyz::openbmc_project::Inventory::Error::NotPresent |
| 381 | metadata: |
| 382 | - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH |
| 383 | value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2 |
| 384 | type: string |
| 385 | |
| 386 | - name: nonfunctional fan2 error |
| 387 | class: callback |
| 388 | callback: elog |
| 389 | paths: fan2 |
| 390 | properties: fan functional |
| 391 | error: xyz::openbmc_project::Inventory::Error::Nonfunctional |
| 392 | metadata: |
| 393 | - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH |
| 394 | value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2 |
| 395 | type: string |
| 396 | |
| 397 | - name: notpresent fan3 error |
| 398 | class: callback |
| 399 | callback: elog |
| 400 | paths: fan3 |
| 401 | properties: fan present |
| 402 | error: xyz::openbmc_project::Inventory::Error::NotPresent |
| 403 | metadata: |
| 404 | - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH |
| 405 | value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3 |
| 406 | type: string |
| 407 | |
| 408 | - name: nonfunctional fan3 error |
| 409 | class: callback |
| 410 | callback: elog |
| 411 | paths: fan3 |
| 412 | properties: fan functional |
| 413 | error: xyz::openbmc_project::Inventory::Error::Nonfunctional |
| 414 | metadata: |
| 415 | - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH |
| 416 | value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3 |
| 417 | type: string |
Gunnar Mills | 43bc33d | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 418 | |
| 419 | - name: create shutdown error |
| 420 | description: > |
| 421 | 'Create a Fan Shutdown Error log.' |
| 422 | class: callback |
| 423 | callback: elog |
| 424 | paths: chassis state |
| 425 | properties: chassis powered |
| 426 | error: xyz::openbmc_project::State::Shutdown::Inventory::Error::Fan |