Around the Storage Block
cancel
Showing results for 
Search instead for 
Did you mean: 

The power of Command Line Interface (CLI) on HP 3PAR

StorageExperts

IvanJ.jpgBy Ivan Iannaccone, 3PAR StoreServ Product Management

 

GUIs are amazing and beautiful, but let’s face it there is nothing geekier than using the command line and nothing more effecting than building scripts to automate a repetitive task. HP 3PAR StoreServ offers an extremely powerful and simple Command Line Interface (CLI) with open administration support provided via SNMP, Storage Management Initiative Specification (SMI-S), Web Service API and OpenStack Cinder.

 

Ease of use

Management of HP 3PAR StoreServ requires only knowledge of a few simple, basic functions: 

  • Create – for volumes, hosts
  • Remove – for volumes, hosts
  • Show – for volumes, hosts, hardware inventory, capacity
  • Stat – real-time performance data
  • Hist – histogram performance data
  • Sr – for historical capacity and performance data

While simple, the right switches and options can produce some very powerful output especially when looking at performance data.Use the following commands to understand what size of I/O are being received on host facing array target HBAs:

 

histport -begin -rw -metric size -sizecols 0 9 -sortcol 2 -iter 1 -host -pct

Geekagain1J.jpg 

The on-node 3PAR System Reporter data can also produce some pretty powerful outputs, such as the srrgiodensity commands that show the distribution of IOP/s intensity for a given CPG.

 

The following command looks back at one day of historical I/O density data collection on CPG SSD_r1 and produces a breakdown in percentage of read/write and total access for every single volume in that CPG:

 

srrgiodensity -btsecs -1d -cpg SSD_r1 -rw -withvv -pct

 Geekagain2J.jpg

Scripting

HP 3PAR CLI provides multiple ways to script and automate repetitive storage administrative tasks such taking snapshots and auditing logs.

  • HP 3PAR CLI – HP 3PAR Remote CLI application needs to be installed on the OS that runs the script. The package is part of the admin tools and can be downloaded from the upgrade portal.
  • SSH – This is a good option for customers that have operating systems that are not supported by the HP 3PAR CLI.
  • WebServices API – The HP 3PAR WebServices API is a restful API, that use JSON objects for messaging.

Here is an example of the scripting capabilities using cli and showing how you connect to the array to collect system reporter data and produce a comma separated value (CSV) table:

 

3PAR>cli -csvtable -sys 10.80.42.170 -user admin -password acc2X@me srstatport -btsecs -72h -etsecs -1m -attime -groupby port_n,port_s,port_p,port_type,gbitps

 

This is another example using ssh to get the output of showvv with no headers and ready to be imported in Excel :

 

ivan@ubuntu:~$ ssh 3paradm@mktg-ins3.3pardata.com showvv -nohdtot -csvtable

 

There is also the Python client library that can talk to HP 3PAR StoreServ via the WS API interface. This implements a simple interface to talk with that REST interface using the Python httplib2 http library.

 

You can also connect to the WSAPI interface using the Invoke-WebRequest cmdlet in PowerShell. Some good info is available in this blog – 3PAR: Connect to WebAPI using PowerShell

 

Learn more

HP 3PAR REST APIs Developers Guide

CLI Reference Guide

 

 

About the Author

StorageExperts

Our team of Hewlett Packard Enterprise storage experts helps you to dive deep into relevant infrastructure topics.

Comments
madkiwi
  • HP 3PAR CLI – HP 3PAR Remote CLI application needs to be installed on the OS that runs the script. The package is part of the admin tools and can be downloaded from the upgrade portal.

Started from that link and then spent nearly 5 hours bouncing around including the HP Passport web site and I can't find it?!

I never understand why something like this is not freely downloadable.

It's useless without having a 3PAR to connect to!

We have 10 (7200, 7400, 7440c & 8440)...........

 

kishore3par

hi 

 

do you have any command to list out the storage capcity used by host?

HPEStorageGuy

@kishore3par - here's a link to the 3PAR CLI Admin Guide.  You can run showvv -p –host <hostname>

The output looks like this:

run vv output.JPG

 

HPEStorageGuy

Here's also the 3PAR CLI Reference Guide. This goes into details of all the commands. The link was given in the blog post but since the split from HP, that link no longer works. 

Aravind_Sasikumar

There is No Option to get the used,free capacity showsys output result can be made similar to get-3PARsystem. The SR commands are Awesome with MSchart