Installation guide

Chapter 17. KVM guest timing management
Virtualization poses various challenges for guest time keeping. Guests which use the Time Stamp
Counter (TSC) as a clock source may suffer timing issues as some CPUs do not have a constant
Time Stamp Counter. Guests without accurate timekeeping may have issues with some networked
applications and processes as the guest will run faster or slower than the actual time and fall out of
synchronization.
KVM works around this issue by providing guests with a para-virtualized clock. Alternatively, some
guests may use other x86 clock sources for their timing in future versions of those operating systems.
Presently, only Red Hat Enterprise Linux 5.4 and newer guests fully support the para-virtualized
clock.
Guests can have several problems caused by inaccurate clocks and counters:
Clocks can fall out of synchronization with the actual time which invalidates sessions and affects
networks.
Guests with slower clocks may have issues migrating.
These problems exist on other virtualization platforms and timing should always be tested.
Important
The Network Time Protocol (NTP) daemon should be running on the host and the guests.
Enable the ntpd service:
# service ntpd start
Add the ntpd service to the default startup sequence:
# chkconfig ntpd on
Using the ntpd service should minimize the affects of clock skew in all cases.
Det ermin in g if yo u r CPU h as t h e co n st an t T ime St amp C o u n t er
Your CPU has a constant Time Stamp Counter if the constant_tsc flag is present. To determine if
your CPU has the constant_tsc flag run the following command:
$ cat /proc/cpuinfo | grep constant_tsc
If any output is given your CPU has the constant_tsc bit. If no output is given follow the
instructions below.
Co n f ig u rin g h o st s wit h o u t a co n st an t T ime St amp C o u n t er
Systems without constant time stamp counters require additional configuration. Power management
features interfere with accurate time keeping and must be disabled for guests to accurately keep time
with KVM.
Chapt er 1 7 . KVM guest t iming management
209