I ran into some snag when I tried to add a new HDD to my ESXi server. It was picking it up via vCenter and I found that because I am using HP server hpssacli command was the only (best way?) way to add this new disk as RAID 0 (I had just 1 disk as my other one failed). As usual, since it took me to search around Google, I simply decided to document it for future references, after all it’s just easier to read your own instructions than someone elses. Enjoy
Table of Contents
Check ESXi Version
~ # esxcli --version Script 'esxcli' version: 5.5.0 ~ #
Scan for new HardDisk
~ # /opt/hp/hpssacli/bin/hpssacli rescan
Check status for all Logical Disks
~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status logicaldrive 1 (68.3 GB, 1): OK logicaldrive 2 (136.7 GB, 1): OK
Check Status of all Physical Disks
~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify rebuildpriority=high ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 3 add drives=allunassigned ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 3 modify raid=1 Error: The logical drive is in a state which prevents this operation from completing. Use the "show" command for more information. ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show status physicaldrive 1I:1:1 (port 1I:box 1:bay 1, 72 GB): OK physicaldrive 1I:1:2 (port 1I:box 1:bay 2, 72 GB): OK physicaldrive 1I:1:3 (port 1I:box 1:bay 3, 146 GB): OK physicaldrive 1I:1:4 (port 1I:box 1:bay 4, 146 GB): OK physicaldrive 2I:1:5 (port 2I:box 1:bay 5, 500 GB): OK
Notice new HDD 2I:1:5
Create new Raid 0 Logical Disk using HDD 2I:1:5
~ # ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=2I:1:5 raid=0 ~ #
Confirm new disk creation by checking status of all Logical Disks
~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status logicaldrive 1 (68.3 GB, 1): OK logicaldrive 2 (136.7 GB, 1): OK logicaldrive 3 (465.7 GB, 0): OK ~
Migrate RAID0 to RAID1 online with hpacucli
~ # /opt/hp/hpssacli/bin/hpssacli rescan ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status logicaldrive 1 (68.3 GB, 1): OK logicaldrive 2 (136.7 GB, 1): OK logicaldrive 3 (465.7 GB, 0): OK ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show status physicaldrive 1I:1:1 (port 1I:box 1:bay 1, 72 GB): OK physicaldrive 1I:1:2 (port 1I:box 1:bay 2, 72 GB): OK physicaldrive 1I:1:3 (port 1I:box 1:bay 3, 146 GB): OK physicaldrive 1I:1:4 (port 1I:box 1:bay 4, 146 GB): OK physicaldrive 2I:1:5 (port 2I:box 1:bay 5, 500 GB): OK physicaldrive 2I:1:6 (port 2I:box 1:bay 6, 500 GB): OK ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify rebuildpriority=high ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 3 add drives=allunassigned ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 3 modify raid=1 Error: The logical drive is in a state which prevents this operation from completing. Use the "show" command for more information. ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status logicaldrive 1 (68.3 GB, 1): OK logicaldrive 2 (136.7 GB, 1): OK logicaldrive 3 (465.7 GB, 0): Transforming, 0.24% complete ~ #
So actual sequence was:
Set rebuild priority to high: ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify rebuildpriority=high
Assigning of unassigned disks to logical drive: (this action invoked synchronization of RAID with default raid type (of RAID0) - there was only one disk before, right - it took about 1hr (146GB disks)) ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 3 add drives=allunassigned
After synchronization finished, I migrate the RAID0 to RAID1: (this action took about 5hrs) ~ # /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 3 modify raid=1
[divider style=”solid” top=”20″ bottom=”20″]
Show configuration
/opt/hp/hpssacli/bin/hpssacli ctrl all show config
Controller status
/opt/hp/hpssacli/bin/hpssacli ctrl all show status
Show detailed controller information for all controllers
/opt/hp/hpssacli/bin/hpssacli ctrl all show detail
Show detailed controller information for controller in slot 0
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 show detail
Rescan for New Devices
/opt/hp/hpssacli/bin/hpssacli rescan
Physical disk status
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show status
Show detailed physical disk information
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show detail
Logical disk status
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status
View Detailed Logical Drive Status
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 show
Create New RAID 0 Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:2 raid=0
Create New RAID 1 Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:1,1I:1:2 raid=1
Create New RAID 5 Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:1,1I:1:2,2I:1:6,2I:1:7,2I:1:8 raid=5
Delete Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 delete
Add New Physical Drive to Logical Volume
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 add drives=2I:1:6,2I:1:7
Add Spare Disks
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 array all add spares=2I:1:6,2I:1:7
Enable Drive Write Cache
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify dwc=enable
Disable Drive Write Cache
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify dwc=disable
Erase Physical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd 2I:1:6 modify erase
Turn on Blink Physical Disk LED
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 modify led=on
Turn off Blink Physical Disk LED
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 modify led=off
Modify smart array cache read and write ratio (cacheratio=readratio/writeratio)
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify cacheratio=100/0
Enable smart array write cache when no battery is present (No-Battery Write Cache option)
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify nbwc=enable
Disable smart array cache for certain Logical Volume
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 logicaldrive 1 modify arrayaccelerator=disable
Enable smart array cache for certain Logical Volume
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 logicaldrive 1 modify arrayaccelerator=enable
Enable SSD Smart Path
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 array a modify ssdsmartpath=enable
Disable SSD Smart Path
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 array a modify ssdsmartpath=disable