1

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.

3
  • The 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.
    – Anon
    Mar 27, 2014 at 15:15
  • Does this problem still occur as of today?
    – Igor Gatis
    Apr 8, 2018 at 21:05
  • That question was 4 years ago, I have no idea now. Apr 9, 2018 at 16:28

5 Answers 5

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.

2
  • The question isn't that a VM may drift, but rather why is Azure time sync not keeping these VM's in check. Feb 4, 2014 at 21:27
  • Are you sure that is supposed to happen? AFAIK, the VM is on it's own when it comes to the clock.
    – Halfgaar
    Feb 5, 2014 at 8:09
1

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

1
  • VM Roles are not supported anymore (and haven't been for a long time), and that particular SO post is over 2 years old. Feb 8, 2014 at 5:02
1

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.

0

Time drift is normal for all computers. You have to use ntpd to keep your time accurate.

1
  • sorry, 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..." Feb 4, 2014 at 21:27
0

As of 2022, most "newer Linux images" use chronyd, which syncs directly from the host.

"Azure is backed by infrastructure running Windows Server 2016. Windows Server 2016 has improved algorithms used to correct time and condition the local clock to synchronize with UTC. The Windows Server 2016 Accurate Time feature greatly improved how the VMICTimeSync service that governs VMs with the host for accurate time. Improvements include more accurate initial time on VM start or VM restore and interrupt latency correction."

"Starting in early calendar 2021, the most current Azure Marketplace images with Linux are being changed to use chronyd as the time sync service, and chronyd is configured to synchronize against the Azure host rather than an external NTP time source. The Azure host time is usually the best time source to synchronize against, as it is maintained very accurately and reliably, and is accessible without the variable network delays inherent in accessing an external NTP time source over the public internet."

Read here: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/time-sync

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .