From owner-freebsd-virtualization@freebsd.org Mon Apr 29 15:32:53 2019 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 630EA159433E for ; Mon, 29 Apr 2019 15:32:53 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) Received: from admin.sibptus.ru (admin.sibptus.ru [IPv6:2001:19f0:5001:21dc::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2AD890CB for ; Mon, 29 Apr 2019 15:32:51 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=/J+0zUolWwxLCCpVHio0iPe9PLyGmlwinE6JafeDnO0=; b=MogugUam0m0xs4/C803cmxyZmq VngdBzCsltjDKGS2h/VJ7zepARpTyEfRS2i7Qpd0nX+FbD2O4/hBro164a4Ir0qDFgdpH9CL3G+y8 oRGPebtlT85k+s6kOKY8Vhl9oeUgbrQVk8ut4hQuSGW5fgRXnag/xlVr3CMo92SBQOZM=; Received: from vas by admin.sibptus.ru with local (Exim 4.92 (FreeBSD)) (envelope-from ) id 1hL8Gw-000OKa-Ny for freebsd-virtualization@freebsd.org; Mon, 29 Apr 2019 22:32:50 +0700 Date: Mon, 29 Apr 2019 22:32:50 +0700 From: Victor Sudakov To: FreeBSD virtualization Subject: Re: [vm-bhyve] shutting down VMs and kern.init_shutdown_timeout Message-ID: <20190429153250.GA93256@admin.sibptus.ru> References: <20190428044118.GA46284@admin.sibptus.ru> <1DE7A90B-E3AB-4F1E-9A3A-981B18751F8E@punkt.de> <20190429082408.GA84142@admin.sibptus.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.11.4 (2019-03-13) Sender: Victor Sudakov X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:32:53 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Adam wrote: >=20 > > Patrick M. Hausen wrote: > > > > > > > Am 28.04.2019 um 06:41 schrieb Victor Sudakov : > > > > "if the /etc/rc.shutdown does not terminate within 120 seconds, init > > will > > > > terminate it. The timeout can be configured via the sysctl variable > > > > kern.init_shutdown_timeout.=E2=80=9C > > > > > > > What=E2=80=99s keeping you from increasing that timeout for your > > > particular requirements? > > > > Is that really necessary? Am I correct assuming that any VM is supposed > > to shut down within 2 minutes or else the bhyve processes will be > > killed? Or is this kern.init_shutdown_timeout only about the rc.shutdown > > script itself and not its children? > > >=20 > FreeBSD is tuned as a general purpose server OS. If you find the defaults > don't meet your needs, you can change them. That's why tunables exist. Adam, if you know the answer to my direct question above, please answer it. I also would like to know if there are any adverse effects of increasing kern.init_shutdown_timeout.=20 > > > IMHO 2 minutes are a reasonable > > > default for a system that does not run hypervisor VMs - > > > which is probably the vast majority. > > > > > > Anyone with the knowledge to implement a virtualized > > > environment > > > > The lack of information about this caveat in > > https://wiki.freebsd.org/bhyve, man vm-bhyve, > > > > https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/virtualizati= on-host-bhyve.html > > and other sources suggests that this particular knowledge may be > > limited. Other hypervisors (non-bhyve) probably wait for all VMs to sto= p. > > >=20 > RH implemented this relatively recently. >=20 > https://bugzilla.redhat.com/show_bug.cgi?id=3D1334982 Good for them. We need to raise awareness too, so I've created this PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237646 >=20 > > can simply set that to a more suitable value, > > > can=E2=80=99t he/she? > > > > Yes if they know about it. There should be a warning somewhere in the > > documentation if we want to be serious about FreeBSD as a hypervisor. > > > > Or better still, a warning that rcshutdown_timeout (if set) and > > kern.init_shutdown_timeout can be too low when running vm-bhyve and > > such is desirable. > > >=20 > Why don't you simply write a wrapper script which calls shutdown after > shutting down guests? =20 A lot of things can be done to mitigate this problem, as soon as you are aware of it. > I doubt many admins on any hypervisor are > gratuitously calling shutdown on host with important guests running. Well, after I started noticing "WARNING: / was not properly dismounted" in my guest OS's logs, after the perfectly correct shutdown of the host, I stopped calling shutdown on host, and started thinking why this was happening. But not before.=20 --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --Q68bSM7Ycu6FN28Q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcxxkiAAoJEA2k8lmbXsY0yuwH/2SmdD1dU/5jqfx5K9qNntOW RT9dWeXrdNXI3zoS2Uu/t1yNQpJApvB2ay3svceq4GK4DEKAYbtoJd1Ib6EVCeeX mlbQFk0keSFiXg0jKjtGTJ13LL4+hJLG6zpNgNoxAv/HwOiPk1PXjT7rA0AyqF18 PgVyZYHREY1OBzWcUlTguKbmjxzrnD+W1drHrJhH53hH1DkOzrMXvOQT6QVFwBup KOE8OI0HgFkO0pYOfLR/xmRg+zENVG26TPCeZnulND/XRAOqjJ/lfB5tBRxO0ujR eF75wswPAlL1hjp0d7nkVRPQnjGOrM67kYHiwye9enR/tnuJwpGtbOuNPh2WcdY= =ONRq -----END PGP SIGNATURE----- --Q68bSM7Ycu6FN28Q--