PDA

View Full Version : time syncing in a DomU



meikestone
03-Sep-2013, 15:57
Hello,

I'm completely confused about the time synchronization in XEN Environment.
Can anyone recommend me a suitable configuration for time syncing?

For VMWare, there is a manual with recommendations for timkeeping http://www.vmware.com/files/pdf/techpaper/Timekeeping-In-VirtualMachines.pdf

I posted this before in the XEN NG, but I got no suitable answer.

"What is the better solution?

1) use ntp in the XEN host and synchronize the guests with the clock
running on the control domain (independent_wallclock=0, what the
default is)
2) or use ntp in host and guest (and independent_wallclock=1)

I ask, because the XEN host (bare metal) has a more stable clock and
if the ntp servers are fail, the guest VMs can all rely on host clock,
all should guest VMs then are running in sync.
But I heard some bad things about the synchronization with the host
clock, users in internet recommend to use ntp in guest VM. My mind
tells me, to use ntp (2), but my brain in stomach is telling me, to
use syncing via XEN method (1).


Vmware recommend to use ntp in guest
(http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427),
but Citrix only tells, how can I do that..

One good configuration manual for using ntp in guest I've found here:
http://www.brookstevens.org/2010/06/xen-time-drift-and-ntp.html
"

The only answer in the NG was:
"PV ops (AKA upstream) Linux kernels only support option (2), so that is
what you need to use for them.

Only the classic Linux kernel port (not upstream) supported
independent_wallclock=0, I don't know if other PV OSes (e.g. *BSD)
supported this option or not. I'm pretty certain no OS running in HVM
(including Linux as HVM or PVHVM) supported dependent wallclock."

But what kind of kernel is delivered with SLES?
Does the Kernel support wallclock or not, is it a "upstream" or a classic.
I presume, that is a upstream, but then, no wallclock is supported.
In this case the clock is only synchronized to the RTC, if no NTP is configured?

================================================== ============
myserver:~ # rpm -qi kernel-xen
Name : kernel-xen Relocations: (not relocatable)
Version : 3.0.74 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release : 0.6.10.1 Build Date: Sat May 25 12:24:18 2013
Install Date: Thu Jul 11 11:42:20 2013 Build Host: furud
Group : System/Kernel Source RPM: kernel-xen-3.0.74-0.6.10.1.nosrc.rpm
Size : 81262704 License: GPL v2 only
Signature : RSA/8, Sat May 25 12:29:05 2013, Key ID e3a5c360307e3d54
Packager : http://bugs.opensuse.org
URL : http://www.kernel.org/
Summary : The Xen Kernel
Description :
The Linux kernel for Xen paravirtualization.

This kernel can be used both as the domain0 ("xen0") and as an unprivileged
("xenU") kernel when 64-bit; on 32-bit it can only be used in unprivileged
guests.


Source Timestamp: 2013-05-24 11:05:40 +0200
GIT Revision: 590b33ac151b27aa44b943eda8b398f79bacf205
GIT Branch: SLE11-SP2_EMBARGO
Distribution: SUSE Linux Enterprise 11
================================================== ============


Thanks any kind of help

Meike

jmozdzen
03-Sep-2013, 18:13
Hi Meike,

looking at the SUSE documentation, setting independent_wallclock to 0 seems supported: https://www.suse.com/documentation/sles11/singlehtml/book_xen/book_xen.html#sec.xen.guests.suse.time

From personal experience, I'd recommend route #2 - use NTP in the DomUs and set independant_wallclock to "1". While the "RTCs" are periodically synchronized, this may not happen quick enough and cause some real strange side-effects when running timestamp-critical applications (monitoring, short-interval measurements etc). My latest check isn't too recent (SLES11SP0 or SP1), but back then I was under the impression that the sync interval was at least some seconds long and could even cause severe back-shifts when the DomU is under high load. We're running NTP for all DomUs.

Regards,
Jens

meikestone
06-Sep-2013, 09:39
looking at the SUSE documentation, setting independent_wallclock to 0 seems supported: https://www.suse.com/documentation/sles11/singlehtml/book_xen/book_xen.html#sec.xen.guests.suse.time


Thanks, I've seen that, but there is no recommendation and maybe this information there is for "plain SLES environment". I've installed SELS on XEN-Server;-)
I don't know exactly what XEN-Server does if I install the guest via template (PyGrub), but I don't get the normal boot screen from SuSE ... So I don't know, if the informations in the documentation from SuSE are
useful in that case ...

If I look at the installed Kernel version, then it looks, that the kernel in the DOMU is a PV (upstream) kernel (look my first post). But than, it can't configure independant_wallclock=0 (if the information from the answer from the NG is correct). But the settings in my test environment in the kernel are set to "0"..
~# sysctl xen.independent_wallclock
xen.independent_wallclock = 0

Does make this sense, I'm confused ...? So I can set the independant_wallclock=0 but it will not be used?
And if so, from where does get the guest the time now?

So maybe the informations in the documentation only meets the classic kernel?



From personal experience, I'd recommend route #2 - use NTP in the DomUs and set independant_wallclock to "1". While the "RTCs" are periodically synchronized, this may not happen quick enough and cause some real strange side-effects when running timestamp-critical applications (monitoring, short-interval measurements etc). My latest check isn't too recent (SLES11SP0 or SP1), but back then I was under the impression that the sync interval was at least some seconds long and could even cause severe back-shifts when the DomU is under high load. We're running NTP for all DomUs.


Thanks for your information, that is that, what I think too. But there are no official recommendations or at least infromations from XEN/Citrix and how it really works ...


regards Meike.

jmozdzen
06-Sep-2013, 12:44
Hi Meike,


Thanks, I've seen that, but there is no recommendation and maybe this information there is for "plain SLES environment". I've installed SELS on XEN-Server;-)
I don't know exactly what XEN-Server does if I install the guest via template (PyGrub), but I don't get the normal boot screen from SuSE ... So I don't know, if the informations in the documentation from SuSE are
useful in that case ...

AFAICT, you'll get the kernel distributed by SUSE and no "custom XenServer kernel". And about that "normal boot screen from SuSE" - if you're talking about the DVD boot menu, yes, you won't get that neither when installing SLES DomUs on a SLES Xen Dom0, since PV bootups work quite differently.


If I look at the installed Kernel version, then it looks, that the kernel in the DOMU is a PV (upstream) kernel (look my first post).

I had a look at you post, and I didn't draw the same conclusion - the RPM explicitly identifies as "Version : 3.0.74 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany", a PV kernel, but not upstream. So all SUSE documentation (on DomUs) ought to apply.


But than, it can't configure independant_wallclock=0 (if the information from the answer from the NG is correct). But the settings in my test environment in the kernel are set to "0"..
~# sysctl xen.independent_wallclock
xen.independent_wallclock = 0

Does make this sense, I'm confused ...? So I can set the independant_wallclock=0 but it will not be used?
And if so, from where does get the guest the time now?
My best guess is that the kernel does support dependent wallclocking (_wallclock = 0), as it's from SUSE. And even if not: the clock would be set once during boot, and then would continue counting according to the clicks. You should then see a very non-linear progress of the DomU clock, especially during high load times.


Thanks for your information, that is that, what I think too. But there are no official recommendations or at least infromations from XEN/Citrix and how it really works ...

"How it really works" it documented in the kernel sources ;) although it's definitely not everyone's cup of tea to work through those lines of code. And regarding information on XenServer from XEN/Citrix - have you asked them on their position? This is a SUSE SLES forum, so in your case it'd only apply to the DomU part, not the Dom0.

Regards,
Jens