Use powershell module to automate Nimble storage administration

Install Nimble module for powershell

Install-Module -Name HPENimblePowerShellToolkit -RequiredVersion 3.0.0

Use below script to connect to nimble SAN storage, and create LUN, Access InitiatorGroup and assign the LUN access group

import-module HPENimblePowerShellToolkit
#this section for inputs, what should be changed
$arrayname = "nimble-group02.itforce.local"
$nm_uid = "admin"
$nm_password = ConvertTo-SecureString -String "[your-password]" -AsPlainText -Force
$nm_cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $nm_uid,$nm_password
Connect-NSGroup -group $arrayname -credential $nm_cred -IgnoreServerCertificate

# The following commands are used if creating an FC connection
$servername="cbuat"
$wwn01="50:01:43:80:26:66:b2:e4"
$wwn02="50:01:43:80:26:66:b2:e6"
$volumename="cbuat-lun001"

$port0=$servername+"_p1"
$port1=$servername+"_p2"
$description="Initiator Group for ”+$servername
$performancepolicyid=Get-NSPerformancePolicy -name default | select -ExpandProperty id

New-NSInitiatorGroup –name $servername –access_protocol fc –description $description
$MyGroupID = (Get-NSInitiatorGroup –name $servername).id
New-NSInitiator –initiator_group_id $MyGroupID –access_protocol fc –alias $port0 –wwpn $wwn01
New-NSInitiator –initiator_group_id $MyGroupID –access_protocol fc –alias $port1 –wwpn $wwn02

$initiatorID = Get-NSInitiatorGroup -name $servername | select -expandproperty id

New-NSVolume -Name $volumename -Size 2000000 -PerfPolicy_id $performancepolicyid -online $true
$volumeID = Get-NSVolume -name $volumename | select -expandproperty id
New-NSAccessControlRecord -initiator_group_id $initiatorID -vol_id $volumeID

#if you have several nimble groups
disconnect-NSGroup

ps1
if you are going to create LUN for Linux, Windows or Vmware , then pls change performance policy ( in my case i’m creating LUN using default performance policy for HP-UX)

ps2

for 3par administrators:

  1. performance policy is equal to persona
  2. Data Access, InitiatorGroup is equal to host/host set
  3. Linking InitiatorGroup to volume is equal to exporting of LUN to host/hostset
  4. triple parity can be considered as RAID7

 

ps3

to get quickly all FC WWNs of nimble group use command from ssh to nimble:

fc --list| gawk  '{print $7}'