4

I've set up Xen server under Linux with several guests running, and all was well. After some time I've noticed the clock on the server drifted away, so I installed 'ntpd', and the clock was back to normal. However, my Xen guests still had the old clock. Is there a way for guests to always have the same clock value as on the server? So that each time 'ntpd' synchronizes it on the server, guests would have it changed as well.

dragonroot
  • 193
  • 5
  • 2
    Why not install and operate ntpd sychronization on the Xen guests? – mdpc Dec 24 '12 at 22:35
  • 1
    @mdpc: If you do that, make sure you set `/proc/sys/xen/independent_wallclock` to 1. – David Schwartz Dec 24 '12 at 23:57
  • @DavidSchwartz - it seems that feature has been removed some time back. Not really sure of the reason for it... maybe because it was too problematic to set up correctly. – hookenz Oct 09 '13 at 23:36

2 Answers2

5

Newer versions of Xen do not have the clock sharing feature, and the independent_wallclock setting does not exits. Your best bet is to install ntpd on all guests as well as dom0. You can try openntpd for a simple ntp daemon.

hayalci
  • 3,611
  • 3
  • 25
  • 37
  • Interesting. Which version dropped that feature? Have you got a reference for that? – Nils Dec 30 '12 at 22:27
  • 1
    I realized it when upgrading our debian installations, the upgrade was from Xen 3.2 to 4.0 – hayalci Dec 31 '12 at 12:30
  • this is very interesting. I am just investigating a case where the clocks of the VMs are not coupled any more to the Dom0. XEN is 4.1.2 (SLES11 SP2). Before that - XEN 4.0.0 (SLES11 SP1) everything still "worked". BTW: I can see that independent_wallclock-setting on all DomUs. – Nils Jan 01 '13 at 21:47
  • There still exits a problem when you sync your Dom0 and guests independently: On boot of a guest, the time is *not* taken from Dom0, but from the hypervisor, which itself seems to take the time from the RTC chip. If your hypervisor is up for a long time and your clock drifts backwards, the guest may complain that the filesystem is ahead of boot time. – U. Windl Nov 02 '20 at 07:52
0

it seems that PVHVM guests at least do have clock sharing (qemu/kvm-like):

[ ]# cat /sys/devices/system/clocksource/clocksource0/current_clocksource 
xen
AL13N
  • 41
  • 4