From owner-freebsd-virtualization@freebsd.org Tue Apr 23 08:18:44 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 04F4915926CC for ; Tue, 23 Apr 2019 08:18:44 +0000 (UTC) (envelope-from matt.churchyard@userve.net) Received: from smtp-a.userve.net (smtp-outbound.userve.net [217.196.1.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.userve.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733109525D for ; Tue, 23 Apr 2019 08:18:43 +0000 (UTC) (envelope-from matt.churchyard@userve.net) Received: from owa.usd-group.com (owa.usd-group.com [217.196.1.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-a.userve.net (Postfix) with ESMTPS id F0FFF39C6; Tue, 23 Apr 2019 09:18:33 +0100 (BST) Received: from SERVER.ad.usd-group.com (192.168.0.1) by SERVER.ad.usd-group.com (192.168.0.1) with Microsoft SMTP Server (TLS) id 15.0.847.32; Tue, 23 Apr 2019 09:18:33 +0100 Received: from SERVER.ad.usd-group.com ([fe80::b19d:892a:6fc7:1c9]) by SERVER.ad.usd-group.com ([fe80::b19d:892a:6fc7:1c9%12]) with mapi id 15.00.0847.030; Tue, 23 Apr 2019 09:18:33 +0100 From: Matt Churchyard To: Paul Vixie , Victor Sudakov CC: "freebsd-virtualization@freebsd.org" Subject: RE: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop Thread-Topic: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop Thread-Index: AQHU9/34wf9fOjj/bk24Jj1lbYU4w6ZGBuuAgAAc8oCAAHmAgIAAFJkAgAAW5YCAAjLugIAABqwAgABlfNA= Date: Tue, 23 Apr 2019 08:18:33 +0000 Message-ID: <4a660af455444ff48f38dc26852d999b@SERVER.ad.usd-group.com> References: <20190421154616.GA59283@admin.sibptus.ru> <201904211708.x3LH8DiK028282@gndrsh.dnsmgr.net> <20190423024301.GA940@admin.sibptus.ru> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.0.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Rspamd-Queue-Id: 733109525D X-Spamd-Bar: ------ X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.998,0] 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: Tue, 23 Apr 2019 08:18:44 -0000 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 #=20 >> core::stopall(){ >> local _pids=3D$(pgrep -f 'bhyve:') >> >> echo "Shutting down all bhyve virtual machines" >> killall bhyve >> sleep 1 >> killall bhyve >> wait_for_pids ${_pids} >> } > yow. >> >> I wonder what the effect of the second kill is, that seems odd. >=20 > 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 killa= ll says, time's up, just stop. Both of these killall commands send a soft shutdown signal and I've never s= een an instance in my own testing where the second has caused an instant po= weroff. I've just double checked this, and a FreeBSD guest stopped with the existin= g code fully shuts itself down, ending with "acpi0: Powering system off" The main reason for having both is that in my initial testing, I could not = get Windows to respond to a single SIGINT. 100% of the time it would simply= act like nothing had happened. Sending two however triggered a shutdown. I= only have a single test machine though so maybe it's something strange abo= ut my particular system that no one else experiences... Matt > i think this is worse than brutal, it's wrong. consider freebsd's own wor= k 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. > 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=20 > the guest for a predefined period of time, the guest is powered off. > i agree with this. -- > P Vixie _______________________________________________ freebsd-virtualization@freebsd.org mailing list https://lists.freebsd.org/m= ailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebs= d.org"