Hi Luc,
is there any datastore name properyin get-scsilun command .
this command gives lot of info but not datastore name.
You could do something like this.
But note that you will get a separate line for each path to a LUN.
You could solve the multiple entries with a Sort-Object -Property CanonicalName -Unique after the Select
Get-VMHost -Location (Get-Cluster MyCluster) -PipelineVariable esx |
Get-Datastore -PipelineVariable ds | where{$_.Type -eq 'VMFS'} |
Get-ScsiLun |
Select @{N='VMHost';E={$esx.Name}},
@{N='Datatsore';E={$ds.Name}},
MultipathPolicy, CanonicalName
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No, there isn't I'm afraid.
You will have to do a Get-Datastore, extract the CanonicalName, and then you can map this CanonicalName (in the Get-ScsiLun output) to a DatastoreName.
I do this with a hash table, see for example Get The Maximum IOPS (lines 9-14 and 24)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thnaks Luc ,iam checking that but i thought of trying the following way.
i tried to combine both commands get-datastore and get-scsilun .
two isues happend
1:it printed name, datastorelist,pathpolicy of ds though its tough to read for all.
2:iam not sure why it did not print canonicalname. is it because we have lot of entiries
and this method is not appropriate ?
$report=foreach ($esxi in (get-vmhost -location (get-cluster mycluster )))
{
$esxi|select name, @{N='datastore list';E={$_|get-datastore|select name }},
@{N='path policy of ds';E={
$scsil=get-scsilun -vmhost $esxi
$scsil.multipathpolicy}},
@{N= 'canonicalname';E={
$ds=get-datastore -vmhost $esxi
$ds.ExtensionData.info.vmfs.extent.diskname}}
}
$report|out-file report.txt
$report|out-file report.txt
You could do something like this.
But note that you will get a separate line for each path to a LUN.
You could solve the multiple entries with a Sort-Object -Property CanonicalName -Unique after the Select
Get-VMHost -Location (Get-Cluster MyCluster) -PipelineVariable esx |
Get-Datastore -PipelineVariable ds | where{$_.Type -eq 'VMFS'} |
Get-ScsiLun |
Select @{N='VMHost';E={$esx.Name}},
@{N='Datatsore';E={$ds.Name}},
MultipathPolicy, CanonicalName
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc this is what i wanted but if you dont mind me asking following
i was checking all parameters for command get-vmhost but did not find anything that says "-PipelineVariable ".could you explain something about this .
The PipelineVariable is a so-called common PowerShell parameter (not PowerCLI) parameter (and a few others like WhatIf...)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference