Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement virtual PTP hardware clock (PHC) for use in virtual machines #1138

Open
g-v-egidy opened this issue Oct 17, 2023 · 2 comments
Open

Comments

@g-v-egidy
Copy link

I'm running many virtual machines with qemu/kvm. In the past I had issues with jitter when using NTP on the VMs and there was high load on the host. Qemu/kvm provides a virtual PTP hardware clock (PHC) feature that allows VMs to get a precise time from the host.

I now manage the time on the host with chrony and then use PHC to forward the time info to chrony running on my virtual machines. This works much better than NTP on the VMs in my experience.

This is what I have in my /etc/chrony.conf:

[...]
refclock PHC /dev/ptp0 poll 4 stratum 3 prefer

I know that ntpd-rs currently doesn't support all features of chrony yet. But this feature would be important for me before I could migrate my virtual machines to ntpd-rs.

@davidv1992
Copy link
Member

Thank you for the feature request, we will consider implementing this once we have started general reference clock support. One question, are these hardware clocks expected to carry TAI or UTC?

@Artoria2e5
Copy link

Artoria2e5 commented Sep 25, 2024

They are expected to carry the system time of the host, which typically is UTC: if the host is synced with an external time source at all, it probably does so via NTP, which runs UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants