Time synchronisation in KVM, Xen or VMWare guests is a difficult subject. The best solution depends on the type and version of hypervisor and the type and version of OS that runs in the guest. This way it gets quite complicated. Each hypervisor vendor has a document on timekeeping:

While it is useful to have all a solution for all hypervisors on all types of hardware with all sorts of guest OS’s, most virtualisation shops have quite a stable and homogeneous environment. We mostly run a recent (5.4 or higher) version of CentOS as guest OS on a KVM hypervisor running on CentOS 6 running on a recent Intel Xeon platform.

This means that if:

  1. The hardware has a Time Stamp Couter (TSC) $ cat /proc/cpuinfo | grep constant_tsc
  2. The Guest has the kvm-clock echo /sys/devices/system/clocksource/clocksource0/current_clocksource

If the above is true, it is not recommended to use NTP in the VM Guest. Using NTP on the VM Host Server, however, is still recommended.

Summarizing: If the hostserver has TSC, and the guest is using the kvm-clock, you should only run NTP on the hypervisor.

Leave a reply