Auto-map all available HP StoreVirtual/LeftHand iSCSI volumes in Windows via PowerShell

Now that we’re running a Nimble SAN alongside our HP LeftHand/StoreVirtual system, I’ve been spoiled by the little PowerShell script that Nimble have drummed up.

Rather than having to do lots of clicking to manually connect all the possible MPIO iSCSI sessions per SAN LUN, they use a PowerShell script that discovers the available target IPs, the storage NICs, the available volumes, and then initiates one connection per storage NIC to each volume. This saves an awful lot of repetitive mouse clicking work, and removes the scope for errors – eg. forgetting to make all the connections to a particular LUN.

LeftHand MPIO PowerShell script in action

I’ve adapted this script to work for LeftHand SAN volumes – but make no mistake, the wizardry is all Nimble’s – not mine.

Obviously test this before running it in your production environment. I’ve used it on Server 2012 R2 and it’s really made adding cluster volumes a lot easier.

Please don’t ask me how to get the PowerShell script to run if you come across execution policy issues. If you don’t know how to resolve that yourself, you shouldn’t be running scripts like this.

Download the script here.