Naudit / pystorcli2

Python library provides wrapper around storcli tool to manage and control LSI MegaRAID controllers.
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

pystorcli2 is incompatible with storcli2/percli2 #20

Open dgilbert101 opened 3 months ago

dgilbert101 commented 3 months ago

I'm encountering more and more raid cards that are only compatible with storcli2/percli2, which is problematic with the current library. For the most part the commands are roughly the same, but the output is different. What do we think is the best way to handle different output like this? It would be relatively simple if the keys were just different in name, but some are nested under varying levels of keys to get the same answer; ie

storcli64 output for getting virtual drive facts

"Response Data" : { "VD0 Properties" : { "Strip Size" : "256 KB",

storcli2 output for getting virtual drive facts

"Response Data" : { "Virtual Drives" : [ { "VD Info" : { "DG/VD" : "0/1", "TYPE" : "RAID6", "State" : "Optl", "Access" : "RW", "CurrentCache" : "NR,AWB", "DefaultCache" : "NR,AWB", "Size" : "392.896 TiB", "Name" : "" }, "PDs" : [ { "EID:Slt" : "355:6", ... "Alt-EID" : "-" } ], "VD Properties" : { "Strip Size" : "256 KiB", "Block Size" : 4096, "Number of Blocks" : 1054674616

Is it best to keep it in the same library? Create a new library? Probably goes along the lines the of the factory pattern conversation and pyarcconf.

ralequi commented 3 months ago

Didn't notice storcli have been replaced that fast with storcli2. All my raid cards still works with storcli64.

The last year, I've been discussing with @ulmitov to provide a single lib that merges all the raid-card controlling software. Probably, this justifies even more to work in that direction. And, of course, a factory pattern here looks a good idea.

I think the real question here is, should we "update" pystorcli to support all of them "transparently" or should we create a new project for this?

dgilbert101 commented 3 months ago

Yeah, its a bigger conversation for certain. I do have a need for something sooner than later, so I might attempt to upgrade the current to check for various keys and such. Whether that gets integrated in now or lives as a separate fork is a conversation for a later time.

ulmitov commented 3 months ago

Since it is possible to identify which cli should be used for which card, a single tool for smartctl and all the raid cli's would be great, all of them being used in the same manner and similar design and parsing of results.