docs: update virt/vm

This commit is contained in:
lukas 2025-06-03 18:37:56 +00:00
parent c959e658ca
commit 13ed1d266b

View File

@ -2,7 +2,7 @@
title: Machine definition
description: Virtual machine hardware
published: true
date: 2025-06-03T12:34:13.773Z
date: 2025-06-03T18:37:54.590Z
tags:
editor: markdown
dateCreated: 2025-06-01T17:37:29.262Z
@ -209,3 +209,28 @@ For Windows NT guests, more features are enabled:
[...]
</domain>
```
## The clock
In most case, the guest clock derives from the host clock.
In the following example, the hardware clock uses [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) and has several timers
```
<domain type='kvm'>
[...]
<clock offset='utc'>
<timer name='kvmclock' tickpolicy='catchup'/>
</clock>
[...]
</domain>
```
The *KVM clock* timer has a catchup policy, which means that a paused guest whose clock will is frozen will eventually catch up with the host clock when the guest is resumed.
> On non realtime kernel, the KVM clock is updated every 5 minutes for all vCPUs, which may not be enough for accurate timekeeping. For that reason, "[Red Hat recommends running NTP in the virtual machine if accurate timekeeping is required](https://access.redhat.com/solutions/27865)"
{.is-info}
- [Timekeeping Virtualization for X86-Based Architectures](https://docs.kernel.org/virt/kvm/x86/timekeeping.html)
- SUSE documentation: [VM Guest clock settings](https://documentation.suse.com/sles/15-SP3/html/SLES-all/sec-kvm-managing-clock.html#)
- [Best practices for accurate timekeeping for Red Hat Enterprise Linux running on Red Hat Virtualization](https://access.redhat.com/solutions/27865)