NTP support for management VRF #3400
Closed
kannankvs wants to merge 2 commits intosonic-net:masterfrom
kannankvs:mvrf_ntp2
Closed
NTP support for management VRF #3400kannankvs wants to merge 2 commits intosonic-net:masterfrom kannankvs:mvrf_ntp2
kannankvs wants to merge 2 commits intosonic-net:masterfrom
kannankvs:mvrf_ntp2
Conversation
Collaborator
Author
Collaborator
Author
|
We had issues in updating the already existing PR #3204 . That is why we created this new PR #3400 . Later, we resolve the issue in updating the existing PR #3204 and hence we are closing this duplicate PR #3400. This way, the original comments given in PR #3204 stays as is. |
yxieca
pushed a commit
that referenced
this pull request
Mar 28, 2025
This replaces ntpd with Chrony, as described in sonic-net/SONiC#1852. The advantages of this (among others) is control over enabling/disabling long jumps/steps and guaranteed updates of the real time clock. This PR also includes a submodule update of sonic-utilities, to bring in necessary changes there for chrony to work. The changelog for sonic-utilities is: Submodule src/sonic-utilities ce51df2..7cbb2f2: > [sfputil] add support for sfputil debug tx-output/rx-output {port} enable/disable (#3811) > Switch to using chrony instead of ntpd (#3574) > Added post commands for enabling fifos (#3801) > kdump-Remote-SSH-Configurations (#3400) Signed-off-by: Saikrishna Arcot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support for NTP to run in management VRF is added.
As part of l3mdev based management VRF implementation, in order to execute the NTP daemon in the context of management vrf using cgexec, the NTP script /etc/init.d/ntp is updated to check for mvrf enabled status and call "start-stop-daemon" using cgexec. Since this /etc/init.d/ntp script is installed as part of NTP application (apt-get), a new script is used to update the installed /etc/init.d/ntp.
In addition, the linux NTP commands (programs) like “ntpq” and “ntpstat” require a loopback interface to connect to the ntpd and hence a dummy loopback interface lo-m is created in interfaces.j2 as part of management vrf.
TESTING:
Verified NTP using “ntpq -p” and “ntpstat” before enabling management VRF.
Enabled management vrf using “config vrf add mgmt” command that is explained in PR sonic-net/sonic-utilities#463
Verified NTP in management VRF using “cgexec” as follows.
root@sonic:/home/admin# date
Fri Aug 30 15:31:53 UTC 2019
root@sonic:/home/admin# cgexec -g l3mdev:mgmt ntpq -p
remote refid st t when poll reach delay offset jitter
23.92.29.245 .STEP. 16 u - 64 0 0.000 0.000 0.000
*204.2.134.164 44.24.199.34 3 u 9 64 1 200.601 -0.199 2.589
root@sonic:/home/admin# cgexec -g l3mdev:mgmt ntpstat
synchronised to NTP server (204.2.134.164) at stratum 4
time correct to within 1085 ms
polling server every 64 s
root@sonic:/home/admin# ps -ax | grep ntp
9761 ? Ssl 0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:110
9799 ttyS1 S+ 0:00 grep ntp
root@sonic:/home/admin#