vmware / vmware/pyvmomi

Issue extracting `linkSpeed` from some host PNICs when speed is set to auto-negotiate

Open
#582 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question VMware Staff Assist Needed
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

I have a system running VCSA 6.0 and I'm using pyvmomi 6.5

I have a 2 esxi 6.0 hosts which each have a pair of PNICs that have been moved in and out of LACP/LAG configurations repeatedly, vmnic3 and vmnic4 of each host. I've observed that only these PNICs are showing no line_speed value as collected from the code below, meaning that host_pnic.linkSpeed is not set.

On one host, vmnic3 and vmnci4 are listed as Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet cards. On the other host, vmnic3 and vmnic4 are listed as Intel Corporation 82576 Gigabit Network Connection. In addition, each host has 6 network adapters, and all of them have configured speed set to 'Auto negotiate'. However, only vmnic3 and vmnic4 have no line_speed value, the rest of them result with line_speed = 1000

The value is collected as follows:

    host_view = vsphere_connection.get_host_view()
    sets = ['config.host']
    hosts = vsphere_connection.collect_properties(view_ref=host_view,
        obj_type=vim.HostSystem,
        path_set=sets)
                                                      
    for host in hosts:
        host_pnics = host.get('config.network.pnic')
        for host_pnic in host_pnics
           if not isinstance(host_pnic, vim.host.PhysicalNic):
                self._logger.warning('Unexpected PNIC type: %s for Host (%s) on vSphere %s',
                                     type(host_pnic).__name__, host_moref, vsphere_uuid)
                continue
            link_speed = host_pnic.linkSpeed.speedMb if host_pnic.linkSpeed else None

The documentation states:

linkSpeed (vim.host.PhysicalNic.LinkSpeedDuplex, optional):
The current link state of the physical network adapter. If this object is not set, then the link is down.

The links are certainly up.

image

image

Is there any reason to expect that these PNICs would not have a linkSpeed? Is there some sort of interaction with LACP/LAG configuration that might cause an issue here? Those PNICs have been moved repeatedly in and out of LAGs which were assigned as the active uplinks.

Is there another way to determine the negotiated line speed of a PNIC?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shown collect_properties call and the vim.host.PhysicalNic.linkSpeed documentation, then compare the affected PNICs across the reported vSphere versions and configurations. Done means determining whether a missing linkSpeed is expected for these adapters and identifying a supported way to obtain negotiated speed, if one exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.