Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 1 | # Water cooled Witherspoon fan policy for PDM. |
| 2 | # |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 3 | # 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 Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 8 | |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 9 | - name: fan enclosures |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 10 | description: > |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 11 | 'A water cooled Witherspoon has three fan enclosures to monitor.' |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 12 | 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 Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 22 | - 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 Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 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: > |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 105 | 'Trigger logic on fan enclosure presence state changes.' |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 106 | class: watch |
| 107 | watch: property |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 108 | paths: fan enclosures |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 109 | properties: fan present |
| 110 | callback: check cooling type |
| 111 | |
| 112 | - name: watch fan functional |
| 113 | description: > |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 114 | 'Trigger logic on fan enclosure functional state changes.' |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 115 | class: watch |
| 116 | watch: property |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 117 | 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 Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 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 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 Mills | 0ef5e44 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 154 | callback: check power |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 155 | countop: '==' |
| 156 | countbound: 1 |
| 157 | op: '==' |
| 158 | bound: true |
| 159 | |
Gunnar Mills | 0ef5e44 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 160 | - 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 Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 173 | - name: check fans |
| 174 | description: > |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 175 | 'Verify there are at least two functional fan enclosures and at least |
| 176 | four functional fan rotors, power off if not.' |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 177 | class: callback |
| 178 | callback: group |
| 179 | members: |
Gunnar Mills | 0ef5e44 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 180 | - check group presence |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 181 | - check group functional enclosures |
| 182 | - check group functional rotors |
Gunnar Mills | 0ef5e44 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 183 | |
| 184 | - name: check group presence |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 185 | 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 Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 196 | paths: fan enclosures |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 197 | properties: fan present |
| 198 | defer: 25000000us |
Gunnar Mills | 0ef5e44 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 199 | callback: log and shutdown |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 200 | countop: '<' |
| 201 | countbound: 2 |
| 202 | op: '==' |
| 203 | bound: true |
| 204 | |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 205 | - name: check group functional enclosures |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 206 | description: > |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 207 | 'If this condition passes more than one fan enclosure in the group has been |
Matthew Barth | 5e0a731 | 2018-05-22 16:33:45 -0500 | [diff] [blame] | 208 | marked as nonfunctional for five seconds. Shut the system down. |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 209 | |
| 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 Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 215 | paths: fan enclosures |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 216 | properties: fan functional |
Matthew Barth | 5e0a731 | 2018-05-22 16:33:45 -0500 | [diff] [blame] | 217 | defer: 5000000us |
Gunnar Mills | 0ef5e44 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 218 | callback: log and shutdown |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 219 | countop: '>' |
| 220 | countbound: 1 |
| 221 | op: '==' |
| 222 | bound: false |
| 223 | |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 224 | - 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 Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 254 | - name: log and shutdown |
| 255 | description: > |
Gunnar Mills | a552781 | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 256 | 'Shut the system down, log an event in the journal, and create an |
| 257 | error log.' |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 258 | class: callback |
| 259 | callback: group |
| 260 | members: |
| 261 | - shutdown |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 262 | - log shutdown |
Gunnar Mills | a552781 | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 263 | - create shutdown error |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 264 | |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 265 | - name: hard poweroff |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 266 | description: > |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 267 | 'Immediately power off the system.' |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 268 | 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 Barth | f0bf1a2 | 2017-11-20 14:17:21 -0600 | [diff] [blame] | 275 | - value: obmc-chassis-hard-poweroff@0.target |
Brad Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 276 | type: string |
| 277 | - value: replace |
| 278 | type: string |
| 279 | |
Matthew Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 280 | - 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 Bishop | ff463bf | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 306 | 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 Barth | aa22964 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 313 | message: Request shutdown of system. There are not enough functional fans. |
Gunnar Mills | 0ef5e44 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 314 | |
Gunnar Mills | a552781 | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 315 | - 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 |