Sunday 11 March 2018

HPSSACLI commands for Windows/Linux to do operations with HPE SAS Controllers

hp/
HP Smart Array CLI commands on ESXi


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 c/opt/
trl 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

To add a spare with spare type of autoreplace: 
ctrl slot=1 array A add spares=1e:1:5 sparetype=autoreplace

Rekeying a controller or logical drive (multiple scenarios)

controller slot=7 rekey
controller slot=7 array A rekey
controller slot=7 ld # rekey
controller slot=7 ld # rekey user=crypto password=XXXXXX
controller slot=7 ld all rekey
cd /opt/hp/hpssacli/bin/
opt/hp/hpssacli/bin/hpssacli ctrl slot=5 ld # rekey user=crypto password=XXXXXX forced

Split Mirror Remirror
=>ctrl slot= 5 array A splitmirror action=split with backup
=> ctrl slot= 5 array A splitmirror action=remirror
=> ctrl slot= 5 array A splitmirror action=rollback
=> ctrl slot= 5 array A splitmirror action=activatebackup



WAMP(Webserver) installation on Windows to use Python for Web Programming

WAMP(Webserver) installation on Windows
  • 1.       Install Python 3.x version.
  • 2.       Download and install Microsoft visual studio-2008&2010&2012&2013&2015(Both 32bit and 64 bit)
  • 3.       Please check for msvcr120.dll exist or not in “C:\Windows\System32\” directory of the system where going to install WAMP. If not please download it and place in that path.
  • 4.       Download and install WAMP webserver software from “sourceforge.net” site. Better to install 64 bit.
  • 5.       Now go to the right corner toolbar and left click on WAMP icon
  • 6.       Select “Apache>httpd.conf” file
  • 7.       Inside httpd.conf, look for the line that says “<Directory “c:/wamp/www/”>“, just a few lines below this you’ll find the line that says “Options Indexes FollowSymLinks“. Add “Includes ExecCGI” in the line just next to FollowSymLinks, thus it look like this
  • 8.       Replace that line with below text
         
  • 9.       Above “AddHandler” is to support “.cgi ” files and “.py” files. If you want perl also you can mention as “.pl”. And also comment a line “Deny from all” to overcome “Error: Forbidden Error” when you access from remote system
           
  • 10.   Run “ Services.msc” in windows and select wamp application>properties>start>manual – change it to automatic
  • 11.   Go to WAMP Tray and restart services and also restart windows.
  • 12.   Now run your url. It will work.