Pages

Thursday, July 19, 2012

Battery state of a LSI MegaSAS 9260

A few days ago a collegue asked me to check the battery status of a raid controller. He gave me the login to his machine and I found this raid controller: 

# lspci -v
...
01:00.0 RAID bus controller: LSI Logic / Symbios Logic LSI MegaSAS 9260 (rev 03)
        Subsystem: IBM Unknown device 03b2
        Flags: bus master, fast devsel, latency 0, IRQ 217
        I/O ports at 1000 [size=256]
        Memory at 9b940000 (64-bit, non-prefetchable) [size=16K]
        Memory at 9b900000 (64-bit, non-prefetchable) [size=256K]
        Expansion ROM at 9bf00000 [disabled] [size=256K]
        Capabilities: [50] Power Management version 3
        Capabilities: [68] Express Endpoint IRQ 0
        Capabilities: [d0] Vital Product Data
        Capabilities: [a8] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
        Capabilities: [c0] MSI-X: Enable- Mask- TabSize=15
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [138] Power Budgeting
...

LSI provides a tool called MegaCLI which allows you to set and get current parameters for your raid controller. It can be downloaded from http://www.lsi.com/channel/products/storagecomponents/Pages/MegaRAIDSAS9260-8i.aspx and is available for a wide range of operating systems. I will show how to install and use it with Linux.
After you have downloaded the zip file, copy it to your server und run unzip:

# unzip 8.04.07_MegaCLI.zip
Archive:  8.04.07_MegaCLI.zip
 extracting: Win_CliKL_8.04.07.zip
  inflating: 8.04.07_MegaCLI.txt
 extracting: CLI_DOS_8.04.07.zip
 extracting: CLI_FreeBSD_8.04.07.zip
 extracting: CLI_Lin_8.04.07.zip
 extracting: CLI_Solaris_8.04.07.zip
 extracting: CLI_VMWare_8.04.07.zip
 extracting: CLI_VMWare_MN_8.04.07.zip
 extracting: CLI_Win_8.04.07.zip
 extracting: Lin_CliKL_8.04.07.zip

As you can see the zip file contains more zip files (for each operating system one). Pick the one for your operating system and unzip it. In my case I will use CLI_Lin_8.04.07.zip:

# unzip CLI_Lin_8.04.07.zip
Archive:  CLI_Lin_8.04.07.zip
 extracting: MegaCliLin.zip
  inflating: readme.txt

And again, one more zip file to unzip:

# unzip MegaCliLin.zip
Archive:  MegaCliLin.zip
  inflating: Lib_Utils-1.00-09.noarch.rpm
  inflating: MegaCli-8.04.07-1.noarch.rpm

Surprise, no more zip files! Finally two rpm files to install:

# rpm -ivh Lib_Utils-1.00-09.noarch.rpm MegaCli-8.04.07-1.noarch.rpm --force
Preparing...                ###################################### [100%]
Installing....
   1:Lib_Utils              ###################################### [ 50%]
   2:MegaCli                ###################################### [100%]

After the installation succeded, the binaries can be found under /opt/MegaRAID/MegaCli:

# cd /opt/MegaRAID/MegaCli

To get the state of the battery run MegaCli64:

./MegaCli64 -AdpBbuCmd -GetBbuStatus -aall

BBU status for Adapter: 0

BatteryType: iBBU
Voltage: 4007 mV
Current: 0 mA
Temperature: 33 C
Battery State     : Non Operational

BBU Firmware Status:

  Charging Status              : None
  Voltage                                 : OK
  Temperature                             : OK
  Learn Cycle Requested                   : No
  Learn Cycle Active                      : No
  Learn Cycle Status                      : OK
  Learn Cycle Timeout                     : No
  I2c Errors Detected                     : No
  Battery Pack Missing                    : No
  Battery Replacement required            : No
  Remaining Capacity Low                  : Yes
  Periodic Learn Required                 : No
  Transparent Learn                       : No
  No space to cache offload               : No
  Pack is about to fail & should be replaced : No
  Cache Offload premium feature required  : No
  Module microcode update required        : No


GasGuageStatus:
  Fully Discharged        : No
  Fully Charged           : Yes
  Discharging             : Yes
  Initialized             : Yes
  Remaining Time Alarm    : No
  Discharge Terminated    : No
  Over Temperature        : No
  Charging Terminated     : No
  Over Charged            : No
  Relative State of Charge: 95 %
  Charger System State: 49168
  Charger System Ctrl: 0
  Charging current: 0 mA
  Absolute state of charge: 29 %
  Max Error: 2 %

Exit Code: 0x00

I am not too familiar with this tool but it shows clearly that the remaining capacity is low. Probably it is a good idea to replace the battery.
Btw. I have heard about companies that they replace batteries once a year - by default.

Links:
http://www.lsi.com/channel/products/storagecomponents/Pages/MegaRAIDSAS9260-8i.aspx
http://faq.hosteurope.de/index.php?cpid=13843
http://support.bull.com/ols/product/platforms/ns/uline/common/tid/g/tid0612071320