Hi Experts,
Hope, It might be asked earlier as well as answered.
I need to get the details of datastore with naa identifier on the cluster or entire vcenter.
get-scsilun - give naa identifier but not the Datastore name.
Any help?
My LUN report – datastore, RDM and node visibility post has a script that shows how to report on that relation.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not as sophisticated as Luc's, but easy to run nonethless and you can pass a datacetner or cluster.
Get-cluster cluster | get-vmhost | foreach {Write-Host; $_.Name; $_ | Get-Datastore | Select Name,@{N='Naa';E={($_ | Get-View).Info.Vmfs.Extent.Diskname}} }
Luc, I was having issues on this and was hoping you could help caus I'd like to actually use this myself. For this command how could I have it put the hostname lined up with each datastore?
Right now it looks like this:
hostname
Name NAA
datastore naa.12313123123123123
How could I have it look like this:
Hostname Name NAA
Hostname datastore naa.12313123123123123
Since this is for a cluster and most datastores will be shared I would do something like this
Get-Cluster cluster | Get-VMHost | Get-Datastore | Select Name,
@{N="Hosts";E={[string]::Join(',',($_.ExtensionData.Host | %{Get-View $_.Key | Select -ExpandProperty Name}))}},
@{N='Naa';E={[string]::Join(',',($_.ExtensionData.Info.Vmfs.Extent | Select -ExpandProperty DiskName))}} |
fl
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Cool that works, thanks again, I don't know how you do this stuff man. It's like you are a powercli savant!