Skip to contentSkip to conversation

Dom0 <> DomU clock sync

DISCUSSION Sébastien RICCIO 3 participants 6 messages Sep 3, 2007

lore
Share & tools
lore
#0 lore raw

Hello !

Just a quick question about time synchronization between xen dom0 and domUs...

We're running Xen 3.1 64-bit, with 32 and 64 bits linux guests.

It's up since 89 days and the domU's time is around 5 minutes behind the dom0, which is updated via ntpdate...

Any idea why it doesn't sync the guests even that /proc/sys/xen/independent_wallclock is 0 ?

Could it be an option that I missed in dom0/domU kernel ?

Thanks for your help !

Signature · 23 lines
Sébastien Riccio
SwissCenter / OpenBusiness SA
[email protected]
________________________________________________

OpenBusiness S.A.
World Trade Center
Av Gratta-Paille 1-2        Tel: +41 21 641 1010
CH-1000 Lausanne 30         FAX: +41 21 641 1011
Switzerland                  www.openbusiness.ch
__________________________________________________________________________
Disclaimer

This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of the
OpenBusiness Group.
If you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, forwarding,
printing, or copy-ing of this email is strictly prohibited.

If you have received this email in error please notify the OpenBusiness
help-desk by telephone on +41 21 641 10 10.
#1 lore raw

You're not running ntpd in the domU as well, right? Just worth checking... Apart from that I don't think you can be doing anything wrong. Any weirdness after long uptime is of course interesting, as it's something that's hard for developers to test.

If you create a new domU (doesn't need to be from scratch installation - e.g., just restarting a domU, or starting an existing dormant domU, would do) then is its time behind dom0, or in sync?

-- Keir

Quoted 18 lines · Sébastien RICCIO

Hello !

Just a quick question about time synchronization between xen dom0 and domUs...

We're running Xen 3.1 64-bit, with 32 and 64 bits linux guests.

It's up since 89 days and the domU's time is around 5 minutes behind the dom0,
which is updated via ntpdate...

Any idea why it doesn't sync the guests even that
/proc/sys/xen/independent_wallclock is 0 ?

Could it be an option that I missed in dom0/domU kernel ?

Thanks for your help !

#2 lore raw

Hi Keir,

Thank you for your answer.

Ntpd is not running in dom0. I am updating the dom0 time with ntpdate (crontab every hour). Should ntpd be running on dom0 ?

Dom0
[root@xen01 /]# date
Mon Sep 3 15:59:37 CEST 2007

DomU (started 5 hours ago)
ns1 bin # date
Mon Sep 3 15:58:05 CEST 2007

ns1 bin # uptime
15:58:10 up 5:21, 3 users, load average: 0.00, 0.00, 0.11

But this is strange... I just rebooted the vm:

Dom0:
[root@xen01 /]# date
Mon Sep 3 16:04:13 CEST 2007

DomU:
ns1 ~ # date
Mon Sep 3 16:02:41 CEST 2007

There is already a difference when the vm is freshly rebooted. Same after a shutdown/xm create....

Weird... Any idea ?

Thanks again!

Signature · 3 lines
Sébastien Riccio
SwissCenter / OpenBusiness SA
[email protected]
Quoted 38 lines · Keir Fraser

You're not running ntpd in the domU as well, right? Just worth checking... Apart from that I don't think you can be doing anything wrong. Any weirdness after long uptime is of course interesting, as it's something that's hard for developers to test.

If you create a new domU (doesn't need to be from scratch installation - e.g., just restarting a domU, or starting an existing dormant domU, would do) then is its time behind dom0, or in sync?

-- Keir

Quoted 19 lines · Sébastien RICCIO

Hello !

Just a quick question about time synchronization between xen dom0 and domUs...

We're running Xen 3.1 64-bit, with 32 and 64 bits linux guests.

It's up since 89 days and the domU's time is around 5 minutes behind the dom0,
which is updated via ntpdate...

Any idea why it doesn't sync the guests even that
/proc/sys/xen/independent_wallclock is 0 ?

Could it be an option that I missed in dom0/domU kernel ?

Thanks for your help !

#3 lore raw
Quoted 3 lines · Sébastien RICCIO

Ntpd is not running in dom0. I am updating the dom0 time with ntpdate (crontab every hour).
Should ntpd be running on dom0 ?

So long as ntpdate calls settimeofday(), this should be sufficient to update Xen's notion of time too. It seems that isn't happening for some reason.

Do all guests (including dom0) have independent_wallclock equal to 0?

What kernel are you using in dom0 (e.g., vendor kernel?).

Ntpd in dom0 would be an interesting thing to try. That should cause dom0 to periodically (every few minutes) push its time down to Xen to be picked up by all domUs. But really ntpdate should be doing the right thing...

In our kernels it should be *impossible* for dom0 and domU time to diverge when independent_wallclock is set to zero everywhere...

-- Keir

#4 lore raw

Hi again,

I just tried to use ntpd in dom0. So far nothing changed. The guests are still a couple of minutes behind the dom0.

Dom0 and DomU's are set to independent_wallclock 0.

Kernels are compiled from the sources included in Xen 3.1.

I don't know where to head next :))

Thanks for your help.

Signature · 3 lines
Sébastien Riccio
SwissCenter / OpenBusiness SA
[email protected]
Quoted 33 lines · Keir Fraser
Quoted 4 lines · Sébastien RICCIO

Ntpd is not running in dom0. I am updating the dom0 time with ntpdate (crontab every hour).
Should ntpd be running on dom0 ?

So long as ntpdate calls settimeofday(), this should be sufficient to update Xen's notion of time too. It seems that isn't happening for some reason.

Do all guests (including dom0) have independent_wallclock equal to 0?

What kernel are you using in dom0 (e.g., vendor kernel?).

Ntpd in dom0 would be an interesting thing to try. That should cause dom0 to periodically (every few minutes) push its time down to Xen to be picked up by all domUs. But really ntpdate should be doing the right thing...

In our kernels it should be *impossible* for dom0 and domU time to diverge when independent_wallclock is set to zero everywhere...

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw
In reply to Keir Fraser
Quoted 7 lines · Keir Fraser

So long as ntpdate calls settimeofday(), this should be sufficient to update Xen's notion of time too. It seems that isn't happening for some reason.

Do all guests (including dom0) have independent_wallclock equal to 0?

What kernel are you using in dom0 (e.g., vendor kernel?).

Quoted 8 lines

Ntpd in dom0 would be an interesting thing to try. That should cause dom0 to periodically (every few minutes) push its time down to Xen to be picked up by all domUs. But really ntpdate should be doing the right thing...

In our kernels it should be *impossible* for dom0 and domU time to diverge when independent_wallclock is set to zero everywhere...

-- Keir

It occurs with ntpd in dom0 as well:

tomkins@host1 ~ $ date
Mon Sep 3 14:42:04 UTC 2007

testdomu:~# date
Mon Sep  3 14:43:11 UTC 2007

dom0 runs ntpd, the only thing which causes the domUs to correct themselves is hwclock in dom0. It's a fairly old machine though and would need to be updated for testing:

Linux host1 2.6.16.29-xen-host1-1 #1 Sat Nov 25 19:57:50 Local time zone must be set--see zic manu x86_64 AMD Athlon(tm) 64 Processor 3700+ AuthenticAMD GNU/Linux

However I've been moving all Xen servers away from Gentoo and switching them to CentOS which doesn't seem to have the same problem. I remember someone else having similar problems:

<http://lists.xensource.com/archives/html/xen-users/2006-11/msg00861.html>

I've still got a couple of servers which haven't been updated to CentOS yet. I could upgrade them to a more recent Xen release as well as a more recent kernel to test it.

Signature · 1 line
Alex Tomkins <[email protected]>