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: Harald Koenig <H.Koenig@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] Time/clock issues with Xen 3.0.3?
From: "Ulrich Windl" <ulrich.windl@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Nov 2006 13:37:32 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 28 Nov 2006 04:38:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061127102440.GA28429@xxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Organization: Universitaet Regensburg, Klinikum
Priority: normal
References: <1164436051.14311.291.camel@tower>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
On 27 Nov 2006 at 11:24, Harald Koenig wrote:

> 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.

Harald,

use independent clocks everywhere, and it will work: "rkdvmso1" is a Dom0, 
every 
other is a DomU somewhere:
# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 LOCAL(0)        LOCAL(0)        10 l   12   64  377    0.000    0.000   0.001
*rkdvmso1.dvm.kl 132.199.176.97   2 u  987 1024  377    0.207    0.035   0.742
+rksapas01.dvm.k 192.168.0.61     3 u  997 1024  377    0.120    0.020   0.772
+rksapas02.dvm.k 192.168.0.61     3 u  992 1024  377    0.101    0.049   0.769
+rksapas03.dvm.k 192.168.0.62     3 u  995 1024  377    0.282    0.019   4.211
+rksapas04.dvm.k 192.168.0.62     3 u  997 1024  377    0.274    0.001   0.775
+rksapas05.dvm.k 192.168.0.63     3 u   78 1024  377    0.281   -0.093   0.800
+rksapas06.dvm.k 192.168.0.63     3 u  999 1024  377    0.230   -0.213   0.825
 rksapas07.dvm.k .INIT.          16 u    - 1024    0    0.000    0.000 4000.00
+rksapas08.dvm.k 192.168.0.41     4 u   78 1024  377    0.243   -0.168   0.796

Ulrich


> 
> 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



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