KVM guests' clocks jump forward minutes after host suspend/resume when host uses TSC as RTC and guests use kvmclock
Environment
KVM/QEMU hosts running Debian 12, Linux kernel 6.1, guests are CentOS 8 and Ubuntu 20.04 with virtio drivers. Host suspend/resume used nightly for power savings. Guests configured with kvmclock and no NTP daemon in some minimal images.
Symptoms
After host resumes from suspend, guests show clock advanced by several minutes to hours; time-sensitive jobs (cron, cert renewals) misfire. Guest dmesg shows kvmclock sync messages. Problem intermittent across hosts; guests sometimes correct after ntp/chrony restart.
Observations
Host dmesg shows 'PM: suspend exit' with TSC rebase; host hardware uses invariant TSC and hosts resume quickly. Guests without running chronyd experience larger jumps. Enabling guest NTP immediately corrects time. qemu commandline lacks -rtc options forcing kvmclock behavior.
Already attempted
Installed chrony in guests — mitigates but some services still see missed real-time deadlines until chrony slews. Added -rtc base=localtime to qemu for one test VM — inconsistent. Upgraded host kernel to minor release — no change.
Question
Why do KVM guests' clocks jump forward after host suspend and how to make guest time resilient without relying on guest NTP daemons alone?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Linux29% match
systemd timer misses periodic jobs after resume — clock jumps forward on resume when host uses TSC as RTC
Solved1 answer - Linux29% match
Ubuntu 22.04 LXC container clock jumps forward after host resume, cron misses jobs and ACME renewal fails
Solved1 answer - Virtualization26% match
QEMU/KVM guests log 'unexpected NMI' and suffer network stalls after host resume with nested KVM enabled
Open1 answer - Linux24% match
Ubuntu 22.04 host suspend/resume breaks LXD container veth interfaces — containers lose external network
Open0 answers - Linux21% match
Debian guest clock jumps forward after KVM snapshot restore, causing missed cron jobs and certificate timing errors
Open0 answers