sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
736 stars 1.42k forks source link

LLDP is not taking the hostname set by user till lldp is stopped and restarted #7523

Open dprital opened 3 years ago

dprital commented 3 years ago

Description

By default hostname is set as sonic in lldp packets. Though the switch prompt says hostname (from hostd conf file). When user changes hostname through cli sudo config hostname . LLDP is not taking the hostname set by user till lldp is stopped and restarted.

After lldp start/restart seeing hostname sent correctly to peers.

lldp process need to snoop/take care when hostname is changed.

Steps to reproduce the issue:

admin@r-qa-sw-eth-2029:~$ sudo config hostname r-qa-sw-eth-2029

Running command: service hostname-config restart Reloading Monit configuration ... Reinitializing monit daemon Please note loaded setting will be lost after system reboot. To preserve setting, run config save. admin@r-qa-sw-eth-2029:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e74562349673 docker-sonic-telemetry:latest "/usr/local/bin/supe…" 21 minutes ago Up 21 minutes telemetry 8d5e98f0d04a docker-sonic-mgmt-framework:latest "/usr/local/bin/supe…" 21 minutes ago Up 21 minutes mgmt-framework 7932cdccb509 docker-snmp:latest "/usr/local/bin/supe…" 21 minutes ago Up 21 minutes snmp 2eac32c43be8 docker-router-advertiser:latest "/usr/bin/docker-ini…" 24 minutes ago Up 24 minutes radv 8a948f70187b docker-dhcp-relay:latest "/usr/bin/docker_ini…" 24 minutes ago Up 24 minutes dhcp_relay d323c17040c0 docker-platform-monitor:latest "/usr/bin/docker_ini…" 24 minutes ago Up 24 minutes pmon f8ab287d624a docker-lldp:latest "/usr/bin/docker-lld…" 24 minutes ago Up 24 minutes lldp 1c4edb632153 docker-syncd-mlnx:latest "/usr/local/bin/supe…" 24 minutes ago Up 24 minutes syncd a17725ac5b81 docker-teamd:latest "/usr/local/bin/supe…" 25 minutes ago Up 25 minutes teamd 43602a57c95f docker-orchagent:latest "/usr/bin/docker-ini…" 25 minutes ago Up 25 minutes swss 523200e877c2 docker-fpm-frr:latest "/usr/bin/docker_ini…" 25 minutes ago Up 25 minutes bgp d0a8ee3cb794 docker-database:latest "/usr/local/bin/dock…" 25 minutes ago Up 25 minutes database

on the peer side no change on lldp

admin@r-qa-sw-eth-2135:~$ show lldp ta Capability codes: (R) Router, (B) Bridge, (O) Other LocalPort RemoteDevice RemotePortID Capability RemotePortDescr


Ethernet0 sonic etp1 BR Ethernet0 Ethernet4 sonic etp2 BR Ethernet4 Ethernet40 sonic etp13 BR Ethernet48 Ethernet44 sonic etp14 BR Ethernet52 Ethernet48 sonic etp13 BR Ethernet48 Ethernet52 sonic etp14 BR Ethernet52 Ethernet56 sonic etp11 BR Ethernet40 >>>> Ethernet60 sonic etp12 BR Ethernet44 >>>> eth0 MTR-F-1-QA-LAB-R5-1-SW01 43 B 43

Total entries displayed: 9

admin@r-qa-sw-eth-2029:~$ sudo systemctl stop lldp admin@r-qa-sw-eth-2029:~$ sudo systemctl start lldp admin@r-qa-sw-eth-2029:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e74562349673 docker-sonic-telemetry:latest "/usr/local/bin/supe…" 22 minutes ago Up 21 minutes telemetry 8d5e98f0d04a docker-sonic-mgmt-framework:latest "/usr/local/bin/supe…" 22 minutes ago Up 21 minutes mgmt-framework 7932cdccb509 docker-snmp:latest "/usr/local/bin/supe…" 22 minutes ago Up 21 minutes snmp 2eac32c43be8 docker-router-advertiser:latest "/usr/bin/docker-ini…" 25 minutes ago Up 25 minutes radv 8a948f70187b docker-dhcp-relay:latest "/usr/bin/docker_ini…" 25 minutes ago Up 25 minutes dhcp_relay d323c17040c0 docker-platform-monitor:latest "/usr/bin/docker_ini…" 25 minutes ago Up 25 minutes pmon f8ab287d624a docker-lldp:latest "/usr/bin/docker-lld…" 25 minutes ago Up 13 seconds lldp 1c4edb632153 docker-syncd-mlnx:latest "/usr/local/bin/supe…" 25 minutes ago Up 25 minutes syncd a17725ac5b81 docker-teamd:latest "/usr/local/bin/supe…" 25 minutes ago Up 25 minutes teamd 43602a57c95f docker-orchagent:latest "/usr/bin/docker-ini…" 25 minutes ago Up 25 minutes swss 523200e877c2 docker-fpm-frr:latest "/usr/bin/docker_ini…" 25 minutes ago Up 25 minutes bgp d0a8ee3cb794 docker-database:latest "/usr/local/bin/dock…" 26 minutes ago Up 26 minutes database

Now on peer new hostname is reflected.

admin@r-qa-sw-eth-2135:~$ show lldp ta Capability codes: (R) Router, (B) Bridge, (O) Other LocalPort RemoteDevice RemotePortID Capability RemotePortDescr


Ethernet0 sonic etp1 BR Ethernet0 Ethernet4 sonic etp2 BR Ethernet4 Ethernet40 sonic etp13 BR Ethernet48 Ethernet44 sonic etp14 BR Ethernet52 Ethernet48 sonic etp13 BR Ethernet48 Ethernet52 sonic etp14 BR Ethernet52 Ethernet56 r-qa-sw-eth-2029 etp11 BR Ethernet40 >>>> change Ethernet60 r-qa-sw-eth-2029 etp12 BR Ethernet44 >>>> change eth0 MTR-F-1-QA-LAB-R5-1-SW01 43 B 43

Total entries displayed: 9

Describe the results you received:

Describe the results you expected:

Output of show version:

SONiC.202012.70-5bdbfcfb_Internal

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

There is an open PR https://github.com/Azure/sonic-buildimage/pull/6119 According to the reason to this PR: "This PR allows listen to hostname changes and mgmt ip changes." It seems the same problem is pointed on. This PR should be backported to 202012 (still not merged to MASTER)

anshuv-mfst commented 3 years ago

@abdosi - could you please help with merging PR #6119.