Page 1 of 1

Getting LUN numbers using Powershell and the 3PAR toolkit

Posted: Wed Dec 14, 2016 4:01 pm
by dirk.devos
Hi,

To make our lives easier I was looking to extract the LUN numbers for a given selection of virtual volumes but there appears to be some inconsistancy on when LUN numbers are available. If I run the powershell script below I only get LUN numbers for virtual volumes that were not part of a virtual set and and not exported to s host set.

Does anybody have any ideas how to get a complete list of LUN numbers?


$vv_list = Get-3parVV | Select name | Where-Object {$_.name -Like "xyz*"}
foreach ($vv_item in $vv_list)
{
$vv_name = $vv_item.name
$vv_lun = (Get-3parVLUN -vvName $vv_name).LunID
Write-Host $vv_name $vv_lun
}

Re: Getting LUN numbers using Powershell and the 3PAR toolki

Posted: Fri Dec 16, 2016 7:09 am
by Richard Siemers
I don't have the 3PAR powershell component loaded... but the normal non-powershell 3PAR cli command showvlun works to show LUN# for both hosts and host sets, I was not able to test it for volume sets, but I suspect it also works as intended.

Can you explain the problem you are trying to solve with this scipt? Its not clear to me, but I think it may be that my deployment uses a VV naming convention that includes the LUN# in the VV name, and we've planned it such that if a VV is to be exported to multiple hosts, it will be the same LUN# on all hosts.

Re: Getting LUN numbers using Powershell and the 3PAR toolki

Posted: Mon Dec 19, 2016 6:48 pm
by dirk.devos
The issue that I am trying to solve is that we also have LUN's that are exported to multiple hosts and we are stepping on ourselves. It sounds like a great idea to include the LUN as part of the VV name but now we need to get a list of all the LUN numbers that have already been assigned.

Re: Getting LUN numbers using Powershell and the 3PAR toolki

Posted: Thu Dec 29, 2016 10:06 am
by Richard Siemers
showvlun command will do what you need.

It can show you all the luns assign to a host, or show you all the LUNs assigned to a VV.

using the -pathsum option will condense the output down to 1 LUN# per host, instead of showing a line for each path to the same host.