Hello,
Can I have a script to get NAA and LUN ID for all datastores in specific cluster or host or VM I tried to run some scripts to get runtime name but always getting an empty field, any Idea?
There are some additional datastore functions available to download in this blog post.
Automating Datastore/Storage Device Detachment in vSphere 5 - VMware vSphere Blog
Try "Get-DatastoreMountInfo". It should get the LUN information.
Try to use RVTools, you can fetch the NAA and LUN ID for all datastores in specific cluster or host or VM
Thanks for your hint, but RVtools does not return the LUN ID or NAA of specific VM only in host you can find NAA but not LUN ID also is not showing RDM LUNs as well.
Thanks but I am still not able to see the LUN ID , the command get-scsilun have the option to export runtime where LUN ID is part of it however, it is always return empty information !!
Hi amakki..
Once you run this and export to .csv
$esxName = "bdesx03.dev.ops"
Connect-VIServer vcnp02.dev.ops
New-VIProperty -Name lunDatastoreName -ObjectType ScsiLun -Value {
param($lun)
$ds = $lun.VMHost.ExtensionData.Datastore | %{Get-View $_} | `
where {$_.Summary.Type -eq "VMFS" -and
($_.Info.Vmfs.Extent | where {$_.DiskName -eq $lun.CanonicalName})}
if($ds){
$ds.Name
}
} -Force | Out-Null
Get-VMHost -Name $esxName | Get-ScsiLun | Select CanonicalName, CapacityMB, lunDatastoreName