vmware timekeeping

Jeff Dickens jeff at m2.seamanpaper.com
Mon Jun 9 15:34:11 UTC 2008



Sean Cavanaugh wrote:
> ----------------------------------------
>   
>> Date: Fri, 6 Jun 2008 15:48:46 -0500
>> To: freebsd-questions at freebsd.org
>> From: jbiquez at icsmx.com
>> Subject: Re: vmware timekeeping
>>
>> At 03:23 p.m. 06/06/2008, you wrote:
>>     
>>> I'm running FreeBSD 6.3-release as a guest on VMware ESX 3.0.2.  My 
>>> problem is that the clock keeps *gaining* time.  I have the 
>>> "timesync" option turned on in ESX's .vmx file, and I have 
>>> "hint.apic.0.disabled=1" in my FreeBSD guest's /boot/loader.conf.
>>>
>>> I used to have "kern.hz=100" in loader.conf, but that caused the 
>>> guest to gain time even faster.
>>>
>>> Does anyone have a good recipe for decent timekeeping in this config?
>>>
>>> Thanks.
>>> _______________________________________________
>>> freebsd-questions at freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>>> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>>>       
>> Hello all.
>>
>> Here is something similar. Running 6.2 stable... but the clock lose 
>> around 6 hours each day
>>
>> JB
>>
>>     
>
>
> The only good way of keeping time pretty set is to set up an NTP sync on the image to go off at decently constant rate (once every 3 hours or so). the vmware-tools will not synchronize the system clock.
>   
The tools do attempt to improve timekeeping if you put

    tools.syncTime = "TRUE"

in the guest's .vmx file.  However, the tools will only move the time 
forward.  It is attempting to compensate for "lost ticks".  Without 
using syncTime the guest's clock can run slow, depending on the host's 
overall load.   With syncTime on, my Linux guest machines stay 
synchronized perfectly.  Well, they're within one second anyway, which 
is fine for my application.  The recipe for this success was to turn on 
syncTime, and use the following linux boot options:

    clock=pit nosmp noapic nolapic


However, I have not been able to achieve the same success with 
FreeBSD.   The clock doesn't lose time, but it gains time, very slowly.  
It's probably load dependent, but it's around 10 seconds a day.  What's 
the FreeBSD equivalent of "clock=pit" ?  Meaning to use the PIT and not 
the APIC.

In general, but also in this application in particular, one does not one 
time to move backwards.  The Dovcot IMAP server immediately exits if it 
detects that time went backwards.

In order to use NTP, you'd probably have to turn off syncTime, which 
probably does a better job anyway except for the gaining time problem.  
I haven't tried actually running ntpd instead of a periodic sync, as 
this is not recommended by VMware's timekeeping white paper: 
http://www.vmware.com/pdf/vmware_timekeeping.pdf.  My last-ditch 
strategy will be to start monkeying with the knobs for syncTime, like these:

    timeTracker.catchupPercentage
    timeTracker.catchupIfBehindByUsec
    timeTracker.giveupIfBehindByUsec

But I'd rather fix it the same way I have with Linux.



> I heard of someone trying to change the clock in BSD to only use the hardware clock as VMWare can reset that but never heard anything beyond that. 
>
> -Sean_______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>   


More information about the freebsd-questions mailing list