Hello,
we have around 300 production ESXi host, each has 4 online vmhba but only two has targets and paths while other two has 0 targets/paths.
we're looking for script to list each ESXi host name & vmhba# & WWN & number of targets to unzone 0 targets vmhba to free fabric ports.
we tried LucD below script but it doesn't give WWN, wish if there any help to add WWN to the script.
----------------------------------------------------------
foreach($esx in Get-VMHost){
foreach($hba in (Get-VMHostHba -VMHost $esx -Type "FibreChannel")){
$target = ((Get-View $hba.VMhost).Config.StorageDevice.ScsiTopology.Adapter | where {$_.Adapter -eq $hba.Key}).Target
$luns = Get-ScsiLun -Hba $hba -LunType "disk" -ErrorAction SilentlyContinue
$nrPaths = ($target | %{$_.Lun.Count} | Measure-Object -Sum).Sum
$props = [ordered]@{
VMHost = $esx.name
HBA = $hba.Name
Targets = $target.Count
Devices = $luns.Count
Paths = $nrPaths
}
New-Object PSObject -Property $props
}
}
Thanks in Advance
Have a look at
Add WWN WWP on SANLUN script - VMware Technology Network VMTN
or
Get-ScsiLunPath and SanID - VMware Technology Network VMTN
or
Solved: Script to output WWN Datacenter Cluster Host - VMware Technology Network VMTN
And I'm pretty sure you'll find some more when you use Search in this community.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
we spent 6 hours trying within all URL you mentioned as we understand you shouldn't work for the community but no luck.
the issue we can't merge below two scripts shown on below screenshot. if you can help this will save us a lot
we're looking for output similar to :
VMHost : x.y.z
HBA : vmhba64
WWPN : x.y.z
Targets : 4
Devices : 31
Paths : 62
Thanks LucD