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.

Bret Fisher
  • 3,963
  • 2
  • 20
  • 25

5 Answers5

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.

Halfgaar
  • 7,921
  • 5
  • 42
  • 81
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

Bret Fisher
  • 3,963
  • 2
  • 20
  • 25
  • VM Roles are not supported anymore (and haven't been for a long time), and that particular SO post is over 2 years old. – David Makogon Feb 08 '14 at 05: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.

Anon
  • 1,210
  • 10
  • 23
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

stolsvik
  • 131
  • 6
0

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

  • 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..." – Bret Fisher Feb 04 '14 at 21:27