Mon May 21 07:33:56 CEST 2012

LSI Controllers Part II, or how to be sad

Last (psychotic) episode we looked at how to download and install LSI controller management tools.
Today's special will look at using them, or trying to, or finding reasons to be totally drunk.

# file ./MegaCli64
./MegaCli64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, stripped
# ./MegaCli64
Fatal error - Command Tool invoked with wrong parameters
Exit Code: 0x01
Ho hum. Err. 0x01 you say? -ESTUPIDUSER I guess.
# ./MegaCli64 --help
Invalid input at or near token -                                           

Exit Code: 0x01
Invalid? --help? Erf. Uhm. Now I could really use some, err, help?
Will -h work? Yes it does ... but ...
# ./MegaCli64 -h | wc -l
277
But at least: Exit Code: 0x00 - yey?

The bad news is the syntax of this ancient demon summoning device. To quote:
MegaCli -AdpPR -Dsbl|EnblAuto|EnblMan|Start|Suspend|Resume|Stop|Info|SSDPatrolReadEnbl |SSDPatrolReadDsbl  
         |{SetDelay Val}|{-SetStartTime yyyymmdd hh}|{maxConcurrentPD Val} -aN|-a0,1,2|-aALL
First there's no explanation at all what AdpPR means. And that it's actually case-independant.
Second one notes Dsbl instead of disable, because characters are precious (and why not use Off then?)
And that's the best part of it.

There's also a few excellent features in these "RAID" "Controllers" that might make you a bit grumpy.
For example it will only boot off the first disk, so in JBOD mode (with software raid on top of it maybe?) if the first disk fails you will have to manually change the config at boot time to, err, boot. But on the upside it will stop if *any* disk has failed, or any array is degraded, so you'll do that often enough.

You might ask, why software raid? Well - the controller firmware does not support growing volumes that are on a shared disk, so if you have [sda1 sda2] etc. and make a raid1 out of sd{a,b,c,d}1 and a raid5 out of sd{a,b,c,d}2 then you cannot grow these partitions in the future, which means you have to move all data away, destroy array, recreate array, copy back.

And that's supposed to be the Market Leader ?!

Posted by Patrick | Permalink

Mon May 7 07:15:20 CEST 2012

How not to treat your customers

Here's a funny game - let's try to use a LSI controller from the command line in Linux.

First difficulty: Since a short while ago all downloads are behind a registration wall. Ok, no biggie, let's register then (grumble, grumble, moan.)

The registration demands a password containing at least seven characters, including at least one non-alphanumeric. Yey!

Then there's the Captcha, which looks quite amusing, but ... erf. After three or four guesses you might even get it right.

Fast forward to the driver download page. The specific model (according to lspci) doesn't even exist. Oh, haha, u so funny! But no worry, all the MegaRAID models share the same driver.

Now, here it gets a bit esoteric:
$ file 8.02.21_MegaCLI.zip 
8.02.21_MegaCLI.zip: Zip archive data, at least v2.0 to extract
$ unzip 8.02.21_MegaCLI.zip 
Archive:  8.02.21_MegaCLI.zip
  inflating: 8.02.21_MegaCLI.txt     
  inflating: 8.02.21_Windows_MegaCLI/MegaCli.exe  
  inflating: 8.02.21_Windows_MegaCLI/MegaCli64.exe  
  inflating: 8.02.21_Windows_MegaCLI/Readme.txt  
  inflating: 8.02.21_VMware_MegaCLI/MegaCli  
 extracting: 8.02.21_VMware_MegaCLI/MegaCli.zip  
  inflating: 8.02.21_Solaris_MegaCLI/MegaCli  
  inflating: 8.02.21_Solaris_MegaCLI/MegaCli.pkg  
  inflating: 8.02.21_Solaris_MegaCLI/readme.txt  
 extracting: 8.02.21_Linux_MegaCLI/MegaCliLin.zip  
  inflating: 8.02.21_Linux_MegaCLI/readme.txt  
  inflating: 8.02.21_FreeBSD_MegaCLI/MegaCli  
  inflating: 8.02.21_FreeBSD_MegaCLI/MegaCli64  
  inflating: 8.02.21_DOS_MegaCLI/LICENSE_DOS32A.txt  
  inflating: 8.02.21_DOS_MegaCLI/MegaCli.exe
... wow, we got a Solaris driver for free, and a linux ... zipfile? eh whut?
$ unzip 8.02.21_Linux_MegaCLI/MegaCliLin.zip
Archive:  8.02.21_Linux_MegaCLI/MegaCliLin.zip
  inflating: MegaCli-8.02.21-1.noarch.rpm  
  inflating: Lib_Utils-1.00-09.noarch.rpm 
Oh, right, not really a zipfile but an rpm. My bad! haha! oh ... uhm ... :(
$ rpm2tar MegaCli-8.02.21-1.noarch.rpm
$ tar --list -f MegaCli-8.02.21-1.noarch.tar 
./
./opt/
./opt/MegaRAID/
./opt/MegaRAID/MegaCli/
./opt/MegaRAID/MegaCli/MegaCli                                                                                                                                                                                                               
./opt/MegaRAID/MegaCli/MegaCli64
$ file ./opt/MegaRAID/MegaCli/MegaCli64 
./opt/MegaRAID/MegaCli/MegaCli64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, stripped
zipception! it's a single binary, in an rpm, in a zip, in a zip, on a protected website! And look, "for GNU/Linux 2.4.0" - it's built to run everywhere. Even on Really Ancient Computers.

So, uhm, taddah:
$ ./opt/MegaRAID/MegaCli/MegaCli64 
Fatal error - Command Tool invoked with wrong parameters
Exit Code: 0x01


And now you know why so many sysadmins are alcoholics.

(Bonus feature: We're not allowed to mirror any of these highly proprietary files, so every single person trying to interact with a LSI "Raid" controller on Linux gets to experience that)

Posted by Patrick | Permalink