PowerCLI

  • 1.  VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Sep 12, 2024 02:25 AM

    Can you suggest any alternative way to find the VMkernel Name as we are unable to fetch the detail as we are unable to fetch the details from the below commands. Please suggest any alternative 

    $esxcli2 = Get-EsxCli -VMHost $vmhost -V2

    $esxcli2.hardware.pci.list.Invoke()

    As we are trying to fetch the data using the above commands.
    Write-Host "`tGathering information from $vmhost ..."
            $pciDevices = $esxcli2.hardware.pci.list.Invoke() | Where-Object {$_.VMKernelName -like "vmhba*" -or $_.VMKernelName -like "vmnic*" -or $_.VMKernelName -like "vmgfx*" } | Sort-Object -Property VMKernelName 
            foreach ($pciDevice in $pciDevices) {
                $device = $vmhost | Get-VMHostPciDevice | Where-Object { $pciDevice.Address -match $_.Id }
                #Write-Output -Message ((Get-Date -Format G) + "`tGet driver version for: " + $pciDevice.ModuleName)
                $driverVersion = $esxcli2.system.module.get.Invoke(@{module = $pciDevice.ModuleName}) | Select-Object -ExpandProperty Version -ErrorAction SilentlyContinue



  • 2.  RE: VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Sep 12, 2024 04:38 AM

    Did you try with ModuleName?

    $esxcli2 = Get-EsxCli -VMHost $vmhost -V2
    
    $esxcli2.hardware.pci.list.Invoke()
    
    $pciDevices = $esxcli2.hardware.pci.list.Invoke() |
      Where-Object { $_.ModuleName -like "vmhba*" -or
                   $_.ModuleName -like "vmnic*" -or
                   $_.ModuleName -like "vmgfx*" } |
      Sort-Object -Property ModuleName
    foreach ($pciDevice in $pciDevices) {
      $device = $vmhost | Get-VMHostPciDevice | 
        Where-Object { $pciDevice.Address -match $_.Id }
      $driverVersion = $esxcli2.system.module.get.Invoke(@{module = $pciDevice.ModuleName }) | 
      Select-Object -ExpandProperty Version -ErrorAction SilentlyContinue
    }


    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 3.  RE: VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Sep 13, 2024 10:57 AM
    Edited by Avesh Sampara Sep 13, 2024 11:00 AM

    Hi LucD,

    Yes tried it and still it show the empty entries as the modules names are populating as lpfc or with the network module names as mentioned below. 

    ModuleName            : i40en or ModuleName            : lpfc.

    We are unable to filter with below command. 

    $esxcli2 = Get-EsxCli -VMHost $vmhost -V2


    $pciDevices = $esxcli2.hardware.pci.list.Invoke() |
      Where-Object { $_.ModuleName -like "vmhba*" -or
                   $_.ModuleName -like "vmnic*" -or
                   $_.ModuleName -like "vmgfx*" } |
      Sort-Object -Property ModuleName
    foreach ($pciDevice in $pciDevices) {
      $device = $vmhost | Get-VMHostPciDevice | 
        Where-Object { $pciDevice.Address -match $_.Id }
      $driverVersion = $esxcli2.system.module.get.Invoke(@{module = $pciDevice.ModuleName }) | 
      Select-Object -ExpandProperty Version -ErrorAction SilentlyContinue
    }

    Can you confirm if the VMKernel Name is deprecated in vSphere version 8 ? 




  • 4.  RE: VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Sep 13, 2024 11:06 AM

    Seems to work for me in vSphere 8.*



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 5.  RE: VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Sep 13, 2024 11:42 PM

    When I run the below command on the ESXi version VMware ESXi, 8.0.2, 23305546.
    Address               : 0000:5b:00.3
    Bus                   : 91
    Chassis               : 0
    ConfiguredOwner       : VMkernel
    CurrentOwner          : VMkernel
    DependentDevice       : PCI 0:91:0:3
    DeviceClass           : 512
    DeviceClassName       : Ethernet controller
    DeviceID              : 5631
    DeviceLayerBusAddress : s00000005.03
    DeviceName            : Ethernet Controller X710 for 10GBASE-T
    FPTSharable           : true
    Flags                 : 12289
    Function              : 3
    HardwareLabel         : 
    IRQ                   : 255
    InterruptLine         : 255
    InterruptVector       : 0
    ModuleID              : 63
    ModuleName            : i40en
    NUMANode              : 1
    PCIPin                : 0
    ParentDevice          : PCI 0:90:0:0
    PassthruCapable       : true
    PhysicalSlot          : 5
    ProgrammingInterface  : 0
    ResetMethod           : Function reset
    RevisionID            : 2
    Segment               : 0
    Slot                  : 0
    SlotDescription       : PCIe Slot 5
    SpawnedBus            : 0
    SubDeviceID           : 0
    SubVendorID           : 32902
    VMkernelName          : 
    VendorID              : 32902
    VendorName            : Intel(R)
    VirtualFunction       : 

    Not sure if it is a problem with this specific version of ESXi 8.0.2c 




  • 6.  RE: VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Sep 15, 2024 03:09 AM

    I suggest opening an SR



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 7.  RE: VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Sep 23, 2024 10:51 PM

    LucD has helped me heaps in the past however there were things he tried to help me with which did not work for me, and the reason for this is that he is using vSphere 8 while I'm on vSphere 7.

    To get the VMkernels from vCenter 7, I normally run this command:

    Get-VMHostNetworkAdapter -VMKernel -VMHost MyHostName| Sort-Object DeviceName | format-list

    PS: The code you're using is to extract the PCI details from the host- is this what you need? Are you trying to establish which VMkernel is attached to which PCI address (vmnic)?




  • 8.  RE: VMkernel Name is no more visible on the PCI list when we run the esxcli hardware command in vSphere Version 8

    Posted Dec 17, 2024 11:29 AM

    I opened an SR:

    • Issue Clarification:
      • VMkernelName showing blank results in PowerCLI on 8.x host
    • Issue Verification:
      •  When the Customer runs the following command on an 8.x host, VMkernelName returns blank results. 
        $esxcli = Get-EsxCLI -VMHost $ESXHost -V2
        $pci = $esxcli.hardware.pci.list.Invoke()
    • Cause Identification:
      •  "VMkernel Name" field has been deprecated.
    • Cause Justification:
      •  The engineering team confirmed that It is empty in 8.0 and now it is not even shown in the 9.0 release.

    Engineering blessed my workaround:

    Match "Address" in hardware.pci.list to "PCIDevice" in network.nic.list and you'll retrieve the vmnic# etc.