Installation guide

Chapter 14. KVM guest timing management
Virtualization involves several intrinsic challenges for time keeping in guest virtual machines.
Interrupts cannot always be delivered simultaneously and instantaneously to all guest virtual
machines, because interrupts in virtual machines are not true interrupts; they are injected into the
guest virtual machine by the host machine. The host may be running another guest virtual machine,
or a different process, meaning that the precise timing typically required by interrupts may not always
be possible.
Guest virtual machines without accurate time keeping may experience issues with network
applications and processes, as session validity, migration, and other network activities rely on
timestamps to remain correct.
KVM avoids these issues by providing guest virtual machines with a para-virtualized clock (kvm-
clo ck). However, it is still vital to test timing before attempting activities that may be affected by time
keeping inaccuracies.
Note
Red Hat Enterprise Linux 5.5 and newer, and Red Hat Enterprise Linux 6.0 and newer, use
kvm- clo ck as their default clock source. Running without kvm- clo ck requires special
configuration, and is not recommended.
Important
The Network Time Protocol (NTP) daemon should be running on the host and the guest virtual
machines. Enable the ntpd service:
# service ntpd start
Add the ntpd service to the default startup sequence:
# chkconfig ntpd on
The ntpd service will correct the effects of clock skew as long as the clock runs no more than
0.05% faster or slower than the reference time source. The ntp startup script adjusts the clock
offset from the reference time by adjusting the system clock at startup time, if required.
14 .1. Const ant T ime St amp Count er (T SC)
Modern Intel and AMD CPUs provide a constant Time Stamp Counter (TSC). The count frequency of
the constant TSC does not vary when the CPU core itself changes frequency, for example, to comply
with a power saving policy. A CPU with a constant TSC frequency is necessary in order to use the
TSC as a clock source for KVM guests.
Your CPU has a constant Time Stamp Counter if the co nstant_tsc flag is present. To determine if
your CPU has the co nstant_tsc flag run the following command:
$ cat /proc/cpuinfo | grep constant_tsc
Chapt er 1 4 . KVM guest t iming manag ement
113