Skip to content

Instantly share code, notes, and snippets.

@mrpeardotnet
Created November 25, 2019 22:10
Show Gist options
  • Save mrpeardotnet/a9ce41da99936c0175600f484fa20d03 to your computer and use it in GitHub Desktop.
Save mrpeardotnet/a9ce41da99936c0175600f484fa20d03 to your computer and use it in GitHub Desktop.
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

Installation process of the ssacli package on Proxmox is the same as on any other Debian based system.

NOTE: HP does not provide Buster repository for Debian 10/Proxmox 6.x, but we can still use Stretch repository even that it's targeted for Debian 9/Proxmox 5.x.

Add HP's MCP repository

To add HP's MCP repository to apt sources list use this command:

echo "deb http://downloads.linux.hpe.com/SDR/repo/mcp stretch/current non-free" > /etc/apt/sources.list.d/hp-mcp.list

Download and add public keys for the MCP repository

Public keys are needed by apt to verify repository signatures, so we need to download and add them. There are four of them and we need to download and them all:

wget -q -O - http://downloads.linux.hpe.com/SDR/hpPublicKey1024.pub | apt-key add -
wget -q -O - http://downloads.linux.hpe.com/SDR/hpPublicKey2048.pub | apt-key add -
wget -q -O - http://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub | apt-key add -
wget -q -O - http://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub | apt-key add -

Installing the ssacli package

First, we need to update available packages:

apt update

And then we can install the ssacli package:

apt install ssacli

Using the ssacli tool

Command short and long names All commands have a short name to reduce the length of the total input provided to the ssacli tool. You can use short or long name. Here is a list of all commands and their long and short names:

  • chassisname = ch
  • controller = ctrl
  • logicaldrive = ld
  • physicaldrive = pd
  • drivewritecache = dwc
  • licensekey = lk

You can specify disks also as:

  • A range of drives (bay 1 to 3): 1I:1:1-1I:1:3
  • Drives that are unassigned: allunassigned

Command examples

Here are few examples of ssacli commands that you can use to diagnose and manage your HP Smart Storage Controller.

Show available controllers

ssacli ctrl all show

Show controllers status

ssacli ctrl all show status

Show detailed controllers information

ssacli ctrl all show detail

Show controllers configuration

ssacli ctrl all show config

Rescan for new devices Useful after swapping disks in bays, etc...

ssacli rescan

Show all physical disks (or their status) (controller slot 0)

ssacli ctrl slot=0 pd all show
ssacli ctrl slot=0 pd all show status

Show all physical disks detailed information (controller slot 0)

ssacli ctrl slot=0 pd all show detail

Show logical drives (or their status) (controller slot 0, all or specific logical drive(s))

ssacli ctrl slot=0 ld all show
ssacli ctrl slot=0 ld all show status

ssacli ctrl slot=0 ld 1 show
ssacli ctrl slot=0 ld 1 show status

Show detailed logical drives information (controller slot 0, all or specific logical drive(s))

ssacli ctrl slot=0 ld all show detail
ssacli ctrl slot=0 ld 1 show detail

Show array information (controller slot 0, array A)

ssacli ctrl slot=0 array a show

Show array status (controller slot 0, all arrays)

ssacli ctrl slot=0 array all show status

Create new RAID 0 logical drive (controller slot 0, disk in port 1I:box 1:bay 1)

ssacli ctrl slot=0 create type=ld drives=1I:1:1 raid=0

Create new RAID 1 logical drive (controller slot 0, disks in port 1I:box 1:bay 1 and 2)

ssacli ctrl slot=0 create type=ld drives=1I:1:1,1I:1:2 raid=1

Create new RAID 5 logical drive (controller slot 0, diks in port 1I:box 1:bay 1 to 4)

ssacli ctrl slot=0 create type=ld drives=1I:1:1-1I:1:4 raid=5

Delete logical drive (controller slot 0, logical drive 1)

ssacli ctrl slot=0 ld 1 delete

Add new physical disks to logical drive (controller slot 0, logical drive 1, disks in port 1I:box 1:bay 6 and 7)

ssacli ctrl slot=0 ld 2 add drives=1I:1:6,1I:1:7

Add spare disks (controller slot 0, logical drive 1, array A, disks in port 1I:box 1:bay 6 and 7)

ssacli ctrl slot=0 array a add spares=1I:1:6,1I:1:7

Add global spare disks (controller slot 0, logical drive 1, all arrays, disks in port 1I:box 1:bay 6 and 7)

ssacli ctrl slot=0 array all add spares=1I:1:6,1I:1:7

Turn on/off blink logical drive LED (controller slot 0, logical drive 1)

ssacli ctrl slot=0 ld 1 modify led=on
ssacli ctrl slot=0 ld 1 modify led=off

Turn on/off blink physical disk LED (controller slot 0, physical disk port 1I:box 1:bay 1)

ssacli ctrl slot=0 pd 1I:1:1 modify led=on
ssacli ctrl slot=0 pd 1I:1:1 modify led=off

Modify smart array cache read and write ratio (controller slot 0, cacheratio 80% read/20% write)

ssacli ctrl slot=0 modify cacheratio=80/20

Show physical drive write cache status (controller slot 0)

ssacli ctrl slot=0 modify dwc=?

Enable/disable physical drive write cache (controller slot 0) Important: Because physical drive write cache is not battery-backed, you could lose data if a power failure occurs during a write process. To minimize this possibility, use a backup power supply.

ssacli ctrl slot=0 modify dwc=enable
ssacli ctrl slot=0 modify dwc=disable

Show status of smart array write cache when no battery is present (no-battery write cache option, controller slot 0)

ssacli ctrl slot=0 modify nbwc=?

Enable/disable smart array write cache when no battery is present (no-battery write cache option, controller slot 0)

ssacli ctrl slot=0 modify nbwc=enable
ssacli ctrl slot=0 modify nbwc=disable

Enable/disable smart array cache for certain Logical Volume (controller slot 0, logical drive 1)

ssacli ctrl slot=0 ld 1 modify arrayaccelerator=enable
ssacli ctrl slot=0 ld 1 modify arrayaccelerator=disable

Enable/disable SSD Smart Path (controller slot 0, array A)

ssacli ctrl slot=0 array a modify ssdsmartpath=enable
ssacli ctrl slot=0 array a modify ssdsmartpath=disable

Show spare activation mode

ssacli ctrl slot=0 modify spareactivationmode=?

Set spare activation mode

ssacli ctrl slot=0 modify spareactivationmode=predictive
ssacli ctrl slot=0 modify spareactivationmode=failure

Show rebuild priority

ssacli ctrl slot=0 modify rp=?

Modify rebuild priority

ssacli ctrl slot=0 modify rp=low
ssacli ctrl slot=0 modify rp=medium
ssacli ctrl slot=0 modify rp=mediumhigh
ssacli ctrl slot=0 modify rp=high

Erase Physical Drive (controller slot 0, physical disk port 1I:box 1:bay 1)

ssacli ctrl slot=0 pd 1I:1:1 modify erase
@lethargosapatheia
Copy link

Hello. Does any know how I can get the disk i/o counters from the controller? I'm guessing ssacli is mostly used to manage the controller, not to get counters/metrics.

@iqbal05eee
Copy link

how to check raid in Linux Debian 10? In centos, we would use hpacucli which doesn't work in debian. Any idea how to use in Debian?

@2grep
Copy link

2grep commented Jun 26, 2023

I think there's a typo here? This is the only command where the logical drive 1 does not match ld 1 and is instead listed as ld 2.

Add new physical disks to logical drive (controller slot 0, logical drive 1, disks in port 1I:box 1:bay 6 and 7)

ssacli ctrl slot=0 ld 2 add drives=1I:1:6,1I:1:7

Should that read

Add new physical disks to logical drive (controller slot 0, logical drive 1, disks in port 1I:box 1:bay 6 and 7)

ssacli ctrl slot=0 ld 1 add drives=1I:1:6,1I:1:7

@NBakhuis
Copy link

If you don't want to use HBA/Hardware Raid you can set your HP Raid controller to HBA mode = on with HP Smart Storage Admin. I am missing the commands in this documentation:

If your Smart Array controller designation begins with the letter P, such as the P420i:

sudo ssacli controller slot=0 modify hbamode=on

Else, if your HBA controller designation begins with the letter H, such as the H240:

sudo ssacli controller slot=0 modify raidmode=off

You should be all set. You can run ssacli controller slot=0 show to confirm that your changes have been made.

@Alex-Covecube
Copy link

Alex-Covecube commented Dec 12, 2023

To install on Ubuntu Server 22.04 (no apt-key)

echo "deb http://downloads.linux.hpe.com/SDR/repo/mcp jammy/current non-free" > /etc/apt/sources.list.d/hp-mcp.list

wget -q -O - https://downloads.linux.hpe.com/SDR/hpPublicKey1024.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpPublicKey1024.gpg
wget -q -O - https://downloads.linux.hpe.com/SDR/hpPublicKey2048.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpPublicKey2048.gpg
wget -q -O - https://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpPublicKey2048_key1.gpg
wget -q -O - https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpePublicKey2048_key1.gpg

apt update
apt install ssacli

@ikalafat
Copy link

ikalafat commented Dec 13, 2023

for Proxmox 8 on Debian 12 (bookworm)

echo "deb http://downloads.linux.hpe.com/SDR/repo/mcp bookworm/current non-free" > /etc/apt/sources.list.d/hp-mcp.list

wget -q -O - https://downloads.linux.hpe.com/SDR/hpPublicKey1024.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpPublicKey1024.gpg
wget -q -O - https://downloads.linux.hpe.com/SDR/hpPublicKey2048.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpPublicKey2048.gpg
wget -q -O - https://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpPublicKey2048_key1.gpg
wget -q -O - https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/hpePublicKey2048_key1.gpg

apt update
apt install ssacli

edit, works with DL360 Gen10 with P408i controller

@JohnnyBravoNL
Copy link

JohnnyBravoNL commented Dec 13, 2023

For Proxmox 8 (Debian bookworm), confirmed to be working on HP DL380 gen 9 using Smart HBA H240

echo "deb http://downloads.linux.hpe.com/SDR/repo/mcp bookworm/current non-free" > /etc/apt/sources.list.d/hp-mcp.list

Further as per the post from @Alex-Covecube

@deepcloudindia
Copy link

Hello,
I am on HP DL385 Gen10 Plus V2 with HP 416a-i Tri-mode controller in RAID 1 for OS and RAID-0 for the other drives. with Proxmox 8.1.3

image

but i get error - no controllers detected possible causes: ....
I have done modprobe sg to load the scsi generic module ? see the attached screenshot.

Thanks in advance.

@ars1364
Copy link

ars1364 commented Jan 17, 2024

this one helped me:
ssacli controller slot=0 physicaldrive 1I:1:1 modify clearconfigdata
to clear old raid configuration remained in disk

@jmacis
Copy link

jmacis commented Feb 16, 2024

Got it working on Proliant DL360 GEN9 Smart Array P440ar.

ssacli version

SSACLI Version: 6.15.11.0 2022-11-01
SOULAPI Version: 6.15.11.0 2022-11-01

@deepcloudindia
Copy link

deepcloudindia commented Feb 16, 2024 via email

@kiwipaulrob
Copy link

I am having the same problem as deepcloudindia - a error saying that the driver has not been installed.

Anyone have any suggestions?

@elmer666
Copy link

Hello.
I have problem with my new bought h240 controller. It's working in Pcie 3.0 x1 mode ( " Negotiated PCIe Data Rate: PCIe 3.0 x1 (985 MB/s)" ) and i think that it should be working "a little" bit faster. Do anyone know how to fix this problem?

@itefimov
Copy link

It was very helpful for me with DL180G6+P410
Thanks very much.

@MajidAhmadit
Copy link

MajidAhmadit commented Mar 26, 2024

Hi ,
I have 100+ servers and need to define raid 0 for all before using kickstart script for running OS ,
Is there any solution using "ssacli" to define a raid for them without having an OS ?
a command like : " perl locfg.pl -s HOSTNAME -f FILE.xml" that we use for working with ilo?

@mbelanger
Copy link

I'm also having trouble with ssacli and a P222 installed within a Microserver Gen 8.
lsmod shows hpsa as installed. Any pointers greatly appreciated.

@lslamp
Copy link

lslamp commented Apr 24, 2024

I am new to HP servers and Raid Arrays, I have learnt a lot over the last days.
I have a HP Proliant DL360 Gen9 server, I have a raid 6 configured with 5 disks at the moment and tried to add 3 more disks.
The issue I ran into was after the ILO update, I could not open the Smart Array Management from the reboot.
I have now installed ssacli on the server and have access to the disk management but I run into an issue that I do not understand. when trying to add the disks to the current array, I get the following error.
This is what I have.
Array A (SAS, Unused Space: 1 MB)

  logicaldrive 1 (3.27 TB, RAID 6, OK)

  physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS HDD, 1.2 TB, OK)
  physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS HDD, 1.2 TB, OK)
  physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS HDD, 1.2 TB, OK)
  physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS HDD, 1.2 TB, OK)
  physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS HDD, 1.2 TB, OK)

Unassigned

  physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS HDD, 1.2 TB, OK)
  physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS HDD, 1.2 TB, OK)
  physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS HDD, 1.2 TB, OK)

This is what I am trying,
ssacli ctrl slot=0 array A add drives=1I:1:1,1I:1:3,2I:1:5

Error: This operation is not supported with the current configuration. Use the
"show" command on devices to show additional details about the
configuration.
Reason: Transformation size zero. This may indicate that there is no
cache backup power source or a failed backup power source on the
controller.

Anyone tell me why this is happening. What has a backup power supply got to do with adding disks to an array?
Thanks
Lawrence

@svh1985
Copy link

svh1985 commented Aug 6, 2024

I've updated the commands a bit to mitigate the apt-key depreciation. Hope it helps!

Tested on Debian Bookworm.

wget http://downloads.linux.hpe.com/SDR/hpPublicKey1024.pub
wget http://downloads.linux.hpe.com/SDR/hpPublicKey2048.pub
wget http://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub
wget http://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import hpPublicKey1024.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output hpPublicKey1024.gpg
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import hpPublicKey2048.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output hpPublicKey2048.gpg
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import hpPublicKey2048_key1.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output hpPublicKey2048_key1.gpg
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import hpePublicKey2048_key1.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output hpePublicKey2048_key1.gpg
rm hpPublicKey1024.pub hpPublicKey2048.pub hpPublicKey2048_key1.pub hpePublicKey2048_key1.pub temp-keyring.gpg temp-keyring.gpg~
mkdir -p /etc/apt/keyrings
mv -f hpPublicKey1024.gpg hpPublicKey2048.gpg hpPublicKey2048_key1.gpg hpePublicKey2048_key1.gpg /etc/apt/keyrings/
echo "deb [signed-by=/etc/apt/keyrings/hpPublicKey1024.gpg,/etc/apt/keyrings/hpPublicKey2048.gpg,/etc/apt/keyrings/hpPublicKey2048_key1.gpg,/etc/apt/keyrings/hpePublicKey2048_key1.gpg] http://downloads.linux.hpe.com/SDR/repo/mcp stretch/current non-free" > /etc/apt/sources.list.d/hp-mcp.list
apt update
apt install ssacli -y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment