[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Time/clock issues with Xen 3.0.3?



I see the same problem here (xen-3.0.2 from SUSE 10.1): 
dom0 is synched via ntpd, and the domUs drift away from dom0 and ntp server.

for an example how to reproduce this problem, see below... 


right now I use a cron job on dom0 which re-sets the dom0 clock
via date -s `date` (ntpdate doesn't work here).


On Nov 25, Tim Post wrote:

> What are the values of /proc/sys/xen/independent_wallclock
> and /proc/sys/xen/permitted_clock_jitter respectively?

        os2 koenig > cat /proc/sys/xen/independent_wallclock
        0

        os2 koenig > cat /proc/sys/xen/permitted_clock_jitter
        10000000

maybe I should just set /proc/sys/xen/independent_wallclock to 1 
and run ntpd on all domUs ?


now, how I was able to reproduce the domU clock due to ntp clock drift in dom0
using SUSE 10.1 xen stuff.  in this examle both xen, dom0 and domU are SUSE 
10.1 
and use the SUSE xen-kernel, but on my real XEN server I run may different
distributions and kernels -- all alike...


step 1: perfect clock sync with drift==0 :

run ntpd on dom0 with the following config file /etc/ntp.conf which uses
only the dom0 system clock as "source", so it doesn't adjust the clock 
ever.

----------------------------- /etc/ntp.conf -----------------------------------
restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 192.168.8.0 mask 255.255.255.0
server 127.127.1.1
driftfile /var/lib/ntp/drift/ntp.drift
logfile /var/log/ntp
-------------------------------------------------------------------------------

before starting ntpd, make sure the clock drift is set to zero with

        echo 0 > /var/lib/ntp/drift/ntp.drift

now start ntpd, start domU (don't run ntpd in domU) and check the domU
clock drift with

        ntpdate -d dom0

that's how it should always work (in theory;).  but in real world
the real clock drift of a PC clock is not zero. prrtty often the clock
shows a frequency error of 100 ppm and more (which is 8.64 secs per day!).  


now, let's add some drift to dom0:

        /etc/init.d/ntpd stop
        echo 100 > /var/lib/ntp/drift/ntp.drift
        /etc/init.d/ntpd start


now you check the domU clock by running ntpdate on domU:

        ntpdate -d dom0 ; sleep 60 ; ntpdate -d dom0

and there will be a domU clock drift relative to dom0 or any other ntpd server
of ~6 msec per minute == 100 ppm.  qed.


hope this helps to track and fix this clock problem!

Harald Koenig
-- 
"I hope to die                                      ___       _____
before I *have* to use Microsoft Word.",           0--,|    /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.        <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig                                          \/\/\/\/\/\/\/\/\/
science+computing ag                                    //  /     \\  \
koenig@xxxxxxxxxxxxxxxxxxxx                            ^^^^^       ^^^^^

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.