Ce contenu n'est pas disponible dans la langue sélectionnée.
8.10. Virtual Machine Timer Management with libvirt
virsh edit
command. See Section 14.6, “Editing a Guest Virtual Machine's configuration file” for details.
<clock>
element is used to determine how the guest virtual machine clock is synchronized with the host physical machine clock. The clock element has the following attributes:
offset
determines how the guest virtual machine clock is offset from the host physical machine clock. The offset attribute has the following possible values:Expand Table 8.1. Offset attribute values Value Description utc The guest virtual machine clock will be synchronized to UTC when booted. localtime The guest virtual machine clock will be synchronized to the host physical machine's configured timezone when booted, if any. timezone The guest virtual machine clock will be synchronized to a given timezone, specified by the timezone
attribute.variable The guest virtual machine clock will be synchronized to an arbitrary offset from UTC. The delta relative to UTC is specified in seconds, using the adjustment
attribute. The guest virtual machine is free to adjust the Real Time Clock (RTC) over time and expect that it will be honored following the next reboot. This is in contrast toutc
mode, where any RTC adjustments are lost at each reboot.Note
The value utc is set as the clock offset in a virtual machine by default. However, if the guest virtual machine clock is run with the localtime value, the clock offset needs to be changed to a different value in order to have the guest virtual machine clock synchronized with the host physical machine clock.- The
timezone
attribute determines which timezone is used for the guest virtual machine clock. - The
adjustment
attribute provides the delta for guest virtual machine clock synchronization. In seconds, relative to UTC.
Example 8.1. Always synchronize to UTC
<clock offset="utc" />
<clock offset="utc" />
Example 8.2. Always synchronize to the host physical machine timezone
<clock offset="localtime" />
<clock offset="localtime" />
Example 8.3. Synchronize to an arbitrary timezone
<clock offset="timezone" timezone="Europe/Paris" />
<clock offset="timezone" timezone="Europe/Paris" />
Example 8.4. Synchronize to UTC + arbitrary offset
<clock offset="variable" adjustment="123456" />
<clock offset="variable" adjustment="123456" />
8.10.1. timer Child Element for clock Copier lienLien copié sur presse-papiers!
name
is required, all other attributes are optional.
name
attribute dictates the type of the time source to use, and can be one of the following:
Value | Description |
---|---|
pit | Programmable Interval Timer - a timer with periodic interrupts. |
rtc | Real Time Clock - a continuously running timer with periodic interrupts. |
tsc | Time Stamp Counter - counts the number of ticks since reset, no interrupts. |
kvmclock | KVM clock - recommended clock source for KVM guest virtual machines. KVM pvclock, or kvm-clock lets guest virtual machines read the host physical machine’s wall clock time. |