惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
F
Fortinet All Blogs
Vercel News
Vercel News
C
Check Point Blog
P
Privacy International News Feed
Know Your Adversary
Know Your Adversary
Google DeepMind News
Google DeepMind News
T
Troy Hunt's Blog
TaoSecurity Blog
TaoSecurity Blog
I
Intezer
T
The Exploit Database - CXSecurity.com
Security Archives - TechRepublic
Security Archives - TechRepublic
H
Hacker News: Front Page
P
Proofpoint News Feed
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
IT之家
IT之家
D
DataBreaches.Net
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
Y
Y Combinator Blog
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
Lohrmann on Cybersecurity
T
Tenable Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 最新话题
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
K
Kaspersky official blog
PCI Perspectives
PCI Perspectives
A
Arctic Wolf
Latest news
Latest news
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
雷峰网
雷峰网
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
月光博客
月光博客
Schneier on Security
Schneier on Security
M
MIT News - Artificial intelligence

KVM

KVM 使用方式请教 - V2EX 如何优化 kvm 的硬盘 io - V2EX 有没有一种在 win, Linux ,osx 环境下都可以实现硬件加速的开源虚拟机管理器 - V2EX 帮忙推荐一个 kvm - V2EX 各位的虚拟机的小键盘是怎么处理的? - V2EX Linux 生态下的虚拟机,选择 KVM 还是 esxi? - V2EX kvm 中 windows10 显示内存不正确 - V2EX 有什么好的虚拟机录屏方案吗? - V2EX 有没有输入 1 是雷电,输入 2 是 usb + dp 的 kvm - V2EX 不懂就问系列, qemu 给虚拟机分配的 cpu 并不是和宿主机 cpu 一一对应的。 - V2EX PVE 用 qm 命令导入的虚拟机如何扩容? - V2EX 有没有 virt-manager 和 kvm 配 windows 虚拟机的详细教程呢 - V2EX 请问有没有基于 Golang 开发的 Kvm 集群管理平台 - V2EX Virtual Machine Manager on Ubuntu - V2EX
虚拟机时间跳变问题 - V2EX
fangjue · 2025-05-31 · via KVM

运行在青云私有云上的 Ubuntu 22.04 虚拟机,通过 systemd-timesyncd 采用 ntp.ubuntu.com 服务器进行 NTP 同步。在 /var/log/syslog 中每隔大约半小时就会产生两条来自 systemd-resolved 的日志提示系统时间更改。

一台虚拟机 xxx 时间突然向过去跳变,再恢复正常:

May 31 17:18:44 xxx systemd-resolved[724]: Clock change detected. Flushing caches.

May 31 17:18:51 xxx systemd-resolved[724]: Clock change detected. Flushing caches.

May 31 17:48:48 xxx systemd-resolved[724]: Clock change detected. Flushing caches.

May 31 17:48:54 xxx systemd-resolved[724]: Clock change detected. Flushing caches.

另一台虚拟机时间 yyy 突然向将来跳变,再恢复正常:

May 31 17:53:58 yyy systemd-resolved[690]: Clock change detected. Flushing caches.

May 31 17:52:22 yyy systemd-resolved[690]: Clock change detected. Flushing caches.

May 31 18:24:03 yyy systemd-resolved[690]: Clock change detected. Flushing caches.

May 31 18:22:27 yyy systemd-resolved[690]: Clock change detected. Flushing caches.

在服务器上通过 top (间隔设为 0.1 秒)现场观测观察到的时间跳变现象与日志中的记录相符。

虚拟机上 /sys/devices/syste/clocksource/clocksource0/current_clocksource 为 kvm-clock 。

以上现象是什么原因造成的?是否说明虚拟机所在主机的时间不准,或者主机上的时间同步与虚拟机存在冲突?有没有什么办法可以缓解或解决时间上的跳变?

如果禁用虚拟机 xxx 上的 systemd-timesyncd 服务,日志中发生时间变化的间隔变长( 1.5 小时或 2 小时),且每次只有一行,不再出现跳变。但是这会导致系统时间始终比北京时间慢 6~7 秒(可能刚好与启用时间同步时跳变的时间差相等?)。