Skip to content

Commit

Permalink
Megaraid: Handle missing 'Enable JBOD' in 'Capabilities'
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Asleson <[email protected]>
  • Loading branch information
tasleson committed Jan 24, 2023
1 parent d6f4445 commit a9a3f14
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions plugin/megaraid_plugin/megaraid.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,13 +532,24 @@ def systems(self, flags=Client.FLAG_RSVD):
ctrl_show_all_output["Version"]["Bios Version"],
ctrl_show_all_output["Version"]["Firmware Version"])

if ctrl_show_all_output["Capabilities"]["Enable JBOD"] == "Yes":
mode = System.MODE_HBA
if "Capabilities" in ctrl_show_all_output and \
"Enable JBOD" in ctrl_show_all_output["Capabilities"]:

if ctrl_show_all_output["Capabilities"]["Enable JBOD"] == "Yes":
mode = System.MODE_HBA
else:
mode = System.MODE_HARDWARE_RAID
# Notes for JBOD/HBA mode of MegaRAID:
# "storcli /c0/e9/s1 set jbod" require "storcli /c0 set jbod=on"
# be executed first.
elif "Status" in ctrl_show_all_output and \
"Current Personality" in ctrl_show_all_output["Status"]:
if ctrl_show_all_output["Status"]["Current Personality"] == "HBA-Mode ":
mode = System.MODE_HBA
else:
mode = System.MODE_HBA
else:
mode = System.MODE_HARDWARE_RAID
# Notes for JBOD/HBA mode of MegaRAID:
# "storcli /c0/e9/s1 set jbod" require "storcli /c0 set jbod=on"
# be excuted first.
mode = System.MODE_UNKNOWN

rc_lsm_syss.append(
System(sys_id,
Expand Down

0 comments on commit a9a3f14

Please sign in to comment.