Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 1 | # Air cooled Witherspoon fan policy for PDM. |
| 2 | # |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 3 | # 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 8 | |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 9 | - name: fan enclosures |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 10 | description: > |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 11 | 'An air cooled Witherspoon has four fan enclosures to monitor.' |
Brad Bishop | 7d1ec92 | 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/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 Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 24 | - 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 47 | - 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 Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 111 | 'Trigger logic on fan enclosure presence state changes.' |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 112 | class: watch |
| 113 | watch: property |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 114 | paths: fan enclosures |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 115 | properties: fan present |
| 116 | callback: check cooling type |
| 117 | |
| 118 | - name: watch fan functional |
| 119 | description: > |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 120 | 'Trigger logic on fan enclosure functional state changes.' |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 121 | class: watch |
| 122 | watch: property |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 123 | 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 133 | 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 Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 160 | callback: check power |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 161 | countop: '==' |
| 162 | countbound: 0 |
| 163 | op: '==' |
| 164 | bound: true |
| 165 | |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 166 | - 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 179 | - name: check fans |
| 180 | description: > |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 181 | 'Verify there are at least three functional fan enclosures and at least |
| 182 | six functional fan rotors, power off if not.' |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 183 | class: callback |
| 184 | callback: group |
| 185 | members: |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 186 | - check group presence |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 187 | - check group functional enclosures |
| 188 | - check group functional rotors |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 189 | |
| 190 | - name: check group presence |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 191 | 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 Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 202 | paths: fan enclosures |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 203 | properties: fan present |
| 204 | defer: 25000000us |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 205 | callback: log and shutdown |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 206 | countop: '<' |
| 207 | countbound: 3 |
| 208 | op: '==' |
| 209 | bound: true |
| 210 | |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 211 | - name: check group functional enclosures |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 212 | description: > |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 213 | 'If this condition passes more than one fan enclosure in the group has been |
Matthew Barth | 40d9505 | 2018-05-22 16:33:45 -0500 | [diff] [blame] | 214 | marked as nonfunctional for five seconds. Shut the system down. |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 215 | |
| 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 Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 221 | paths: fan enclosures |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 222 | properties: fan functional |
Matthew Barth | 40d9505 | 2018-05-22 16:33:45 -0500 | [diff] [blame] | 223 | defer: 5000000us |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 224 | callback: log and shutdown |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 225 | countop: '>' |
| 226 | countbound: 1 |
| 227 | op: '==' |
| 228 | bound: false |
| 229 | |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 230 | - 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 260 | - name: log and shutdown |
| 261 | description: > |
Gunnar Mills | 43bc33d | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 262 | 'Shut the system down, log an event in the journal, and create an |
| 263 | error log.' |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 264 | class: callback |
| 265 | callback: group |
| 266 | members: |
| 267 | - shutdown |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 268 | - log shutdown |
Gunnar Mills | 43bc33d | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 269 | - create shutdown error |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 270 | |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 271 | - name: hard poweroff |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 272 | description: > |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 273 | 'Immediately power off the system.' |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 274 | 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 Barth | 60d6206 | 2017-11-20 14:17:21 -0600 | [diff] [blame] | 281 | - value: obmc-chassis-hard-poweroff@0.target |
Brad Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 282 | type: string |
| 283 | - value: replace |
| 284 | type: string |
| 285 | |
Matthew Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 286 | - 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 Bishop | 7d1ec92 | 2017-05-31 14:10:55 -0400 | [diff] [blame] | 312 | 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 Barth | c3bc694 | 2017-12-12 13:27:48 -0600 | [diff] [blame] | 319 | message: Request shutdown of system. There are not enough functional fans. |
Gunnar Mills | 8587b62 | 2017-08-09 12:52:20 -0500 | [diff] [blame] | 320 | |
Gunnar Mills | 43bc33d | 2017-10-13 10:02:07 -0500 | [diff] [blame] | 321 | - 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 |