I've got a CentOS VM (release 6.2) running under HyperV. I have integration services installed (part of base now), and CentOS shows the current clocksource is hyperv_clocksource, however my time in the VM is about 10 minutes fast after a week of uptime. My understanding of the new IC and plugable clocksource is that this shouldn't happen any more. Is there any additional configuration necessary to get the plugable clocksource to "work?"
I know there are plenty of links about setting kernel options to PIT and various stuff like that, but those all seem to pre-date the integrated clocksource support, and as I understand it shouldn't be needed anylonger. Nor should ntpd nor adjtimex.
Edit: Was running 3.2 of IC (what ships w/Centos 6.2), upgraded to 3.3 today, machine has been up for 1 hour 22 minutes and clock is already 5 seconds fast. So I'm now running the latest IC and still have the same problem.
I've had this issue in the past and corrected it by tweaking the startup switches (notsc divider=10) and ntp settings:
Sample ntp.conf:
Source:
Correcting Linux Clock Drift on Hyper-V on Server 2008 R2
http://hardanswers.net/correct-clock-drift-in-centos-hyper-v
Hyper-V Linux guest clock drift under load is sadly quite common (clock drift in unsynchronised VMs is somewhat unavoidable). See Linux clock loses 10 minutes every week and Hyper-V Machine drifts time all over, even with NTP for other posts talking about it. Anecdotal evidence I've seen says the following:
current_clocksource
ishyperv_clocksource
- your clock will drift after boot and won't be corrected unless you run one of the synchronisation programs below. There is a lot of complicated Windows oriented and conflicting information surrounding this topic and oft repeated terms like "pluggable time source" to understand.ntpd
is unable to correct the amount drift that can occur in a Linux Hyper-V guest and you will either have to use regular brute force ntpdate synchronisations (bad) or an ntp service such aschrony
(better) to correct large clock drifts.First, check if hyper-v is detecting the integration services. The only way i know how is using system center virtual machine manager, but i assume there must be a way using hyper-v's mmc.
Also, I have seen this happen when clock sync is disabled in the VM configuration. Why the clock runs faster is beyond me. I've attached a screenshot of the vm configuration for your reference.