Changes ONTAP, MegaRAID, SMI-S plugins to follow this definition:
* When RAID degraded, the Pool.status should be:
Pool.STATUS_OK | Pool.STATUS_DEGRADED
* When RAID is rebuilding:
Pool.STATUS_RECONSTRUCTING | Pool.STATUS_DEGRADED | Pool.STATUS_OK
* When RAID is verifying data:
Pool.STATUS_OK | Pool.STATUS_VERIFYING
Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 7 +++----
plugin/ontap/ontap.py | 16 +++++++++-------
plugin/smispy/smis_pool.py | 2 +-
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 775612a..7fd2760 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -140,12 +140,11 @@ def _mega_size_to_lsm(mega_size):
_POOL_STATUS_MAP = {
'Onln': Pool.STATUS_OK,
- 'Dgrd': Pool.STATUS_DEGRADED,
- 'Pdgd': Pool.STATUS_DEGRADED,
+ 'Dgrd': Pool.STATUS_DEGRADED | Pool.STATUS_OK,
+ 'Pdgd': Pool.STATUS_DEGRADED | Pool.STATUS_OK,
'Offln': Pool.STATUS_ERROR,
- 'Rbld': Pool.STATUS_RECONSTRUCTING,
+ 'Rbld': Pool.STATUS_RECONSTRUCTING | Pool.STATUS_DEGRADED | Pool.STATUS_OK,
'Optl': Pool.STATUS_OK,
- # TODO(Gris Ge): The 'Optl' is undocumented, check with LSI.
}
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index d13490d..f6f309d 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -328,18 +328,20 @@ def volumes(self, search_key=None, search_value=None, flags=0):
# https://library.netapp.com/ecmdocs/ECMP1196890/html/man1/na_aggr.1.html
_AGGR_RAID_STATUS_CONV = {
'normal': Pool.STATUS_OK,
- 'verifying': Pool.STATUS_VERIFYING,
+ 'verifying': Pool.STATUS_OK | Pool.STATUS_VERIFYING,
'copying': Pool.STATUS_INITIALIZING,
- 'ironing': Pool.STATUS_VERIFYING,
- 'resyncing': Pool.STATUS_RECONSTRUCTING,
- 'mirror degraded': Pool.STATUS_DEGRADED,
+ 'ironing': Pool.STATUS_OK | Pool.STATUS_VERIFYING,
+ 'resyncing': Pool.STATUS_OK | Pool.STATUS_DEGRADED |
+ Pool.STATUS_RECONSTRUCTING,
+ 'mirror degraded': Pool.STATUS_OK | Pool.STATUS_DEGRADED,
'needs check': Pool.STATUS_ERROR,
'initializing': Pool.STATUS_INITIALIZING,
- 'growing': Pool.STATUS_GROWING,
+ 'growing': Pool.STATUS_OK | Pool.STATUS_GROWING,
'partial': Pool.STATUS_ERROR,
'noparity': Pool.STATUS_OTHER,
- 'degraded': Pool.STATUS_DEGRADED,
- 'reconstruct': Pool.STATUS_RECONSTRUCTING,
+ 'degraded': Pool.STATUS_OK | Pool.STATUS_DEGRADED,
+ 'reconstruct': Pool.STATUS_OK | Pool.STATUS_DEGRADED |
+ Pool.STATUS_RECONSTRUCTING,
'out-of-date': Pool.STATUS_OTHER,
'foreign': Pool.STATUS_OTHER,
}
diff --git a/plugin/smispy/smis_pool.py b/plugin/smispy/smis_pool.py
index cb06867..d7b599d 100644
--- a/plugin/smispy/smis_pool.py
+++ b/plugin/smispy/smis_pool.py
@@ -186,7 +186,7 @@ def _pool_element_type(smis_common, cim_pool):
_LSM_POOL_OP_STATUS_CONV = {
dmtf.OP_STATUS_OK: Pool.STATUS_OK,
dmtf.OP_STATUS_ERROR: Pool.STATUS_ERROR,
- dmtf.OP_STATUS_DEGRADED: Pool.STATUS_DEGRADED,
+ dmtf.OP_STATUS_DEGRADED: Pool.STATUS_OK | Pool.STATUS_DEGRADED,
dmtf.OP_STATUS_NON_RECOVERABLE_ERROR: Pool.STATUS_ERROR,
dmtf.OP_STATUS_SUPPORTING_ENTITY_IN_ERROR: Pool.STATUS_ERROR,
}
--
1.8.3.1