The following script allows the user to retrieve a listing of Network (ENIC) & Storage (FNIC) firmware drivers installed on Cisco UCS blades at a per vSphere cluster level. You may download the ‘Cisco_FNIC_ENIC.ps1‘ script here: Cisco_FNIC_ENIC.ps1 (Remove the .doc extension).
The script will begin by prompting you to enter the vCenter IP Address, username and password. A list of all the available clusters residing in vCenter will be returned. Followed by a prompt to enter the vSphere cluster name, from the cluster defined the script will retrieve a per ESXi listing of ENIC&FNIC firmware levels. The script will firstly prompt the user to enable SSH on all the hosts in the cluster:


Once you have completed the tasks on the hosts that required SSH Access, you may then return to the running script and type option ‘y’ in order to again disable SSH on all the hosts in the specified cluster:

PowerCLI Script:
#######################################
# Confirm CISCO FNIC & ENIC Drivers
# Date: 2016-07-01
# Created by: David Ring
#######################################
###### vCenter Connectivity Details ######
Write-Host “Please enter the vCenter Host IP Address:” -ForegroundColor Yellow -NoNewline
$VMHost = Read-Host
Write-Host “Please enter the vCenter Username:” -ForegroundColor Yellow -NoNewline
$User = Read-Host
Write-Host “Please enter the vCenter Password:” -ForegroundColor Yellow -NoNewline
$Pass = Read-Host
Connect-VIServer -Server $VMHost -User $User -Password $Pass
###### Please enter the Cluster to check CISCO Versions #######
Write-Host “Clusters Associated with this vCenter:” -ForegroundColor Green
$VMcluster = ‘*’
ForEach ($VMcluster in (Get-Cluster -name $VMcluster)| sort)
{
Write-Host $VMcluster
}
Write-Host “Please enter the Cluster to lookup CISCO FNIC & ENIC Drivers:” -ForegroundColor Yellow -NoNewline
$VMcluster = Read-Host
###### Enabling SSH ######
Write-Host “Do you need to Enable SSH on the Cluster ESXi Hosts? ” -ForegroundColor Yellow -NoNewline
Write-Host ” Y/N:” -ForegroundColor Red -NoNewline
$SSHEnable = Read-Host
if ($SSHEnable -eq “y”) {
Write-Host “Enabling SSH on all hosts in your specified cluster:” -ForegroundColor Green
Get-Cluster $VMcluster | Get-VMHost | ForEach {Start-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.Key -eq “TSM-SSH”})}
}
###### Confirm Driver Versions ######
Write-Host “Confirm CISCO FNIC & ENIC Drivers” -ForegroundColor Green
$hosts = Get-Cluster $VMcluster | Get-VMHost
forEach ($vihost in $hosts)
{
Write-Host -ForegroundColor Magenta “Gathering Driver versions on” $vihost
$esxcli = get-vmhost $vihost | Get-EsxCli
$esxcli.software.vib.list() | Where { $_.Name -like “net-enic”} | Select @{N=”VMHost”;E={$ESXCLI.VMHost}}, Name, Version
$esxcli.software.vib.list() | Where { $_.Name -like “scsi-fnic”} | Select @{N=”VMHost”;E={$ESXCLI.VMHost}}, Name, Version
}
###### Disabling SSH ######
Write-Host “Ready to Disable SSH? ” -ForegroundColor Yellow -NoNewline
Write-Host ” Y/N:” -ForegroundColor Red -NoNewline
$SSHDisable = Read-Host
if ($SSHDisable -eq “y”) {
Write-Host “Disabling SSH” -ForegroundColor Green
Get-Cluster $VMcluster | Get-VMHost | ForEach {Stop-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.Key -eq “TSM-SSH”}) -Confirm:$FALSE}
}
Useful References:
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1027206
http://www.cisco.com/c/en/us/support/docs/servers-unified-computing/ucs-b-series-blade-servers/115764-ucs-san-tshoot-00.html
Like this:
Like Loading...
Related
ESXi 6.5 uses the nenic driver. You can replace the line:
$esxcli.software.vib.list() | Where { $_.Name -like “net-enic”} | Select @{N=”VMHost”;E={$ESXCLI.VMHost}}, Name, Version
with:
$esxcli.software.vib.list() | Where { $_.Name -like “nenic”} | Select @{N=”VMHost”;E={$ESXCLI.VMHost}}, Name, Version
Thanks Dan
The same for the fNic replace scsi-fnic with nfnic