Why does hardware clock (PHC0) not return UTC

Steven Sommars 0 Reputation points
2025-02-28T19:00:36.8066667+00:00

Running a Linux (Ubuntu 24.02.2 LTS) VM on an Azure hypervisor. The default time synchronization configuration includes chrony 4.5 with one source, a PHC reference clock. This would be great, except that the host clock is in error by 10-30 msec. Dropping PHC and using the four Google anycast NTP servers works much better.

What did I do wrong?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,035 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Steven Sommars 0 Reputation points
    2025-03-03T14:18:27.5366667+00:00

    User's image

    This graph shows the long-term difference between the PHC(/dev/ptp0) and NTP-disciplined clocks. There are strong short term variations as well.

    If it matters: cat /sys/devices/system/clocksource/clocksource0/current_clocksource
    hyperv_clocksource_tsc_page

    Either I'm doing something wrong, or PHC is broken.


  2. Steven Sommars 0 Reputation points
    2025-05-16T21:47:17.54+00:00

    It seems that my observations are well-founded. The Azure PTP doesn't really use IEEE 1588 PTP. Instead the Azure uses a PTP-like API to transfer time from the Hyper-V hypervisor. On the six VMs I tried that hypervisor was very poorly synchronized.

    The Azure PTP document should be updated to reflect reality. This "PTP" is typically not better than NTP. It may be adequate for some users.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.