Hello Nassim,
To retrieve lunid of mapped LUNs in a project, I used two loops of igroup-list-info and lun-initiator-list-map-info.
lun-list-info and lun-map-list-info work as well but is slow because you have to run lun-map-list-info for each LUNs in loop.
Here an example in powershell
$naigroups = Get-NaIgroup
ForEach ($naigroup in $naigroups)
{
if (!$naigroup.name.StartsWith("via"))
{
#Just use the first initiator in igroup.
$nawwn = $naigroup.Initiators[0]
if ($nawwn)
{
$naluns = Get-NaLunMapByInitiator -Initiator $nawwn
Write-Host "Get information for " $naigroup.Name " with " $naluns.count " lun(s)"
$luncount = 0
ForEach ($lun in $naluns)
{
$luncount+=1
$lunfilerpath = $lun.path
$lunfilerid = $lun.LunId
$lunfilerig = $naigroup.Name
[string]$filername= $filer.Value
$newlun= Newlunfiler $lunfilerpath $lunfilerid $lunfilerig $filername
$global:mylunsfiler+=$newlun
# Debug
# Write-Host "Retrieve LUN information --> " $luncount")" $lunfilerpath":"$lunfilerid
}
}
}
}