Page MenuHomePhabricator

Add LLDP PortDescr, MTU facts improve vlan to Facter
Closed, ResolvedPublic

Description

Right now the lldp facts has {'eno1': {'vlan': 'vlan-1001', 'neighbor': 'asw2-a-eqiad', 'port': 'ge-4/0/22'}}

Or

{'ens3f1np1': {'vlan': 'vlan-1106', 'neighbor': 'cloudsw1-c8-eqiad.mgmt.eqiad.wmnet', 'port': 'xe-0/0/47'}, 'ens3f0np0': {'vlan': 'vlan-1118', 'neighbor': 'cloudsw1-c8-eqiad.mgmt.eqiad.wmnet', 'port': 'xe-0/0/27'}}

While lldpcli also show:

$ /usr/sbin/lldpctl -f xml
[...]
<descr label="PortDescr">lvs1016:enp4s0f0 {#4061}</descr>

This would be useful to get the cable ID {#xxxx} of a given switch<->host cable for T262899

One open question is: should we directly expose the cable ID as well as fact, or only the PortDescr?


Additionally, the MTU is exposed like:
<mfs label="MFS">9192</mfs>
Which is needed as well.


Last, Facter only supports single vlans, for example if the device receives:

$ /usr/sbin/lldpctl -f xml
[...]
  <vlan label="VLAN" vlan-id="1004">vlan-1004</vlan>
  <vlan label="VLAN" vlan-id="1020" pvid="yes">vlan-1020</vlan>

It means:
vlans 1004 and 1020 are trunked, and 1020 is a native vlan (or access).
But Facter only reports:
'enp4s0f0': {'vlan': 'vlan-1020', 'neighbor': 'asw2-d-eqiad', 'port': 'xe-7/0/15'},

Ideally it would report something like (in yaml only for the clarity of the example):

vlans:
   1020:
      mode: access
   1004:
      mode: trunked

Or maybe simpler:

vlans:
   1020: access
   1004: trunked

Event Timeline

ayounsi triaged this task as Medium priority.Oct 14 2020, 9:02 AM
ayounsi created this task.
ayounsi renamed this task from Add LLDP PortDescr fact to Facter to Add LLDP PortDescr and MTU fact to Facter.Oct 14 2020, 10:04 AM
ayounsi updated the task description. (Show Details)
ayounsi renamed this task from Add LLDP PortDescr and MTU fact to Facter to Add LLDP PortDescr, MTU facts improve vlan to Facter.Oct 14 2020, 10:37 AM
ayounsi updated the task description. (Show Details)

Change 633977 had a related patch set uploaded (by Jbond; owner: John Bond):
[operations/puppet@production] lldp: add additional information to lldp fact

https://gerrit.wikimedia.org/r/633977

One open question is: should we directly expose the cable ID as well as fact, or only the PortDescr?

As far as i can tell the cable id is only exposed via the PortDescr i.e. its not available as an attribute in its own right, as such i would just expose PortDescr

Change 633977 merged by Jbond:
[operations/puppet@production] lldp: add additional information to lldp fact

https://gerrit.wikimedia.org/r/633977

ayounsi assigned this task to jbond.

Thanks! Works great!