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  <span><a href="https://www.itforce.mn/index.php/2021/03/15/use-powershell-module-to-automate-nimble-storage-administration/" class="readmore">Continue reading &rarr;</a></span>{"id":1526,"date":"2021-03-15T15:03:24","date_gmt":"2021-03-15T07:03:24","guid":{"rendered":"https:\/\/www.itforce.mn\/?p=1526"},"modified":"2021-03-15T15:24:27","modified_gmt":"2021-03-15T07:24:27","slug":"use-powershell-module-to-automate-nimble-storage-administration","status":"publish","type":"post","link":"https:\/\/www.itforce.mn\/index.php\/2021\/03\/15\/use-powershell-module-to-automate-nimble-storage-administration\/","title":{"rendered":"Use powershell module to automate Nimble storage administration"},"content":{"rendered":"<p><strong>Install Nimble module for powershell<\/strong><\/p>\n<pre>Install-Module -Name HPENimblePowerShellToolkit -RequiredVersion 3.0.0\r\n<\/pre>\n<p><strong>Use below script to connect to nimble SAN storage, and create LUN, Access InitiatorGroup and assign the LUN access group<\/strong><\/p>\n<pre>import-module HPENimblePowerShellToolkit\r\n#this section for inputs, what should be changed\r\n$arrayname = \"nimble-group02.itforce.local\"\r\n$nm_uid = \"admin\"\r\n$nm_password = ConvertTo-SecureString -String \"[your-password]\" -AsPlainText -Force\r\n$nm_cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $nm_uid,$nm_password\r\nConnect-NSGroup -group $arrayname -credential $nm_cred -IgnoreServerCertificate\r\n\r\n# The following commands are used if creating an FC connection\r\n$servername=\"cbuat\"\r\n$wwn01=\"50:01:43:80:26:66:b2:e4\"\r\n$wwn02=\"50:01:43:80:26:66:b2:e6\"\r\n$volumename=\"cbuat-lun001\"\r\n\r\n$port0=$servername+\"_p1\"\r\n$port1=$servername+\"_p2\"\r\n$description=\"Initiator Group for \u201d+$servername\r\n$performancepolicyid=Get-NSPerformancePolicy -name default | select -ExpandProperty id\r\n\r\nNew-NSInitiatorGroup \u2013name $servername \u2013access_protocol fc \u2013description $description\r\n$MyGroupID = (Get-NSInitiatorGroup \u2013name $servername).id\r\nNew-NSInitiator \u2013initiator_group_id $MyGroupID \u2013access_protocol fc \u2013alias $port0 \u2013wwpn $wwn01\r\nNew-NSInitiator \u2013initiator_group_id $MyGroupID \u2013access_protocol fc \u2013alias $port1 \u2013wwpn $wwn02\r\n\r\n$initiatorID = Get-NSInitiatorGroup -name $servername | select -expandproperty id\r\n\r\nNew-NSVolume -Name $volumename -Size 2000000 -PerfPolicy_id $performancepolicyid -online $true\r\n$volumeID = Get-NSVolume -name $volumename | select -expandproperty id\r\nNew-NSAccessControlRecord -initiator_group_id $initiatorID -vol_id $volumeID\r\n\r\n#if you have several nimble groups\r\ndisconnect-NSGroup\r\n<\/pre>\n<p><strong>ps1<\/strong><br \/>\n<strong>if you are going to create LUN for Linux, Windows or Vmware , then pls change performance policy ( in my case i&#8217;m creating LUN using default performance policy for HP-UX)<\/strong><\/p>\n<p><strong>ps2<\/strong><\/p>\n<p>for 3par administrators:<\/p>\n<ol>\n<li>performance policy is equal to persona<\/li>\n<li>Data Access, InitiatorGroup is equal to host\/host set<\/li>\n<li>Linking InitiatorGroup to volume is equal to exporting of LUN to host\/hostset<\/li>\n<li>triple parity can be considered as RAID7<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong>ps3<\/strong><\/p>\n<p><strong>to get quickly all FC WWNs of nimble group use command from ssh to nimble:<\/strong><\/p>\n<pre>fc --list| gawk\u00a0 '{print $7}'\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":null,"protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,17,16],"tags":[],"class_list":["post-1526","post","type-post","status-publish","format-standard","hentry","category-powercli","category-powershell-tips","category-san-storages"],"_links":{"self":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/comments?post=1526"}],"version-history":[{"count":11,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1526\/revisions"}],"predecessor-version":[{"id":1537,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1526\/revisions\/1537"}],"wp:attachment":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/media?parent=1526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/categories?post=1526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/tags?post=1526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}