HyperV的Timesync与CentOS 6.2

我有一个在HyperV下运行的CentOS VM(版本6.2)。 我已经安装了集成服务(现在是基础的一部分),而CentOS显示当前的时钟源是hyperv_clocksource,但是在虚拟机运行一周后,我的时间快了大约10分钟。 我对新IC和可插拔时钟源的理解是,这不应该再发生。 是否有任何额外的configuration,让可插拔的clocksource“工作?”

我知道有很多关于设置PIT的核心选项和类似的东西的链接,但这些似乎都在集成的clocksource支持之前,据我所知,不应该需要更长的时间。 也不应该ntpd也不adjtimex。

编辑:正在运行3.2的IC(运行w / Centos 6.2),今天升级到3.3,机器已经升了1小时22分钟,时钟已经快5秒了。 所以我现在正在运行最新的IC,仍然有同样的问题。

我以前有过这个问题,并通过调整启动开关(notsc divider = 10)和ntp设置来纠正它:

# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/hda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-164.6.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=/dev/VolGroup00/LogVol00 hda=noprobe hdb=noprobe notsc divider=10 initrd /initrd-2.6.18-164.6.1.el5.img title CentOS (2.6.18-164.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-164.el5.img 

示例ntp.conf:

 tinker panic 0 restrict 127.0.0.1 restrict default kod nomodify notrap server 0.vmware.pool.ntp.org server 1.vmware.pool.ntp.org server 2.vmware.pool.ntp.org driftfile /var/lib/ntp/drift 

资源:

在Server 2008 R2上纠正Hyper-V上的Linux时钟漂移
http://hardanswers.net/correct-clock-drift-in-centos-hyper-v

首先,检查hyper-v是否正在检测集成服务。 我知道如何使用系统中心虚拟机pipe理器的唯一方法,但我认为必须有一种方式使用hyper-v的mmc。

另外,我发现在虚拟机configuration中禁用时钟同步时会发生这种情况。 时钟跑得快的原因超出了我的想象。 我附上了vmconfiguration的截图供您参考。 在这里输入图像描述

在负载下的Hyper-V Linux客户机时钟漂移非常普遍(非同步VM中的时钟漂移有些不可避免)。 请参阅Linux时钟每周丢失10分钟,而Hyper-V机器则会在整个时间内移动时间,即使使用NTP来处理其他文章。 我见过的传闻证据如下:

  • Hyper-V主机的时钟仅用于使用当前内核 (至less包括主线3.16内核或集成服务3.5) 来设置Linux客户机的时钟 。 如果您正在使用这样的Linux内核,那么在Hyper-Vpipe理器中设置什么选项并不 重要current_clocksourcehyperv_clocksource – 启动后,您的时钟漂移,除非您运行其中一个同步程序下面。 围绕这个话题有许多复杂的面向Windows的信息,而且还有许多像“可插入时间源”这样的重复术语来理解。
  • ntpd无法纠正Linux Hyper-V guest虚拟机中可能发生的数据量偏差,您将不得不使用常规powershellntpdate同步(错误)或ntp服务(如chrony (更好))来纠正大型时钟漂移。