Skip to contentSkip to conversation

domU clock over 23s off

DISCUSSION Saku Ytti 5 participants 18 messages Feb 26, 2006 – Jul 13, 2006

lore
Share & tools
lore

Saku Ytti

author
#0 lore raw

Hey,

I have rather new installation of xen, dom0 is running ntpd and is perfectly in time. All domU's are ~23s in future. Running ntpd on the domU's seem to have no effect, /proc/sys/xen/independent_wallclock appears to have no effect. I'm running xen-unstable and 2.6.16-rc4 in AMD64 box.

Any tip would be appricated.

Thanks,

Signature · 1 line
  ++ytti
#1 lore raw

On (2006-02-26 12:07 +0200), Saku Ytti wrote:

Just noticed '[Xen-devel] domU time lagging'. And indeed 'date -s'
in dom0 sets time right in domU's.
So I guess I should try the Kim's patch next time I'm reloading
the box.

Is this fix going to be pushed to mercurial anytime soon?

Quoted 18 lines

Hey,

I have rather new installation of xen, dom0 is running ntpd and is perfectly in time. All domU's are ~23s in future. Running ntpd on the domU's seem to have no effect, /proc/sys/xen/independent_wallclock appears to have no effect. I'm running xen-unstable and 2.6.16-rc4 in AMD64 box.

Any tip would be appricated.

Thanks,

Signature · 6 lines
  ++ytti

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 1 line
  ++ytti
author
#2 lore raw
In reply to Saku Ytti

On (2006-02-26 12:07 +0200), Saku Ytti wrote:

Just noticed '[Xen-devel] domU time lagging'. And indeed 'date -s' in dom0 sets time right in domU's.
So I guess I should try the Kim's patch next time I'm reloading
the box.

Is this fix going to be pushed to mercurial anytime soon?

Quoted 18 lines

Hey,

I have rather new installation of xen, dom0 is running ntpd and is perfectly in time. All domU's are ~23s in future. Running ntpd on the domU's seem to have no effect, /proc/sys/xen/independent_wallclock appears to have no effect. I'm running xen-unstable and 2.6.16-rc4 in AMD64 box.

Any tip would be appricated.

Thanks,

Signature · 6 lines
  ++ytti

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 1 line
  ++ytti
#3 lore raw
In reply to Saku Ytti
Quoted 7 lines · Saku Ytti

I have rather new installation of xen, dom0 is running ntpd and is perfectly in time. All domU's are ~23s in future. Running ntpd on the domU's seem to have no effect, /proc/sys/xen/independent_wallclock appears to have no effect. I'm running xen-unstable and 2.6.16-rc4 in AMD64 box.

Any tip would be appricated.

Booting the domU's with 'independent_wallclock' as a command-line parameter, and then running a standard vendor ntp init script (usually ntpdate followed by starting ntpd) certainly *should* have fixed the domU time problem.

Just setting independent_wallclock (no ntpd) would have no effect. ntpd without independent_wallclock also probably wouldn't work well.

I'll check in a (temporary) patch to periodically synchronise Xen's wallclock time with that of domain0. The best fix would be to move ntp's adtimex() syscall down into Xen, but that'll require some heavier lifting (I think it'll work well though, when it's done).

-- Keir

#4 lore raw
Quoted 1 line · Keir Fraser

I'll check in a (temporary) patch to periodically synchronise Xen's wallclock time with that of domain0.

The patch is now applied to the unstable and 3.0-testing trees.

-- Keir

#5 lore raw
Quoted 7 lines · Keir Fraser
Quoted 2 lines · Keir Fraser

I'll check in a (temporary) patch to periodically synchronise Xen's wallclock time with that of domain0.

The patch is now applied to the unstable and 3.0-testing trees.

Thanks, will try it later, for now running 'date -s $(date +%H:%M:%S)' in cron.hourly :)

Signature · 1 line
  ++ytti
author
#6 lore raw
In reply to Keir Fraser
Quoted 4 lines · Keir Fraser
Quoted 2 lines

I'll check in a (temporary) patch to periodically synchronise Xen's wallclock time with that of domain0.

The patch is now applied to the unstable and 3.0-testing trees.

Thanks, will try it later, for now running 'date -s $(date +%H:%M:%S)' in cron.hourly :)

Signature · 1 line
  ++ytti
#16 lore raw
In reply to Saku Ytti

Hello,

In Xen 2.0.7 I've had clock issues in domU when using OpenNTPD in dom0.
When I switched to "legacy" ntpd the clocks went back in sync.

It doesn't sound like your server has this particular problem, but I thought I'd mention it in case you're running OpenNTPD.

-James

Quoted 11 lines · Saku Ytti

Hey,

I have rather new installation of xen, dom0 is running ntpd and is perfectly in time. All domU's are ~23s in future. Running ntpd on the domU's seem to have no effect, /proc/sys/xen/independent_wallclock appears to have no effect. I'm running xen-unstable and 2.6.16-rc4 in AMD64 box.

Any tip would be appricated.

Thanks,

author
#17 lore raw
Quoted 7 lines · James Henderson

Hello,

In Xen 2.0.7 I've had clock issues in domU when using OpenNTPD in dom0.
When I switched to "legacy" ntpd the clocks went back in sync.

It doesn't sound like your server has this particular problem, but I thought I'd mention it in case you're running OpenNTPD.

thanks for the tip, bit indeed I'm using original NTPD.

Quoted 15 lines

-James

Quoted 11 lines · Saku Ytti

Hey,

I have rather new installation of xen, dom0 is running ntpd and is perfectly in time. All domU's are ~23s in future. Running ntpd on the domU's seem to have no effect, /proc/sys/xen/independent_wallclock appears to have no effect. I'm running xen-unstable and 2.6.16-rc4 in AMD64 box.

Any tip would be appricated.

Thanks,

Signature · 1 line
  ++ytti
#7 lore raw
In reply to Keir Fraser

Hi,

Quoted 10 lines · Keir Fraser
Quoted 5 lines

I have rather new installation of xen, dom0 is running ntpd and is perfectly in time. All domU's are ~23s in future. Running ntpd on the domU's seem to have no effect, /proc/sys/xen/independent_wallclock appears to have no effect. I'm running xen-unstable and 2.6.16-rc4 in AMD64 box.

Booting the domU's with 'independent_wallclock' as a command-line parameter, and then running a standard vendor ntp init script (usually ntpdate followed by starting ntpd) certainly *should* have fixed the domU time problem.

I run into the same problem (ntp not working), so I set independent_wallclock and ntp un domU can set the system time. thanks for the hint!

BUT!!! with independent_wallclock I have a new problem:
now the hw clock can't be read anymore

root@rhel4 # /sbin/hwclock --debug
hwclock from util-linux-2.12a
hwclock: Open of /dev/rtc failed, errno=19: No such device. No usable clock interface found.
Cannot access the Hardware Clock via any known method.

this causes system to start up with system time "1 Jan 1970"

	# grep 1970 /var/log/boot.log
	Jan  1 01:00:10 os2-rhel4 date: Do Jan  1 01:00:10 CET 1970 
	Jan  1 01:00:10 os2-rhel4 rc.sysinit: Stelle Uhr  (localtime) auf: Do Jan  1 01:00:10 CET 1970 succeeded 

and in /var/log/messages:

	Jul 11 17:26:00 os2-rhel4 exiting on signal 15
	Jan  1 01:00:17 os2-rhel4 syslogd 1.4.1: restart.
	...
	Jan  1 01:00:26 os2-rhel4 xinetd[1307]: xinetd Version 2.3.13 started with libwrap loadavg options compiled in.
	Jan  1 01:00:26 os2-rhel4 xinetd[1307]: Started working: 2 available services
	Jul 11 17:31:56 os2-rhel4 ntpdate[1321]: step time server 10.0.5.7 offset 1152692789.758448 sec
	Jul 11 17:31:56 os2-rhel4 ntpd:  succeeded
	Jul 11 17:31:56 os2-rhel4 ntpd: Starten von ntpd succeeded

not only there are many bogus time stamps in log files, it also causes a file system check at every startup because the fs was mounted last time "so long ago":

	# /sbin/tune2fs -l /dev/hda1 |grep 1970  
	Last mount time:          Thu Jan  1 01:00:21 1970
	Last checked:             Thu Jan  1 01:01:36 1970

my current setup is: AMD64 dual-core dual-opteron

xen:

	Xen version 3.0.1 ([email protected]) (gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)) Tue Jan 31 15:26:55 GMT 2006
	Latest ChangeSet: Tue Jan 31 11:04:12 2006 +0100 8738:eff96462fde8

dom0 and domU kernel:

	Linux version 2.6.12.6-xen ([email protected]) (gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)) #1 SMP Tue Jan 31 15:36:43 GMT 2006

will an update to a more recent XEN version fix these problems ?

if yes, what do I have to replace/update ?
only domU kernel? or dom0+domU ?
only hypervisor? or just everything ?

thanks for every help!!

Harald Koenig

Signature · 8 lines
"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                                    //  /     \\  \
[email protected]                            ^^^^^       ^^^^^
#8 lore raw
Quoted 11 lines · Harald Koenig

I run into the same problem (ntp not working), so I set independent_wallclock and ntp un domU can set the system time. thanks for the hint!

BUT!!! with independent_wallclock I have a new problem:
now the hw clock can't be read anymore

root@rhel4 # /sbin/hwclock --debug
hwclock from util-linux-2.12a
hwclock: Open of /dev/rtc failed, errno=19: No such device. No usable clock interface found.
Cannot access the Hardware Clock via any known method.

RTC is inaccessible to domU regardless of independent_wallclock.

-- Keir

#9 lore raw
Quoted 1 line · Keir Fraser

RTC is inaccessible to domU regardless of independent_wallclock.

so what's your suggestion for a setup which allows both

- correct startup time (mount time, syslog start time etc), and
- working ntp ?

thanks,

Harald Koenig

Signature · 8 lines
"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                                    //  /     \\  \
[email protected]                            ^^^^^       ^^^^^
#10 lore raw
Quoted 6 lines · Harald Koenig
Quoted 1 line

RTC is inaccessible to domU regardless of independent_wallclock.

so what's your suggestion for a setup which allows both

- correct startup time (mount time, syslog start time etc), and
- working ntp ?

Run ntpd in domain0, and don't use independent_wallclock.

-- Keir

#11 lore raw
Quoted 4 lines · Keir Fraser
Quoted 2 lines

- correct startup time (mount time, syslog start time etc), and
- working ntp ?

Run ntpd in domain0, and don't use independent_wallclock.

that was my default setup I started with, until yesterday I realized that the domUs don't keep the time in sync. dom0 (FC4) is perfectly in sync running ntp.

the domUs run ntp too, but there they don't manage to set/adjust the system time, so the ntp on domU logs the time skew. from syslog of a RH9 client:

Jun 26 20:08:25 os-rh9 ntpd[1666]: time reset +12.532031 s
Jun 26 20:24:51 os-rh9 ntpd[1666]: time reset +12.597371 s
Jun 26 20:41:07 os-rh9 ntpd[1666]: time reset +12.761633 s
Jun 26 21:02:54 os-rh9 ntpd[1666]: time reset +12.843185 s
Jun 26 21:19:18 os-rh9 ntpd[1666]: time reset +12.930329 s
Jun 26 21:38:59 os-rh9 ntpd[1666]: time reset +13.028862 s
Jun 26 21:56:19 os-rh9 ntpd[1666]: time reset +13.159422 s
...
Jun 27 20:05:22 os-rh9 ntpd[1666]: time reset +19.513893 s
Jun 27 20:22:37 os-rh9 ntpd[1666]: time reset +19.640442 s
Jun 27 20:37:47 os-rh9 ntpd[1666]: time reset +19.718607 s
Jun 27 20:55:09 os-rh9 ntpd[1666]: time reset +19.769548 s
Jun 27 21:13:31 os-rh9 ntpd[1666]: time reset +19.865546 s
Jun 27 21:30:49 os-rh9 ntpd[1666]: time reset +19.965029 s

does running ntp in a domU disable the clock synchronisation between dom0 and domU ?

Harald Koenig

Signature · 8 lines
"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                                    //  /     \\  \
[email protected]                            ^^^^^       ^^^^^
#12 lore raw
Quoted 1 line · Harald Koenig

does running ntp in a domU disable the clock synchronisation between dom0 and domU ?

I do this:
[[email protected] ~]% ssh [email protected] "cat /etc/cron.hourly/ntp-hack" #!/bin/sh

PATH=/bin

date -s $(date +%H:%M:%S) > /dev/null
[[email protected] ~]%

Ugly, but works for me.

Signature · 1 line
  ++ytti

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

#13 lore raw
Quoted 11 lines · Saku Ytti
Quoted 1 line · Harald Koenig

does running ntp in a domU disable the clock synchronisation between dom0 and domU ?

I do this:
[[email protected] ~]% ssh [email protected] "cat /etc/cron.hourly/ntp-hack" #!/bin/sh

PATH=/bin

date -s $(date +%H:%M:%S) > /dev/null

thanks for the hint!

indeed, running this on dom0 also sets the clocks for domU.

BUT: it also causes clock jumps up to 0.999 secs every our because it can't
handle fractions of a second. and it always steps back the time
giving a non-monotonic system time -- too bad :-(((

that's not what time syncronisation and ntp is all about...

I tried to keep the fractions of seconds but this doesn't work:

	# date -s $( date +%H:%M:%S.%N )
	date: invalid date `21:38:53.976633000'

are there other methods to trigger the time sync (push) between dom0 and domU without (re-) setting the system time in dom0 ?

looks like I have to live with a jumpy time for now :-(

thanks for your help,

Harald Koenig

Signature · 8 lines
"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                                    //  /     \\  \
[email protected]                            ^^^^^       ^^^^^
#14 lore raw
Quoted 8 lines · Harald Koenig

I tried to keep the fractions of seconds but this doesn't work:

	# date -s $( date +%H:%M:%S.%N )
	date: invalid date `21:38:53.976633000'

are there other methods to trigger the time sync (push) between dom0 and domU without (re-) setting the system time in dom0 ?

It's supposed to happen automatically and with microsecond precision. Obviously something is wrong here.

-- Keir

#15 lore raw
Quoted 9 lines · Keir Fraser
Quoted 6 lines · Harald Koenig

I tried to keep the fractions of seconds but this doesn't work:

	# date -s $( date +%H:%M:%S.%N )
	date: invalid date `21:38:53.976633000'
Quoted 5 lines
Quoted 2 lines

are there other methods to trigger the time sync (push) between dom0 and domU without (re-) setting the system time in dom0 ?

It's supposed to happen automatically and with microsecond precision. Obviously something is wrong here.

should this work already with xen 3.0.1, or do I have to upgrade ?

my current setup is: AMD64 dual-core dual-opteron

xen:

        Xen version 3.0.1 ([email protected]) (gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)) Tue Jan 31 15:26:55 GMT 2006
        Latest ChangeSet: Tue Jan 31 11:04:12 2006 +0100 8738:eff96462fde8

dom0 and domU kernel:

        Linux version 2.6.12.6-xen ([email protected]) (gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)) #1 SMP Tue Jan 31 15:36:43 GMT 2006

all from xensource.org...

Harald Koenig

Signature · 8 lines
"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                                    //  /     \\  \
[email protected]                            ^^^^^       ^^^^^