Date: Tue, 23 Apr 2019 11:13:58 +0700 From: Victor Sudakov <vas@mpeks.tomsk.su> To: freebsd-virtualization@freebsd.org Subject: Re: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop Message-ID: <20190423041358.GA2992@admin.sibptus.ru> In-Reply-To: <d33ea04e-4f4f-253a-b658-e6ecfd2308a6@redbarn.org> References: <20190421154616.GA59283@admin.sibptus.ru> <201904211708.x3LH8DiK028282@gndrsh.dnsmgr.net> <20190423024301.GA940@admin.sibptus.ru> <d33ea04e-4f4f-253a-b658-e6ecfd2308a6@redbarn.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Paul Vixie wrote:
>
> Victor Sudakov wrote on 2019-04-22 19:43:
> ...
> >> And the implementation is pretty brutal:
> >> # 'vm stopall'
> >> # stop all bhyve instances
> >> # note this will also stop instances not started by vm-bhyve
> >> #
> >> core::stopall(){
> >> local _pids=$(pgrep -f 'bhyve:')
> >>
> >> echo "Shutting down all bhyve virtual machines"
> >> killall bhyve
> >> sleep 1
> >> killall bhyve
> >> wait_for_pids ${_pids}
> >> }
>
> yow.
To be sure, I was unable to find the above code (as is) in
/usr/local/lib/vm-bhyve/vm-* (the vm-bhyve port 1.3.0). It may be that
something more intelligent is happening in a more recent version, like a
sequential shutdown. However, "kill $pid; sleep 1; kill $pid" seems to
be still present.
>
> >>
> >> I wonder what the effect of the second kill is,
> >> that seems odd.
> >
> > Indeed.
>
> the first killall will cause each client OS to see a soft shutdown
> signal. the sleep 1 gives them some time to flush their buffers. the
> second killall says, time's up, just stop.
>
> i think this is worse than brutal, it's wrong. consider freebsd's own
> work flow when trying to comply with the first soft shutdown it got:
>
> https://github.com/freebsd/freebsd/blob/master/sbin/reboot/reboot.c#L220
>
> this has bitten me more than once, because using "pageins" as a proxy
> for "my server processes are busy trying to synchronize their user mode
> state" is inaccurate. i think _any_ continuing I/O should be reason to
> wait the full 60 seconds.
Would it be beneficial to just hack /usr/local/lib/vm-bhyve/vm-* ?
>
> and so i think the "sleep 1" above should be a "sleep 65".
>
> > What is needed in vm-bhyve is the feature that if ACPI does not stop the
> > guest for a predefined period of time, the guest is powered off.
>
> i agree with this.
Will you please support the bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237479
--
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
iQEcBAEBAgAGBQJcvpEGAAoJEA2k8lmbXsY0rBIH/iHyk57c2eQNmoEsVYnPN6Mw
afifUtGt0DVzLpp2G67gnES6+OhvQXNmVyUdOf+pJW8WlwMetSG8XCQImXoCN/Mk
asQ+jJiNmu3QxdJAs7acAsf5epUE+5Qe5SsGV/MKwuVevbvfpn3TFzKQ2dJf8dAg
xQv9O/UD2csr5tkNSaRlICP1Bv5CKycSW0p3Qs9m3gGzdCs/k7F5/F7KLkmWzYgI
BHXJCrGdFEGx53fBCRsU/IGUug1EAcLrwALCglzf1PaqinLeicVXK0Lb3Fgvbbmp
FiT5elQe1gKs/T8RmaPp7IZXy0hALx97RLOkNulxPApjAEtOQr+frErdwzlUMYw=
=UG4B
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190423041358.GA2992>
