Can some one help me to complete the below script.I can't able to get HBA and Nic Driver information.
Get-Datacenter | % {$datacenter=$_
Get-VMhost -Location $datacenter | Get-VMHostHBA -Type FibreChannel | where {$_.Status -eq "online"} |
Select @{N="Datacenter";E={$datacenter}},@{N="VMHost";E={$_.VMHost.Name}},@{N="HostName";E={$($_.VMHost | Get-VMHostNetwork).HostName}},@{N="ver";E={$_.VMhost.version}},@{N="Manf";E={$_.VMhost.Manufacturer}}, @{N="Hostmodel";E={$_.VMhost.Model}},@{Name="SerialNumber";Expression={$_.VMhost.ExtensionData.Hardware.SystemInfo.OtherIdentifyingInfo |Where-Object {$_.IdentifierType.Key -eq "Servicetag"} |Select-Object -ExpandProperty IdentifierValue}},
@{N="Cluster";E={if($_.VMHost.ExtensionData.Parent.Type -ne "ClusterComputeResource"){"Stand alone host"}
else{
Get-view -Id $_.VMHost.ExtensionData.Parent | Select -ExpandProperty Name
}
}},Device,Status,@{N="WWN";E={((("{0:X}"-f $_.PortWorldWideName).ToLower()) -replace "(\w{2})",'$1:').TrimEnd(':')}},@{N="HBA Model";E={($_.VMhost | get-vmhosthba -Type FibreChannel | where {$_.Status -eq "online"} | select-object -ExpandProperty Model ) | Get-Unique}},
@{N="fnicdriver";E={$esxcli.software.vib.list() | ? {$_.Name -match ".*$hbadriver.*"} | Select -Expand Version}}
@{N="Fnicvendor";E={$esxcli.software.vib.list() | ? {$_.Name -match ".*$hbadriver.*"} | Select -Expand Vendor}},
@{N="enicdriver";E={$esxcli.system.module.get("enic").version}}
@{N="Enicvendor";E={$esxcli.software.vib.list() | ? {$_.Name -match ".$net.*"} | Select -Expand Vendor}}}
Hi LucD/Vineeth,
this script isn't pulling HBA model for Cisco UCS Blades. Please refer below output.
Hostmodel | Device | Model | Status | WWPN | WWN | Fnicvendor |
UCSB-B420-M3 | vmhba1 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:02 | 20:00:00:25:b5:25:a0:05 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba2 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:02 | 20:00:00:25:b5:25:b0:05 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba3 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:02 | 20:00:00:25:b5:25:a0:04 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba4 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:02 | 20:00:00:25:b5:25:b0:04 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba1 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:03 | 20:00:00:25:b5:25:a0:07 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba2 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:03 | 20:00:00:25:b5:25:b0:07 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba3 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:03 | 20:00:00:25:b5:25:a0:06 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba4 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:03 | 20:00:00:25:b5:25:b0:06 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba1 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:04 | 20:00:00:25:b5:25:a0:09 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba2 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:04 | 20:00:00:25:b5:25:b0:09 | Cisco Systems Inc |
UCSB-B420-M3 | vmhba3 | Cisco VIC FCoE HBA Driver | online | 20:00:00:25:b5:25:00:04 | 20:00:00:25:b5:25:a0:08 | Cisco Systems Inc |
Best Regards,
Swamy Naveen.
If the UCS blades do not expose the info in the way ESXi expects it, you will not be able to obtain that info in this way.
But have a look at 3. Re: Can we write "PowerCLI Script" to get Cisco UCS VIC1240 Card Details (Firmware???
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
vineeth,
So what does the remarked lines are for:
@{N="Fnicvendor";E={$esxcli.software.vib.list() | ? {$_.Name -match ".*$($hba.hbadriver).*"} | Select -First 1 -Expand Vendor}},
@{N="Enicvendor";E={$esxcli.software.vib.list() | ? {$_.Name -match ".net.*"} | Select -First 1 -Expand Vendor}},
@{N="Enicvendor";E={$esxcli.network.nic.list() | where {$vmnic.name -eq $_.vmnic1} | select -First 1 -ExpandProperty Description }}
You can remove those lines which are commented with # from the script which is marked as correct.
While working on the script I have tested multiple ways to get Fnic and Enic vendor info. Mistakenly I have copied those lines in main script you can ignore or remove the lines which are marked with #