WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: Tim Post <tim.post@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] Time/clock issues with Xen 3.0.3?
From: Harald Koenig <H.Koenig@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Nov 2006 11:24:40 +0100
Cc: Phillip Mumford <phillip.mumford@xxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 28 Nov 2006 01:38:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1164436051.14311.291.camel@tower>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <6e70af1b0611241228t3edeebefjd0497148b4830db@xxxxxxxxxxxxxx> <1164436051.14311.291.camel@tower>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
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