From owner-freebsd-virtualization@freebsd.org Sun Apr 21 15:46:18 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 740ED158FF2D for ; Sun, 21 Apr 2019 15:46:18 +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 C9B107606A for ; Sun, 21 Apr 2019 15:46:17 +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=AOp9YVHPeM93GxVBeta587xG7h+r9TGQwbXOWsaJkW4=; b=Mpm0Y6dh3fR62lwyLdYDLg7fGq 0XAVXEghKXWxwI1TTuihbYE9mVj9crhjXcK8EM1aSSp5tl718RqR+cYNRx8ehUcYSnAFc42IdAC0S 9zQsi+ZOpGLGLN3qwT29is7w9sji8duul51YCIULiqeVkDoz36lopMBvTEuLERpTxxYk=; Received: from vas by admin.sibptus.ru with local (Exim 4.92 (FreeBSD)) (envelope-from ) id 1hIEfY-000FSV-AC for freebsd-virtualization@freebsd.org; Sun, 21 Apr 2019 22:46:16 +0700 Date: Sun, 21 Apr 2019 22:46:16 +0700 From: Victor Sudakov To: freebsd-virtualization@freebsd.org Subject: Re: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop Message-ID: <20190421154616.GA59283@admin.sibptus.ru> References: <20190421071741.GA51438@admin.sibptus.ru> <201904211432.x3LEWXqF027753@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <201904211432.x3LEWXqF027753@gndrsh.dnsmgr.net> 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: Sun, 21 Apr 2019 15:46:18 -0000 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Rodney W. Grimes wrote: > -- Start of PGP signed section. > > Jason Tubnor wrote: > > > On Sun., 21 Apr. 2019, 2:51 pm Victor Sudakov, w= rote: > > >=20 > > > > > > > > > > > > Does vm-bhyve provide a way to power them off ungracefully if they = would > > > > not stop within a predefined time? > > > > > > >=20 > > > You'd have to do your own checking but to force an instant power off = of a > > > guest simply execute: > > >=20 > > > vm poweroff {guest} > >=20 > > I don't need an *instant* poweroff, I need a poweroff only if a VM would > > not stop gracefully within a predefined time. > >=20 > > Of course this should not be done manually but from the rc.d/vm script > > on shutdown. >=20 > vm shutdown {guest} & > (sleep N && vm poweroff {guest}) & >=20 > A bit hackish, but that should work, if the guest has > shutdown by the time you get to the poweroff an error > might occur. This spawns a few processes, but is > non blocking and highly parallel. Thank you, I might give it a try though it would involve hacking the rc.d/vm script. > =20 > One thing I noted, you said rc.d/vm, so I am assuming your actually > using the vm-bhyve port,=20 Yes, I thought that was pretty obvious from the Subject line. > in which case it has a sequential shutdown > with time delays between each guest. vm_delay specifically, and it > shuts vm's down in reverse order of the startup. >=20 > That is more likely your problem in that your sending these acpi > shutdown requests one at a time, and they should be broadcast in > the "power going out" case. Whence is the idea that "vm stopall" does a sequential shutdown? What sense would that make?=20 A sequential startup does make sense but a sequential shutdown? Useless I think. The man page says that=20 stopall Stop all running virtual machines. This sends a stop command = to all bhyve(8) instances, regardless of whether they were starti= ng using vm or not. >=20 > It may be possile to adjust vm_delay to 0 and have that be better, > though I have not locked at the code. You may also wish to discuss > the issue with the vm-bhyve maintainer and maybe a "lights out" > procedure needs to be added. Even if there is a single Windows 2012 or 2016 guest running, it takes the vm several minutes to transition to the "stopped" state. --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcvJBIAAoJEA2k8lmbXsY0Ip0H/0u28Ug63LC8FdSX6H0JcoWx SURlIhdncjkbFmBDBmc2HEPrRFbEhkeOFjldaZwDfipMiTNxxx/VK1yiS/0sjlpA KRE8N03fh19j5PvKBjGaENibPx1VJG8JBDYXJip41UZxbbMyeEF97i9Hl3y0s+w5 9oFhkXZVS+x0kLimSkJhsbtOmpL4/pO+XQ+vR9WLQwWJ7PO43swE7Y0S2H1J4fIB qL3jSjcklxOt7Dy3fXZz0Ws9HEUdnEyaus9RsDCMGVVwqexuA3kn6dvMNqD0IQj1 mOmEF5xvL6ukK76hJHgE4xIJMsOgB0s7psLpM4o6YYKpfeNcGvTissfZWw/T+58= =3kM2 -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE--