Re: host, bhyve vm and ntpd

From: Ian Lepore <ian_at_freebsd.org>
Date: Fri, 20 Oct 2017 09:12:07 -0600
On Fri, 2017-10-20 at 14:46 +0300, Boris Samorodov wrote:
> Hi All,
> 
> I have got a host:
> ---
> bhyve-host% uname -a
> FreeBSD sm.bsnet 12.0-CURRENT FreeBSD 12.0-CURRENT #3 r322868: Fri Aug
> 25 05:25:26 MSK 2017
> bsam_at_builder.bsnet:/usr/obj/usr/src/sys/GENERIC-FAST  amd64 amd64
> ---
> 
> And a bhyve vm:
> ---
> bhyve-vm: uname -a
> FreeBSD builder.bsnet 12.0-CURRENT FreeBSD 12.0-CURRENT #58 r324782: Fri
> Oct 20 05:12:17 MSK 2017
> bsam_at_builder.bsnet:/usr/obj/usr/src/sys/PKG64X  amd64 amd64
> ---
> 
> The only difference at kernel configs is a colored console. :-)
> 
> And here I get some weird (is it?) result at the VM (I expect ntpd to be
> more stable):
> ---
> bhyve-vm% for t in `jot 10`; do ntpq -pn; sleep 64; done
>      remote           refid      st t when poll reach   delay   offset
> jitter
> ==============================================================================
>  XX.XX.XX.1      XX.XX.XX.245     4 u    9   64    3    0.605   -1.202
> 316.407
>  XX.XX.XX.1      XX.XX.XX.245     4 u    7   64    7    0.605   -1.202
> 358.395
> *XX.XX.XX.1      XX.XX.XX.245     4 u    5   64   17    0.615  -328.42
> 181.405
> *XX.XX.XX.1      XX.XX.XX.245     4 u    3   64   37    0.615  -328.42
> 214.868
> *XX.XX.XX.1      XX.XX.XX.245     4 u   67   64   37    0.615  -328.42
> 214.868
> *XX.XX.XX.1      XX.XX.XX.245     4 u   63   64   77    0.615  -328.42
> 268.618
> *XX.XX.XX.1      XX.XX.XX.245     4 u   60   64  177    0.615  -328.42
> 333.175
>  XX.XX.XX.1      .STEP.          16 u 1910   64    0    0.000    0.000
> 0.000
>  XX.XX.XX.1      XX.XX.XX.245     4 u   27   64    1    0.703  -262.63
> 0.004
>  XX.XX.XX.1      XX.XX.XX.245     4 u   31   64    1    0.649  -331.43
> 68.800
> ---
> 
> At the same time host's results are very stable:
> ---
> bhyve-host% for t in `jot 10`; do ntpq -pn; sleep 64; done
>      remote           refid      st t when poll reach   delay   offset
> jitter
> ==============================================================================
> 
> 
> 
> *XX.XX.XX.1      XX.XX.XX.245     4 u    1   64    1    0.401    0.176
> 0.106
> *XX.XX.XX.1      XX.XX.XX.245     4 u    6   64    3    0.401    0.176
> 0.459
> *XX.XX.XX.1      XX.XX.XX.245     4 u    3   64    7    0.401    0.176
> 0.940
> *XX.XX.XX.1      XX.XX.XX.245     4 u   67   64    7    0.401    0.176
> 0.940
> *XX.XX.XX.1      XX.XX.XX.245     4 u   64   64   17    0.401    0.176
> 1.566
> *XX.XX.XX.1      XX.XX.XX.245     4 u   60   64   37    0.448    1.275
> 1.739
> *XX.XX.XX.1      XX.XX.XX.245     4 u   55   64   77    0.448    1.275
> 2.365
> *XX.XX.XX.1      XX.XX.XX.245     4 u   53   64  177    0.448    1.275
> 3.110
> *XX.XX.XX.1      XX.XX.XX.245     4 u   50   64  377    0.448    1.275
> 3.929
> *XX.XX.XX.1      XX.XX.XX.245     4 u   45   64  377    0.443    8.750
> 4.722
> ---
> 
> The network is organized via bridge -- host igb and vm tap interfaces
> are members of one bridge.
> 
> Are those results expected? Does it smell like a bug? Should I dig
> furter?
> 

So it is repeatedly stepping the clock in the VM? (Set
kern.timecounter.stepwarnings=1 to log steps).  That is usually a sign
that the chosen timecounter is running at a different frequency than it
claimed to be when it registered itself -- the host may not be
emulating the timer hardware properly in the guest.  What is the output
of sysctl kern.timecounter in the vm?

Also, what is the output of ntptime(8) in the vm?

-- Ian
Received on Fri Oct 20 2017 - 13:12:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC