[ntp:questions] three questions about ntpd, kvm-clock and clock speeds

Marco Marongiu brontolinux at gmail.com
Fri Oct 31 09:24:51 UTC 2014


>> Apologies for this question not being 100% pertinent to ntpd, but I'd
>> need an authoritative answer and there is no place like this list to
>> find real expert of computer clocks and time synchronization.
>> Too many wannabes and professed experts out there.
> 
> Plenty here too?

Possibly. But the good ones are well known here.


> Why not ask @ linux-kvm.org ?
>  They should know the specifics
>   of their implementation of virtualization better than others?

You chose the right verb and tense, they _should_:

>From the KVM FAQ:
http://www.linux-kvm.org/page/FAQ#I.27m_experiencing_timer_drift_issues_in_my_VM_guests.2C_what_to_do.3F

Two "IMHO" and one "Perhaps" don't really build confidence in me that
the person who wrote that answer was expert in the subject. Sure, I may
have better luck in a mailing list there but... hmmmm


> <https://s19n.net/articles/2011/kvm_clock.html>

I knew this one: old, outdated, almost a verbatim copy of the Red Hat
document below, doesn't really explain how things work and, in
particular, what are the effects of selecting the kvm-clock clocksource.


> <https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization_for_Servers/2.2/html/Administration_Guide/chap-Virtualization-KVM_guest_timing_management.html>

As above, aside that it's not the verbatim copy of the document below ;-)


> <http://doc.opensuse.org/documentation/html/openSUSE_114/opensuse-kvm/cha.libvirt.config.html#sec.kvm.managing.clock>

I knew this one, too. Doesn't even say how to enable the kvm-clock
clocksource if it's not already. Doesn't say a word about what that
setting is supposed to do.


> <http://th.oughts.org/2014/04/kvmclock.html>

I didn't know this one, it seems fairly recent (presumably April 2014).
It was better in that the author seems to know what he's talking about.
Still it doesn't clearly answer my quests.

I've also found this thread, for what it's worth:
http://ubuntu.5.x6.nabble.com/Questions-about-KVM-Clock-and-NTP-for-Ubuntu-Guests-td5022402.html

As with the email I started this thread with, it makes a number of
speculations and asks someone to confirm his findings. And that doesn't
happen. And then he updates the Ubuntu wiki:
https://help.ubuntu.com/community/KVM/FAQ#Should_NTP_be_used_for_time_synchronisation.3F

where the recommendation is to... use NTP on guests (ugh...). He also
speculates that kvm-clock exposes the host time to the guest, but that
doesn't neither match my experience nor the article at th.oughts.org


>> I didn't collect any data but so far it turned out that, once syncing
>> the VM's system clock to a reliable source via ntpdate, and then syncing
>> the VM's hardware clock with the system clock via hwclock --systohc,
>> everything seems to stay in sync,
> 
> Try ntpd.exe -g ... instead of ntpdate first?

I was expecting this one...

ntpd -g would require a valid configuration file to be present
somewhere. Sure one could do

echo server ntp.example.org > /etc/ntp.conf && ntpd -gq

but "ntpdate ntp.example.org" is way more handy so, like it or not,
ntpdate is going to stay for a long time, even after it's retired.

Ciao
-- bronto



More information about the questions mailing list