NTP: take into account systemd-timesyncd where present
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Ryan Harper | ||
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Currently, the NTP module configures ntpd during cloud-init install by installing and configuring ntpd.
ntpd competes with systemd-timesyncd on systemd distros like Ubuntu Xenial.
Ideally the NTP module should configure systemd-timesyncd where present, falling back to ntpd where not present.
This stops two separate daemons (ntpd and systemd-timesyncd) competing with each other to set the time, where systemd-timesyncd (on Ubuntu at least) has an internal hardcoded compiled in timeserver to fall back on if no timeserver is configured (which is bad, but what can you do).
The competing timeserver behaviour is invisible when the machine can see the net, but logs this error constantly when the machine cannot see the net:
systemd-
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 2392 lines (+1470/-394)27 files modifiedcloudinit/apport.py (+23/-4)
cloudinit/config/cc_ntp.py (+407/-78)
cloudinit/distros/__init__.py (+12/-0)
cloudinit/distros/opensuse.py (+24/-0)
cloudinit/distros/ubuntu.py (+19/-0)
cloudinit/templater.py (+9/-1)
config/cloud.cfg.tmpl (+2/-0)
debian/changelog (+12/-0)
templates/chrony.conf.debian.tmpl (+39/-0)
templates/chrony.conf.fedora.tmpl (+48/-0)
templates/chrony.conf.opensuse.tmpl (+38/-0)
templates/chrony.conf.rhel.tmpl (+45/-0)
templates/chrony.conf.sles.tmpl (+38/-0)
templates/chrony.conf.ubuntu.tmpl (+42/-0)
tests/cloud_tests/testcases/base.py (+5/-4)
tests/cloud_tests/testcases/modules/ntp.yaml (+1/-0)
tests/cloud_tests/testcases/modules/ntp_chrony.py (+15/-0)
tests/cloud_tests/testcases/modules/ntp_chrony.yaml (+17/-0)
tests/cloud_tests/testcases/modules/ntp_pools.yaml (+1/-0)
tests/cloud_tests/testcases/modules/ntp_servers.yaml (+1/-0)
tests/cloud_tests/testcases/modules/ntp_timesyncd.py (+15/-0)
tests/cloud_tests/testcases/modules/ntp_timesyncd.yaml (+15/-0)
tests/unittests/test_distros/test_netconfig.py (+6/-0)
tests/unittests/test_distros/test_user_data_normalize.py (+6/-0)
tests/unittests/test_handler/test_handler_ntp.py (+578/-303)
tests/unittests/test_templating.py (+40/-1)
tools/make-tarball (+12/-3)
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Approve
- Chad Smith: Approve
-
Diff: 2162 lines (+1369/-381)21 files modifiedcloudinit/config/cc_ntp.py (+407/-78)
cloudinit/distros/__init__.py (+12/-0)
cloudinit/distros/opensuse.py (+24/-0)
cloudinit/distros/ubuntu.py (+19/-0)
config/cloud.cfg.tmpl (+2/-0)
templates/chrony.conf.debian.tmpl (+39/-0)
templates/chrony.conf.fedora.tmpl (+48/-0)
templates/chrony.conf.opensuse.tmpl (+38/-0)
templates/chrony.conf.rhel.tmpl (+45/-0)
templates/chrony.conf.sles.tmpl (+38/-0)
templates/chrony.conf.ubuntu.tmpl (+42/-0)
tests/cloud_tests/testcases/modules/ntp.yaml (+1/-0)
tests/cloud_tests/testcases/modules/ntp_chrony.py (+15/-0)
tests/cloud_tests/testcases/modules/ntp_chrony.yaml (+17/-0)
tests/cloud_tests/testcases/modules/ntp_pools.yaml (+1/-0)
tests/cloud_tests/testcases/modules/ntp_servers.yaml (+1/-0)
tests/cloud_tests/testcases/modules/ntp_timesyncd.py (+15/-0)
tests/cloud_tests/testcases/modules/ntp_timesyncd.yaml (+15/-0)
tests/unittests/test_distros/test_netconfig.py (+6/-0)
tests/unittests/test_distros/test_user_data_normalize.py (+6/-0)
tests/unittests/test_handler/test_handler_ntp.py (+578/-303)
Thanks for the bug report. This is in progress already, but may not be solved in exactly the way you are suggesting. I'll let Ryan comment on specific implementation as he sees fit.