Linux - hpacucli

This document is a quick cheat sheet on how to use the hpacucli utility to add, delete, identify and repair logical and physical disks on the Smart array 5i plus controller, the server that these commands were tested on was a HP DL380 G3 server with a Smart Array 5i plus controller with 6 x 72GB hot swappable disks, the server had Oracle Enterprise Linux (OEL) installed.

After a fresh install of Linux I downloaded the file hpacucli-8.50-6.0.noarch.rpm (5MB), you may want to download the latest version from HP. Then install using the standard rpm command.

I am not going to list all the commands but here are the most common ones I have used thus far, this document may be updated as I use the utility more.

Utility Keyword abbreviations

Abbreviationschassisname = ch
controller = ctrl 
logicaldrive = ld
physicaldrive = pd 
drivewritecache = dwc

hpacucli utility

hpacucli# hpacucli 

# hpacucli help

Note: you can use the hpacucli command in a script

Controller Commands

Display (detailed)hpacucli> ctrl all show config
hpacucli> ctrl all show config detail
Statushpacucli> ctrl all show status
Cachehpacucli> ctrl slot=0 modify dwc=disable
hpacucli> ctrl slot=0 modify dwc=enable
Rescanhpacucli> rescan

Note: detects newly added devices since the last rescan

Physical Drive Commands

Display (detailed)hpacucli> ctrl slot=0 pd all show
hpacucli> ctrl slot=0 pd 2:3 show detail

Note: you can obtain the slot number by displaying the controller configuration (see above)
Status

hpacucli> ctrl slot=0 pd all show status
hpacucli> ctrl slot=0 pd 2:3 show status

Erasehpacucli> ctrl slot=0 pd 2:3 modify erase
Blink disk LEDhpacucli> ctrl slot=0 pd 2:3 modify led=on
hpacucli> ctrl slot=0 pd 2:3 modify led=off

Logical Drive Commands

Display (detailed)hpacucli> ctrl slot=0 ld all show [detail]
hpacucli> ctrl slot=0 ld 4 show [detail] 
Statushpacucli> ctrl slot=0 ld all show status 
hpacucli> ctrl slot=0 ld 4 show status
Blink disk LEDhpacucli> ctrl slot=0 ld 4 modify led=on
hpacucli> ctrl slot=0 ld 4 modify led=off
re-enabling failed drivehpacucli> ctrl slot=0 ld 4 modify reenable forced 
Create# logical drive - one disk 
hpacucli> ctrl slot=0 create type=ld drives=1:12 raid=0 

# logical drive - mirrored 
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14 size=300 raid=1

# logical drive - raid 5 
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14,1:15,1:16,1:17 raid=5

Note:
drives - specific drives, all drives or unassigned drives
size - size of the logical drive in MB
raid - type of raid 0, 1 , 1+0 and 5
Removehpacucli> ctrl slot=0 ld 4 delete
Expandinghpacucli> ctrl slot=0 ld 4 add drives=2:3
Extendinghpacucli> ctrl slot=0 ld 4 modify size=500 forced
Sparehpacucli> ctrl slot=0 array all add spares=1:5,1:7