Re: Question: Timekeeping between Host and Guest with NTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 22, 2012 at 05:46:52PM +0900, Aritoki TAKADA wrote:
> Hello,
> 
> I'm planning to configure timekeeping between KVM host and guest,
> but I'm confused by different suggestions.
> The point is whether NTP should be working on guest or not.
> 
> Here are the suggestions I found.
> 
>   Red Hat document:
> 
>   http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/chap-Virtualization_Host_Configuration_and_Guest_Installation_Guide-KVM_guest_timing_management.html
>   kvmclock     : recommended if available
>   NTP on host  : recommended
>   NTP on guest : recommended
> 
>   Suse document:
> 
>   http://doc.opensuse.org/documentation/html/openSUSE/opensuse-kvm/cha.libvirt.config.html#sec.kvm.managing.clock
>   kvmclock     : recommended if available
>   NTP on host  : recommended
>   NTP on guest : NOT recommended when using kvmclock
> 
>   Ubuntu document:
> 
>   https://help.ubuntu.com/community/KVM/FAQ#Should_ntp_be_used_for_time_synchronisation.3F
>   kvmclock     : not mentioned
>   NTP on host  : not mentioned
>   NTP on guest : NOT recommended
> 
>   Previous discussions I found on kvm@xxxxxxxxxxxxxxx:
> 
>   Dor Laor from Red Hat says the same as the Red Hat document.
>   http://marc.info/?l=kvm&m=130881067913835&w=4
> 
>   John Buswell and Athanasius discussed another technique,
>   which uses not NTP but RTC from guest to keep guest syncing to host,
>   but they say it isn't the best way.
>   http://marc.info/?l=kvm&m=127230166532133&w=4
> 
> I just tried with CentOS 6.3 as both host and guest OS,
> whose kernels were replaced with 3.5.2 from upstream.
> 
> I found the guest has a little delay when booted,
> which is about one or two seconds.
> Without NTP on the guest, the delay seemed
> constant while running.
> 
> I think NTP on the guest will fix the delay,
> but I'm afraid there would be some reasons
> that NTP should not be on the guest.
> 
> If you know why NTP should (not) be running on
> guest, please let me know.
> 
> Thank you in advance,

NTP should be running in the guest so as to synchronize the guest
time-of-day clocks to UTC.

kvmclock exposes the monotonic clock from the host. The frequency 
of the host monotonic clock is corrected by host ntpd. This is 
probably where the confusion comes from.

That is no guarantee that time-of-day clocks in the guest are
synchronized to UTC or even that clock frequency visible to userspace
applications in the guest is equal to the monotonic clock frequency
of the host.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux