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

NTP support for management VRF #3400

Closed
wants to merge 2 commits into from
Closed

NTP support for management VRF #3400

wants to merge 2 commits into from

Conversation

kannankvs
Copy link
Collaborator

@kannankvs kannankvs commented Aug 30, 2019

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#

@kannankvs
Copy link
Collaborator Author

@lguohan : Request you to kindly close the previous PR #3204. W.r.t the comment on that PR about complexity in using SED for the file mgmtvrf_add_cgexec_to_ntp.sh, we have provided our comments/replies. Request you to provide your feedback.

@kannankvs
Copy link
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.
@lguohan : requesting you to continue your review on PR #3204 and provide your comments.
Our apologies for the confusion.

@kannankvs kannankvs closed this Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant