Create Witherspoon fan errors
Moved the code to create NotPresent and Nonfunctional errors to a new
yaml, fan-errors.yaml.
Fixed the problem with duplicate errors, caused by a 2nd fan
going nonfunctional or not present which would create a 2nd error
for the 1st fan previously nonfunctional or not present.
Create a notpresent error if fan 0, 1, 2, or 3 is not present for more
than 20 seconds. Create a Nonfunctional error if fan 0, 1, 2, or 3 is not
functional for any amount of time.
The system must be powered on in both of these cases.
If a water cooled system, don't create errors for fan 1.
An error is created each time the chassis powers on if a fan is
removed or nonfunctional.
Resolves openbmc/openbmc#2472
Change-Id: Ibd71bf3a3b2381df623e7310a510a2f044c525e4
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-policy/air-cooled.yaml b/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-policy/air-cooled.yaml
index 3ee490f..449a77d 100644
--- a/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-policy/air-cooled.yaml
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-policy/air-cooled.yaml
@@ -4,34 +4,6 @@
# If the number of functional fans drops below that
# power the system off.
-- name: fan0
- class: group
- group: path
- members:
- - meta: FAN
- path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
-
-- name: fan1
- class: group
- group: path
- members:
- - meta: FAN
- path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
-
-- name: fan2
- class: group
- group: path
- members:
- - meta: FAN
- path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
-
-- name: fan3
- class: group
- group: path
- members:
- - meta: FAN
- path: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
-
- name: fans
description: >
'An air cooled Witherspoon has four fans to monitor.'
@@ -172,37 +144,12 @@
- name: check fans
description: >
- 'Verify there are at least three functional fans, power off if not.
- Create an error if a fan is nonfuncitonal or not present'
+ 'Verify there are at least three functional fans, power off if not.'
class: callback
callback: group
members:
- check group presence
- check group functional
- - check individual presence
- - check individual functional
-
-- name: check individual presence
- description: >
- 'Verify each of the 4 fans are present.'
- class: callback
- callback: group
- members:
- - check fan0 presence
- - check fan1 presence
- - check fan2 presence
- - check fan3 presence
-
-- name: check individual functional
- description: >
- 'Verify each of the 4 fans are functional.'
- class: callback
- callback: group
- members:
- - check fan0 functional
- - check fan1 functional
- - check fan2 functional
- - check fan3 functional
- name: check group presence
description: >
@@ -244,114 +191,6 @@
op: '=='
bound: false
-- name: check fan0 presence
- description: >
- 'If this condition passes fan0 has been unplugged for more than 20 seconds.'
- class: condition
- condition: count
- paths: fan0
- properties: fan present
- defer: 20000000us
- callback: notpresent fan0 error
- countop: '<'
- countbound: 1
- op: '=='
- bound: true
-
-- name: check fan0 functional
- description: >
- 'If this condition passes fan0 has been marked as nonfunctional.'
- class: condition
- condition: count
- paths: fan0
- properties: fan functional
- callback: nonfunctional fan0 error
- countop: '>'
- countbound: 0
- op: '=='
- bound: false
-
-- name: check fan1 presence
- description: >
- 'If this condition passes fan1 has been unplugged for more than 20 seconds.'
- class: condition
- condition: count
- paths: fan1
- properties: fan present
- defer: 20000000us
- callback: notpresent fan1 error
- countop: '<'
- countbound: 1
- op: '=='
- bound: true
-
-- name: check fan1 functional
- description: >
- 'If this condition passes fan1 has been marked as nonfunctional.'
- class: condition
- condition: count
- paths: fan1
- properties: fan functional
- callback: nonfunctional fan1 error
- countop: '>'
- countbound: 0
- op: '=='
- bound: false
-
-- name: check fan2 presence
- description: >
- 'If this condition passes fan2 has been unplugged for more than 20 seconds.'
- class: condition
- condition: count
- paths: fan2
- properties: fan present
- defer: 20000000us
- callback: notpresent fan2 error
- countop: '<'
- countbound: 1
- op: '=='
- bound: true
-
-- name: check fan2 functional
- description: >
- 'If this condition passes fan2 has been marked as nonfunctional.'
- class: condition
- condition: count
- paths: fan2
- properties: fan functional
- callback: nonfunctional fan2 error
- countop: '>'
- countbound: 0
- op: '=='
- bound: false
-
-- name: check fan3 presence
- description: >
- 'If this condition passes fan3 has been unplugged for more than 20 seconds.'
- class: condition
- condition: count
- paths: fan3
- properties: fan present
- defer: 20000000us
- callback: notpresent fan3 error
- countop: '<'
- countbound: 1
- op: '=='
- bound: true
-
-- name: check fan3 functional
- description: >
- 'If this condition passes fan3 has been marked as nonfunctional.'
- class: condition
- condition: count
- paths: fan3
- properties: fan functional
- callback: nonfunctional fan3 error
- countop: '>'
- countbound: 0
- op: '=='
- bound: false
-
- name: log and shutdown
description: >
'Shut the system down, log an event in the journal, and create an
@@ -388,94 +227,6 @@
severity: ERR
message: Shutting down system. There are not enough functional fans.
-- name: notpresent fan0 error
- class: callback
- callback: elog
- paths: fan0
- properties: fan present
- error: xyz::openbmc_project::Inventory::Error::NotPresent
- metadata:
- - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
- type: string
-
-- name: nonfunctional fan0 error
- class: callback
- callback: elog
- paths: fan0
- properties: fan functional
- error: xyz::openbmc_project::Inventory::Error::Nonfunctional
- metadata:
- - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
- type: string
-
-- name: notpresent fan1 error
- class: callback
- callback: elog
- paths: fan1
- properties: fan present
- error: xyz::openbmc_project::Inventory::Error::NotPresent
- metadata:
- - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
- type: string
-
-- name: nonfunctional fan1 error
- class: callback
- callback: elog
- paths: fan1
- properties: fan functional
- error: xyz::openbmc_project::Inventory::Error::Nonfunctional
- metadata:
- - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
- type: string
-
-- name: notpresent fan2 error
- class: callback
- callback: elog
- paths: fan2
- properties: fan present
- error: xyz::openbmc_project::Inventory::Error::NotPresent
- metadata:
- - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
- type: string
-
-- name: nonfunctional fan2 error
- class: callback
- callback: elog
- paths: fan2
- properties: fan functional
- error: xyz::openbmc_project::Inventory::Error::Nonfunctional
- metadata:
- - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
- type: string
-
-- name: notpresent fan3 error
- class: callback
- callback: elog
- paths: fan3
- properties: fan present
- error: xyz::openbmc_project::Inventory::Error::NotPresent
- metadata:
- - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
- type: string
-
-- name: nonfunctional fan3 error
- class: callback
- callback: elog
- paths: fan3
- properties: fan functional
- error: xyz::openbmc_project::Inventory::Error::Nonfunctional
- metadata:
- - name: xyz::openbmc_project::Inventory::Nonfunctional::CALLOUT_INVENTORY_PATH
- value: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan3
- type: string
-
- name: create shutdown error
description: >
'Create a Fan Shutdown Error log.'