Why aren't Azure Linux VM's keeping time sync with host?
Solution 1
The OS usually only reads the (emulated) hardware clock upon boot, and then the clock is maintained with an interrupt timer. This is not a perfect time source, of course, and therefore you have to use NTP software to keep it accurate.
Solution 2
This is expected because Hyper-V's clock sync does not necessarily continue to discipline the clock after boot up - see one of the answers on Timesync on HyperV with CentOS 6.2 for details.
Solution 3
Seems others have this issue, even in Windows VM Roles. Once a week is causing too much time drift so I guess manual setting daily or less is indeed in order:
https://stackoverflow.com/questions/6186776/how-to-validate-local-vm-clock-with-ntp-on-windows-azure
Related videos on Youtube
Bret Fisher
Docker Captain, Cloud and Datacenter Ops + Sysadmin Consultant. Author of the bestselling Udemy Docker Mastery series. Fan of all-things-containers and automation.
Updated on September 18, 2022Comments
-
Bret Fisher almost 2 years
Using Ubuntu 12.04 VM's built last year on Azure. They only seem to get proper time on boot, and drift about a second a day. Is this a normal issue for Azure VM's? I know VM time drift is normal but thought Linux VM's in Azure (Hyper-V) get regular time sync from the host via integration services.
-
Anon about 10 yearsThe whole "Large clock drift with Linux Hyper-V guests" is a well discussed issue (but strangely little concrete information other than use ntpd/chrony). See serverfault.com/q/523389 for details.
-
Igor Gatis about 6 yearsDoes this problem still occur as of today?
-
Bret Fisher about 6 yearsThat question was 4 years ago, I have no idea now.
-
-
Bret Fisher over 10 yearssorry, you're just repeating what I've said in my question "VM time drift is normal but thought Linux VM's in Azure (Hyper-V) get regular time sync..."
-
Bret Fisher over 10 yearsThe question isn't that a VM may drift, but rather why is Azure time sync not keeping these VM's in check.
-
Halfgaar over 10 yearsAre you sure that is supposed to happen? AFAIK, the VM is on it's own when it comes to the clock.
-
David Makogon over 10 yearsVM Roles are not supported anymore (and haven't been for a long time), and that particular SO post is over 2 years old.