HPE ProLiant RAID with ssacli: Logical Drives and Spares - 夜莺博客

HPE ProLiant RAID with ssacli: Logical Drives and Spares

HPE's Smart Storage Administrator command line tool — ssacli, formerly hpssacli and hpacucli before that — is the supported way to inspect and change RAID configuration from the operating system without rebooting into the BIOS utility. It matters for two everyday tasks: building a new array on a running server and diagnosing a degraded one before it becomes an outage. This guide covers the command structure, the creation shortcuts worth memorising, and the health checks that belong in your monitoring.

Installation and controller discovery

# RHEL / Rocky / Alma
sudo dnf install -y ssacli          # or: rpm -ivh ssacli-*.rpm
# Debian / Ubuntu: install the .deb from the HPE MCP repository
sudo ssacli version

sudo ssacli ctrl all show status
sudo ssacli ctrl all show config
sudo ssacli ctrl slot=0 show detail

Command structure is always <target> <command> [parameter=value]:

ssacli ctrl slot=0 array A logicaldrive 1 show detail
ssacli ctrl slot=0 physicaldrive 1I:1:1 show detail
ssacli ctrl serialnumber=P21DA2322S show config

Creating logical drives

# RAID 1 from two disks
ssacli ctrl slot=0 create type=ld drives=1I:1:1,1I:1:2 raid=1

# RAID 5 from four disks
ssacli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,1I:1:5,1I:1:6 raid=5

# RAID 1+0 from eight disks with an explicit stripe size
ssacli ctrl slot=0 create type=ld drives=1I:1:17-1I:1:24 raid=1+0 stripesize=256

# RAID 6 with a labelled array name and a specific size
ssacli ctrl slot=0 create type=ld drives=1I:1:7,1I:1:8,1I:1:9,1I:1:10 raid=6 array=DATA-1

Always check drive identity first with ssacli ctrl slot=0 pd all show status. Building an array on the wrong bay is the classic unforced error, and the drive notation differs between backplanes: 1I:1:1 is port:box:bay, some controllers use 1:1 (box:bay), older ones 1:12.

Spares, cache and rebuild priority

# global spare usable by any array on the controller
ssacli ctrl slot=0 array all add spares=1I:1:12
# a dedicated spare for one array
ssacli ctrl slot=0 array A add spares=1I:1:13

# write cache policy: be explicit
ssacli ctrl slot=0 modify dwc=enable
ssacli ctrl slot=0 logicaldrive 1 modify aa=enable          # array accelerator
ssacli ctrl slot=0 modify rp=high                            # rebuild priority

# SSD wear and SATA NCQ settings when relevant
ssacli ctrl slot=0 modify ssdsmartpath=enable

Write cache only survives a power loss if the cache module has a healthy battery or capacitor. Verify before trusting performance figures:

ssacli ctrl slot=0 show detail | grep -A3 "Cache Status"
ssacli ctrl all show status
# Smart Array P431 in Slot 0 (Embedded)
#   Controller Status: OK
#   Cache Status: OK
#   Battery/Capacitor Status: OK

Health checks for monitoring

ssacli ctrl all show config | grep -E "logicaldrive|physicaldrive|Unused|Failed|Predictive"
ssacli ctrl slot=0 pd all show status
ssacli ctrl slot=0 ld all show status
ssacli ctrl slot=0 show detail | grep -iE "status|temperature|firmware"

Anything reported as Predictive failure should generate a ticket immediately — Smart Array usually means "replace this drive on the next maintenance window, before it drops".

Replacing a failed drive

# identify the failed drive
ssacli ctrl slot=0 pd all show status | grep -i failed
ssacli ctrl slot=0 pd 1I:1:4 show detail

# hot-swap physically, then the controller rebuilds automatically
ssacli ctrl slot=0 ld 1 show detail | grep -i status
# watch progress
watch -n 30 "ssacli ctrl slot=0 ld 1 show detail | grep -iE 'status|progress'"

# only if auto-rebuild is disabled
ssacli ctrl slot=0 ld 1 modify rebuildpriority=high

Do not remove a drive that is "rebuilding" — a second removal during a rebuild on RAID 5 destroys the array. Confirm the bay LED or the show detail bay location before pulling anything.

Firmware, expansion and growth

ssacli ctrl slot=0 show detail | grep -i firmware
# expand an existing array with more drives
ssacli ctrl slot=0 array A add drives=1I:1:11
ssacli ctrl slot=0 ld 1 modify size=max

# change RAID level where the configuration allows it
ssacli ctrl slot=0 ld 1 modify raid=6 renumber=no

Both growth and RAID-level change run in the background and leave the array in a transformation state; schedule them, and check ld show detail for the transformation progress before running anything performance-critical.

Related reading: HPE 3PAR CLI commands for administration, iDRAC versus iLO versus IPMI out-of-band management, and HPE iLO 5 initial setup and virtual media.

原文链接:https://www.n0tes.fr/2024/03/04/CLI-HPE-ssacli-and-hpssacli-tools/