Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-lldp: Sonic devices advertise themeselves as simple "debian" over lldp instead of sonic #6114

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

sudhanshukumar22
Copy link
Contributor

@sudhanshukumar22 sudhanshukumar22 commented Dec 3, 2020

docker-lldp: Sonic devices advertise themeselves as simple "debian" over lldp instead of sonic

Description:


Sonic devices advertise themeselves as simple "debian" over lldp instead of sonic

log snip:


admin@sonic:~$ show lldp neighbors

LLDP neighbors:

Interface: Ethernet0, via: LLDP, RID: 3, Time: 0 day, 16:36:30
Chassis:
ChassisID: mac b8:6a:97:81:67:74
SysName: sonic
SysDescr: Debian GNU/Linux 9 (stretch) Linux 4.9.0-11-2-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64
TTL: 120
MgmtIP: 10.59.143.140
MgmtIP: fe80::ba6a:97ff:fe81:6774
Capability: Bridge, on
Capability: Router, on
Capability: Wlan, off
Capability: Station, off
Port:
PortID: local Eth1/1
PortDescr: Ethernet0
PMD autoneg: supported: no, enabled: no
MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable

After the fix:
root@sonic:~# tcpdump -i Ethernet16 --direction out -vvv
tcpdump: listening on Ethernet16, link-type EN10MB (Ethernet), capture size 262144 bytes
05:33:27.469075 LLDP, length 288
Chassis ID TLV (1), length 7
Subtype MAC address (4): 80:a2:35:f2:7a:e4 (oui Unknown)
0x0000: 0480 a235 f27a e4
Port ID TLV (2), length 9
Subtype Local (7): Eth1/5/1
0x0000: 0745 7468 312f 352f 31
Time to Live TLV (3), length 2: TTL 120s
0x0000: 0078
System Name TLV (5), length 5: sonic
0x0000: 736f 6e69 63
System Description TLV (6), length 173
SONiC Software Version: SONiC.sonic_upstream_1.0_daily_201130_1501_62-dirty-20201130.203529 - HwSku: Accton-AS7816-64X - Distribution: Debian 10.6 - Kernel: 4.19.0-9-2-amd64
0x0000: 534f 4e69 4320 536f 6674 7761 7265 2056
0x0010: 6572 7369 6f6e 3a20 534f 4e69 432e 736f
0x0020: 6e69 635f 7570 7374 7265 616d 5f31 2e30
0x0030: 5f64 6169 6c79 5f32 3031 3133 305f 3135
0x0040: 3031 5f36 322d 6469 7274 792d 3230 3230
0x0050: 3131 3330 2e32 3033 3532 3920 2d20 4877
0x0060: 536b 753a 2041 6363 746f 6e2d 4153 3738
0x0070: 3136 2d36 3458 202d 2044 6973 7472 6962
0x0080: 7574 696f 6e3a 2044 6562 6961 6e20 3130
0x0090: 2e36 202d 204b 6572 6e65 6c3a 2034 2e31
0x00a0: 392e 302d 392d 322d 616d 6436 34
System Capabilities TLV (7), length 4
System Capabilities [Bridge, WLAN AP, Router, Station Only] (0x009c)
Enabled Capabilities [Bridge, Router] (0x0014)

root@sonic:~# show lldp neighbors Ethernet16

LLDP neighbors:

Interface: Ethernet16, via: LLDP, RID: 10, Time: 0 day, 00:01:00
Chassis:
ChassisID: mac 80:a2:35:f2:7a:e4
SysName: sonic
SysDescr: SONiC Software Version: SONiC.sonic_upstream_1.0_daily_201130_1501_62-dirty-20201130.203529 - HwSku: Accton-AS7816-64X - Distribution: Debian 10.6 - Kernel: 4.19.0-9-2-amd64
MgmtIP: 10.59.143.187
MgmtIP: fe80::82a2:35ff:fef2:7ae4
Capability: Bridge, on
Capability: Router, on
Capability: Wlan, off
Capability: Station, off
Port:
PortID: local Eth1/5/4
PortDescr: Ethernet19
TTL: 120

Please see that system description shows the sonic version, along with debian package information.
Signed-off-by: sudhanshukumar22 sudhanshu.kumar@broadcom.com

- Why I did it
Sonic devices advertise themeselves as simple "debian" over lldp instead of sonic
- How I did it

  1. Introduce a template that reads sonic software build version and Hardware information from config_db.json. This information is set in the system description.
    - How to verify it
    show lldp neighbors Ethernet16
    - Which release branch to backport (provide reason below if selected)
  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@@ -1,6 +1,7 @@
#!/usr/bin/env bash

sonic-cfggen -d -t /usr/share/sonic/templates/lldpd.conf.j2 > /etc/lldpd.conf
sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/lldpdSysDescr.conf.j2 >> /etc/lldpd.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be added to lldpd.conf.j2 instead of creating another template file ?

dockers/docker-lldp/start.sh Outdated Show resolved Hide resolved
-t /usr/share/sonic/templates/lldpd.conf.j2 \
-y /etc/sonic/sonic_version.yml \
-t /usr/share/sonic/templates/lldpdSysDescr.conf.j2 \
"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want the lldod.conf an lldpdSysDescr.conf to be int a single file? if not, you could rewrite as:

CFGGEN_PARAMS=" \
    -d \
    -t /usr/share/sonic/templates/lldpd.conf.j2,<file path> \
    -y /etc/sonic/sonic_version.yml \
    -t /usr/share/sonic/templates/lldpdSysDescr.conf.j2,<file path> \
"

tahmed-dev
tahmed-dev previously approved these changes Dec 17, 2020
@tahmed-dev
Copy link
Contributor

LGTM, please wait for others' input.

@lguohan
Copy link
Collaborator

lguohan commented Dec 20, 2020

retest vsimage please

@sudhanshukumar22
Copy link
Contributor Author

retest vsimage please
@abdosi , @lguohan , @tahmed-dev ,
I don't know how to resolve this issue.
02:13:26 fatal: [vlab-01]: FAILED! => {"changed": true, "cmd": "mv /etc/sonic/minigraph.xml /etc/sonic/minigraph.xml.orig", "delta": "0:00:00.005565", "end": "2020-12-20 20:43:26.284997", "msg": "non-zero return code", "rc": 1, "start": "2020-12-20 20:43:26.279432", "stderr": "mv: cannot stat '/etc/sonic/minigraph.xml': No such file or directory", "stderr_lines": ["mv: cannot stat '/etc/sonic/minigraph.xml': No such file or directory"], "stdout": "", "stdout_lines": []}

mv: cannot stat '/etc/sonic/minigraph.xml': No such file or directory
We need to touch /etc/sonic/minigraph.xml. But since it is an automation run, we cannot do that manually. VS full build has happened successfully.

@lguohan
Copy link
Collaborator

lguohan commented Dec 21, 2020

that is not the error. error is here.

processes_status': {'lldp': {'status': False, 'exited_critical_process': [u'lldp-syncd', u'lldpmgrd']

please check why lldp-syncd or lldpmgrd exited. looks like something in the pr breaks the image.

@sudhanshukumar22
Copy link
Contributor Author

that is not the error. error is here.

processes_status': {'lldp': {'status': False, 'exited_critical_process': [u'lldp-syncd', u'lldpmgrd']

please check why lldp-syncd or lldpmgrd exited. looks like something in the pr breaks the image.
@abdosi , @lguohan , @tahmed-dev ,
I have looked at the logs, but there are no traces indicating why it has crashed. Can anyone tell me the reason for the crash ?

@lguohan
Copy link
Collaborator

lguohan commented Dec 22, 2020

@sudhanshukumar22
Copy link
Contributor Author

there are dump logs from the run, please take a look.

https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-image-pr/8043/artifact/sonic-mgmt/tests/logs/

@lguohan
This fix is as part of patch fix
#6118
0010-Ported-fix-for-length-exceeded-from-lldp-community.patch
Ported fix lldpd/lldpd#408 from LLDP community.
lldpd/lldpd@7824347

syslog:99:Dec 20 20:50:28.631655 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:28 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:103:Dec 20 20:50:29.648728 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:29 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:107:Dec 20 20:50:30.657768 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:30 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:110:Dec 20 20:50:31.670631 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:31 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:114:Dec 20 20:50:32.684800 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:32 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:116:Dec 20 20:50:33.699443 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:33 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:123:Dec 20 20:50:34.708215 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:34 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:127:Dec 20 20:50:35.720733 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:35 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:131:Dec 20 20:50:36.741614 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:36 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:136:Dec 20 20:50:37.752978 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:37 [WARN/lldpctl] unable to set description. Other input/output operation already in progress
syslog:138:Dec 20 20:50:38.770737 vlab-01 INFO lldp#/supervisord: waitfor_lldp_ready 2020-12-20T20:50:38 [WARN/lldpctl] unable to set description. Other input/output operation already in progress

@ben-gale
Copy link
Collaborator

retest vsimage pls

@sudhanshukumar22
Copy link
Contributor Author

The error shown is fixed in https://github.com/Azure/sonic-buildimage/pull/6118/files. Thus this pull request is dependent on #6118 . Hence #6114 should go after #6118 .

@lguohan
Copy link
Collaborator

lguohan commented Jan 5, 2021

can you please resolve the conflict?

abdosi
abdosi previously approved these changes Jan 5, 2021
Copy link
Contributor

@abdosi abdosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…ver lldp instead of sonic

Description:

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

Sonic devices advertise themeselves as simple "debian" over lldp instead of sonic

log snip:

-------------
admin@sonic:~$ show lldp neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface: Ethernet0, via: LLDP, RID: 3, Time: 0 day, 16:36:30
Chassis:
ChassisID: mac b8:6a:97:81:67:74
SysName: sonic
SysDescr: Debian GNU/Linux 9 (stretch) Linux 4.9.0-11-2-amd64 sonic-net#1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64
TTL: 120
MgmtIP: 10.59.143.140
MgmtIP: fe80::ba6a:97ff:fe81:6774
Capability: Bridge, on
Capability: Router, on
Capability: Wlan, off
Capability: Station, off
Port:
PortID: local Eth1/1
PortDescr: Ethernet0
PMD autoneg: supported: no, enabled: no
MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable

After the fix:
root@sonic:~# tcpdump -i Ethernet16 --direction out -vvv
tcpdump: listening on Ethernet16, link-type EN10MB (Ethernet), capture size 262144 bytes
05:33:27.469075 LLDP, length 288
        Chassis ID TLV (1), length 7
          Subtype MAC address (4): 80:a2:35:f2:7a:e4 (oui Unknown)
          0x0000:  0480 a235 f27a e4
        Port ID TLV (2), length 9
          Subtype Local (7): Eth1/5/1
          0x0000:  0745 7468 312f 352f 31
        Time to Live TLV (3), length 2: TTL 120s
          0x0000:  0078
        System Name TLV (5), length 5: sonic
          0x0000:  736f 6e69 63
        System Description TLV (6), length 173
          SONiC Software Version: SONiC.sonic_upstream_1.0_daily_201130_1501_62-dirty-20201130.203529 - HwSku: Accton-AS7816-64X - Distribution: Debian 10.6 - Kernel: 4.19.0-9-2-amd64
          0x0000:  534f 4e69 4320 536f 6674 7761 7265 2056
          0x0010:  6572 7369 6f6e 3a20 534f 4e69 432e 736f
          0x0020:  6e69 635f 7570 7374 7265 616d 5f31 2e30
          0x0030:  5f64 6169 6c79 5f32 3031 3133 305f 3135
          0x0040:  3031 5f36 322d 6469 7274 792d 3230 3230
          0x0050:  3131 3330 2e32 3033 3532 3920 2d20 4877
          0x0060:  536b 753a 2041 6363 746f 6e2d 4153 3738
          0x0070:  3136 2d36 3458 202d 2044 6973 7472 6962
          0x0080:  7574 696f 6e3a 2044 6562 6961 6e20 3130
          0x0090:  2e36 202d 204b 6572 6e65 6c3a 2034 2e31
          0x00a0:  392e 302d 392d 322d 616d 6436 34
        System Capabilities TLV (7), length 4
          System  Capabilities [Bridge, WLAN AP, Router, Station Only] (0x009c)
          Enabled Capabilities [Bridge, Router] (0x0014)

root@sonic:~# show lldp neighbors Ethernet16
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    Ethernet16, via: LLDP, RID: 10, Time: 0 day, 00:01:00
  Chassis:
    ChassisID:    mac 80:a2:35:f2:7a:e4
    SysName:      sonic
    SysDescr:     SONiC Software Version: SONiC.sonic_upstream_1.0_daily_201130_1501_62-dirty-20201130.203529 - HwSku: Accton-AS7816-64X - Distribution: Debian 10.6 - Kernel: 4.19.0-9-2-amd64
    MgmtIP:       10.59.143.187
    MgmtIP:       fe80::82a2:35ff:fef2:7ae4
    Capability:   Bridge, on
    Capability:   Router, on
    Capability:   Wlan, off
    Capability:   Station, off
  Port:
    PortID:       local Eth1/5/4
    PortDescr:    Ethernet19
    TTL:          120
-------------------------------------------------------------------------------

Please see that system description shows the sonic version, along with debian package information.
Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
@sudhanshukumar22
Copy link
Contributor Author

Resolved the merge conflict and pushed again

@lguohan
Copy link
Collaborator

lguohan commented Jan 6, 2021

@abdosi , can you sign off again?

Copy link
Contributor

@abdosi abdosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lguohan lguohan merged commit 8a3ac8f into sonic-net:master Jan 6, 2021
lguohan pushed a commit that referenced this pull request Jan 9, 2021
…ebian (#6114)

Sonic devices advertise meaningful system description along with Debian package information.

before the fix:

-------------
admin@sonic:~$ show lldp neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface: Ethernet0, via: LLDP, RID: 3, Time: 0 day, 16:36:30
SysName: sonic
SysDescr: Debian GNU/Linux 9 (stretch) Linux 4.9.0-11-2-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64
-------------------------------------------------------------------------------

After the fix:

root@sonic:~# show lldp neighbors Ethernet16
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    Ethernet16, via: LLDP, RID: 10, Time: 0 day, 00:01:00
    SysName:      sonic
    SysDescr:     SONiC Software Version: SONiC.sonic_upstream_1.0_daily_201130_1501_62-dirty-20201130.203529 - HwSku: Accton-AS7816-64X - Distribution: Debian 10.6 - Kernel: 4.19.0-9-2-amd64
-------------------------------------------------------------------------------

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants