Hello again. Because of mistake of out network engeneers I need to get all devices, targets and paths VMHost looking at. Is there any script to do this?
The sample script I gave doesn't show all the properties that are available from Get-ScsiLun and Get-ScsiLunPath.
Which specific properties from $esxcli.storage.core.path.list() do you want to get in the output?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You could try something like this
Get-VMHost -PipelineVariable esx | Get-ScsiLun -LunType disk -PipelineVariable lun | Get-ScsiLunPath |
Select @{N='ESX';E={$esx.Name}},
@{N='LUN';E={$lun.CanonicalName}},
LunPath,State
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Get-VMHost <vmhost> -PipelineVariable esx | Get-ScsiLun -LunType disk -PipelineVariable lun | Get-ScsiLunPath |
Select @{N='ESX';E={$esx.Name}}, @{N='LUN';E={$lun.CanonicalName}}, LunPath, State, @{n='WWN';e={
$wwn = Get-VMhost $esx | Get-VMHostHBA -Type FibreChannel | select @{N="WWN";E={"{0:X}" -f $_.PortWorldWideName}} | select -ExpandProperty WWN
if ($_.LunPath -like "*vmhba1*"){
$wwn[0]
}else{
$wwn[1]
}
}
}
Works fine, thanks, LucD
How can I look deeper and get the full path information like esxcli storage core path list command?
UID: <adapter id>+<target id>+<LUN canonical name>
Runtime Name: <LDEV>
Device: <naa>
Adapter: vmhba0
Target: <target number>
LUN: <LUN id>
State: active
Transport: fc
Adapter Identifier: <adapter ID>
Target Identifier: <target ID>
Adapter Transport Details: WWNN: <why not?> WWPN: <...>
Target Transport Details: WWNN: <...> WWPN: <...>
The sample script I gave doesn't show all the properties that are available from Get-ScsiLun and Get-ScsiLunPath.
Which specific properties from $esxcli.storage.core.path.list() do you want to get in the output?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
*UPD
got it. $esxcli.storage.core is the key
Thanks for the help.
Btw, what's the tag for the script code to display normally?
On the code question, basically in the VMTN editor you can switch to HTML mode, and then it's a matter of copying code from your editor as HTML.
Most editors support that nowadays, if not there are add-ons as well.
I did a document on that see Some ways to enter PowerCLI code under the new forum SW
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference