Skip to content

Conversation

@raharper
Copy link
Collaborator

@raharper raharper commented Feb 5, 2025

Newer MegaRAID controllers require an updated cli tool, storcli2
These controllers use a new kernel driver, mpi3mr. The partial upside
is that storcli2 does emit JSON output. But as one has come to expect
from LSI/Broadcom/MegaRAID, the output is well... (╯°□°)╯︵ ┻━┻.

The fields change the data types, sometimes there are nested structures
that hold nothing. But it's better than whitespace parsing ¯\(ツ)

  • added go-cmp module
  • dropped the megaraid/storcli interface and utilized the existing
    storcli2 JSON structures. Added some modifications to the
    VirtualDrive structuret to hold all of the data needed to map a
    /dev/sdX device to the VirtualDisk and all properties
  • Added mpi3mr support into the demo binary

Additional Changes:

  • Some initial cleanup commits
    • comment fixes
    • bump golangci-lint version, use default config
    • Handle 'J' output from newer udevadm info command

Signed-off-by: Ryan Harper ryaharpe@cisco.com

@codecov
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 29.81928% with 233 lines in your changes missing coverage. Please review.

Project coverage is 49.36%. Comparing base (247dd95) to head (b624a5c).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
mpi3mr/storcli2.go 37.50% 148 Missing and 7 partials ⚠️
demo/mpi3mr.go 0.00% 57 Missing ⚠️
mpi3mr/mpi3mr.go 0.00% 13 Missing ⚠️
demo/megaraid.go 0.00% 2 Missing ⚠️
linux/disk.go 50.00% 1 Missing and 1 partial ⚠️
linux/util.go 33.33% 2 Missing ⚠️
demo/main.go 0.00% 1 Missing ⚠️
ptimg/main.go 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (247dd95) and HEAD (b624a5c). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (247dd95) HEAD (b624a5c)
3 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #135       +/-   ##
===========================================
- Coverage   66.02%   49.36%   -16.67%     
===========================================
  Files          17       27       +10     
  Lines        2555     3628     +1073     
===========================================
+ Hits         1687     1791      +104     
- Misses        661     1623      +962     
- Partials      207      214        +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@mikemccracken mikemccracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a couple comments about the data structure naming being a little confusing, but don't think it's necessary to change to merge this. I have a feeling the confusion is due to the cursedness of the JSON you're having to deal with as input...

Signed-off-by: Ryan Harper <ryaharpe@cisco.com>
Not sure why we don't use the values in the Makefile to run this
lint, just another place that folks have to know.  =(

Signed-off-by: Ryan Harper <ryaharpe@cisco.com>
Signed-off-by: Ryan Harper <ryaharpe@cisco.com>
Newer MegaRAID controllers require an updated cli tool, storcli2
These controllers use a new kernel driver, mpi3mr.  The partial upside
is that storcli2 does emit JSON output.  But as one has come to expect
from LSI/Broadcom/MegaRAID, the output is well... (╯°□°)╯︵ ┻━┻.

The fields change the data types, sometimes there are nested structures
that hold nothing.  But it's better than whitespace parsing ¯\_(ツ)_/¯

- added go-cmp module
- dropped the megaraid/storcli interface and utilized the existing
  storcli2 JSON structures.  Added some modifications to the
  VirtualDrive structuret to hold all of the data needed to map a
  /dev/sdX device to the VirtualDisk and all properties
- Added mpi3mr support into the demo binary

Signed-off-by: Ryan Harper <ryaharpe@cisco.com>
@raharper raharper force-pushed the feat/add-storcli2-support branch from 0c254ed to b624a5c Compare February 5, 2025 20:29
@raharper
Copy link
Collaborator Author

raharper commented Feb 5, 2025

Thanks @mikemccracken I just squash rebased and signed the commits.

@raharper raharper merged commit f0dbf37 into project-machine:main Feb 5, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants