VMware Cloud Community
lElOUCHE_79
Enthusiast
Enthusiast

Network - IO Devices against vSAN HCL

I have this script
https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-HBAs-amp-NIC-details-along-with-cl...

that retreive informations for NICs, I'm asking if we can add a check based on the vSAN HCL provided by vmware on this link https://partnerweb.vmware.com/service/vsan/all.json

Reply
0 Kudos
27 Replies
LucD
Leadership
Leadership

Place a Write-Host inside the Catch block

Catch {
  Write-Host $global:esxcli
  Write-Host $global:vmhbald
}


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

Reply
0 Kudos
lElOUCHE_79
Enthusiast
Enthusiast

       # Get driver vib package version
        Try{
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = "net-"+$vmnicDetail.DriverInfo.Driver})
        }Catch{
            Write-Host $global:esxcli
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = $vmnicDetail.DriverInfo.Driver})
        }
        $Info.VibVersion = $driverVib.Version
    }
   
    } elseif ($device.DeviceClass -eq "MassStorageController" -or $device.DeviceClass -eq "SerialBusController"){
    # Identify HBA (FC or Local Storage) with PCI slot Id
    # Todo: Sometimes this call fails with: Get-VMHostHba  Object reference not set to an instance of an object.
    $global:vmhbaId = $device.VMHost | Get-VMHostHba -ErrorAction SilentlyContinue | Where-Object { $_.PCI -like '*'+$device.Id}
    $Info.Device = $global:vmhbaId.Device
    $Info.Driver = $global:vmhbaId.Driver
    # Get driver vib package version
    Try{
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = "scsi-"+$global:vmhbaId.Driver})
    }Catch{
        Write-Host $global:vmhbald
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = $global:vmhbaId.Driver})
    }
    $Info.VibVersion = $driverVib.Version
    }
 
Same issue, even I added the below in the 2 catch block

  Write-Host $global:esxcli
  Write-Host $global:vmhbald
Reply
0 Kudos
LucD
Leadership
Leadership

So there is no output from either of these Write-Host lines?
To make sure add some extra characters

  Write-Host "|$($global:esxcli)|"
  Write-Host "|$($global:vmhbald)|"


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

Reply
0 Kudos
lElOUCHE_79
Enthusiast
Enthusiast

No output

I added a debug option on the top of the script and I got error messagerelated to this line

$global:vmhbaId = $device.VMHost | Get-VMHostHba -ErrorAction SilentlyContinue | Where-Object { $_.PCI -like '*'+$device.Id}
 
I also added the below  in the catch block and same error
 
  Write-Host "|$($global:esxcli)|"
  Write-Host "|$($global:vmhbald)|"
 

 

 

 

Reply
0 Kudos
LucD
Leadership
Leadership

But you should see those 2 vertical bars on the console


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

Reply
0 Kudos
lElOUCHE_79
Enthusiast
Enthusiast

trust me always some rror message

 

        # Get driver vib package version
        Try{
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = "net-"+$vmnicDetail.DriverInfo.Driver})
        }Catch{
            Write-Host "|$($global:esxcli)|"
            Write-Host "|$($global:vmhbald)|"
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = $vmnicDetail.DriverInfo.Driver})
        }
        $Info.VibVersion = $driverVib.Version
    }
   
    } elseif ($device.DeviceClass -eq "MassStorageController" -or $device.DeviceClass -eq "SerialBusController"){
    # Identify HBA (FC or Local Storage) with PCI slot Id
    # Todo: Sometimes this call fails with: Get-VMHostHba  Object reference not set to an instance of an object.
    $global:vmhbaId = $device.VMHost | Get-VMHostHba -ErrorAction SilentlyContinue | Where-Object { $_.PCI -like '*'+$device.Id}
    $Info.Device = $global:vmhbaId.Device
    $Info.Driver = $global:vmhbaId.Driver
    # Get driver vib package version
    Try{
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = "scsi-"+$global:vmhbaId.Driver})
    }Catch{
        Write-Host "|$($global:esxcli)|"
        Write-Host "|$($global:vmhbald)|"
        $driverVib = $global:esxcli.software.vib.get.Invoke(@{vibname = $global:vmhbaId.Driver})
    }
    $Info.VibVersion = $driverVib.Version
    }
$Info.Supported = $DeviceFound
$AllInfo += $Info
Reply
0 Kudos
lElOUCHE_79
Enthusiast
Enthusiast

@LucD 

did you get any chance to find what's wrong?

Reply
0 Kudos
LucD
Leadership
Leadership

No , I can't replicate what you are seeing.


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

Reply
0 Kudos