I've installed NTP and internal NTP server peer is stratum 2. But every time I reboot the server, the VM time is synced with ESX instead of ntp
.
I did run ntpdate -s x.x.x.x
and corrected it. But after reboot its hours behind again.
Why doesn't NTP handle it? I've enabled ntp and it starts up during boot but the time is always the esx time. I'm on Ubuntu 16.04.
Also timedatectl
doesn't show NTP but systemd.timesyncd
is displyed. systemd.timesyncd
is disabled and stopped on the VM.
root@host001:~# timedatectl
Local time: Fri 2020-05-08 16:00:59 UTC
Universal time: Fri 2020-05-08 16:00:59 UTC
RTC time: Fri 2020-05-08 08:57:03
Time zone: UTC (UTC, +0000)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
ntpd will not sync the time if the difference between local computer time and the time server's time exceeds a threshold.
Put
ntpdate -b 0.pool.ntp.org
(replace 0.pool.ntp.org with your local time server if you have one) in your rc.local or a custom startup service and it should sort it out. You should probably also make sure that timesyncd is enabled and running.systemctl enable timesyncd; systemctl start timesyncd
should accomplish that.