Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Nov 2015 12:21:20 +0100
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
To:        Karl Pielorz <kpielorz_lst@tdx.co.uk>, <freebsd-xen@freebsd.org>
Subject:   Re: 'Live' Migrate messes up NTP on FreeBSD domU - any suggestions?
Message-ID:  <563898B0.5040100@citrix.com>
In-Reply-To: <8448B4CE863936ADEF762C0F@[10.12.30.106]>
References:  <151F73F1EF071C3C48F17866@[10.12.30.106]> <5637A01B.1010307@citrix.com> <8448B4CE863936ADEF762C0F@[10.12.30.106]>

next in thread | previous in thread | raw e-mail | index | archive | help
El 03/11/15 a les 11.03, Karl Pielorz ha escrit:
> 
> Hi,
> 
> Ok, I've done some proper research into this now...
> 
> When Migrating a domU FreeBSD (10.1-R p6) between hosts, it "more often
> than not" gains time.
> 
> This breaks NTP on the domU.
> 
> I setup a script on the domU being migrated that read out it's clock -
> and called out to an external machine to read it's clock - i.e.
> 
> "
>  Me: Tue Nov  3 09:55:51 GMT 2015
> Them: Tue Nov  3 09:55:51 GMT 2015
> 
>  Me: Tue Nov  3 09:55:52 GMT 2015
> Them: Tue Nov  3 09:55:52 GMT 2015
> "
> 
> As you can see 'Me' and 'Them' is in sync.
> 
> At this point I live migrated the FreeBSD box from one XenServer
> (6.5-SP1 w/hotfixes) to another in the pool (same hardware spec /
> XenServer etc.)
> 
> The domU's clock got advanced by a number of seconds:
> 
> "
>  Me: Tue Nov  3 09:55:52 GMT 2015
> Them: Tue Nov  3 09:55:52 GMT 2015
> 
> [Migrate 'Me' Happens Now]
> 
>  Me: Tue Nov  3 09:56:02 GMT 2015
> Them: Tue Nov  3 09:55:58 GMT 2015
> 
>  Me: Tue Nov  3 09:56:06 GMT 2015
> Them: Tue Nov  3 09:55:59 GMT 2015
> 
>  Me: Tue Nov  3 09:56:07 GMT 2015
> Them: Tue Nov  3 09:56:00 GMT 2015
> 
>  Me: Tue Nov  3 09:56:08 GMT 2015
> Them: Tue Nov  3 09:56:01 GMT 2015
> "
> 
> So you can see during the migrate the 'Me' (domU being moved) clock
> picks up 3 seconds, then another 4 seconds to make it 'ahead' 7 seconds
> in total - at which point it stabilises).

Can't you tell ntpd to just resynchronize no matter what skew it detects?

> It stays this way then - which is enough to cause NTP to "give up"
> trying to bring that back into alignment.
> 
>> http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=f8e8fd56bd7d5675e8331
>> b4ec74bae76c9dbf24e
>> http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=32c864a35ece2c24a336d
>> 183869a546798a4b241
> 
> Are either of those fixes likely to cure this?

Hm, I don't think so. Both commits are present from 4.3 onwards, and
IIRC XenServer 6.5 is based on Xen 4.4, which should contain both fixes.

Is XenServer also synchronized using ntpd? When a guest resumes from
migration is updates it's current time based on the time provided by the
hypervisor, so if the hosts themselves are not synchronized you could
see skews like that.

Roger.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?563898B0.5040100>