From owner-freebsd-virtualization@freebsd.org Tue Apr 23 13:57:38 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 E6153159B4B7 for ; Tue, 23 Apr 2019 13:57:37 +0000 (UTC) (envelope-from kusuriya@serversave.us) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 8D1C472F94 for ; Tue, 23 Apr 2019 13:57:37 +0000 (UTC) (envelope-from kusuriya@serversave.us) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 75F4927C11; Tue, 23 Apr 2019 09:57:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 23 Apr 2019 09:57:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serversave.us; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=mesmtp; bh=YuEb0jzExM501ii1BzdrvcPk1EbQk8GFZmhnSj2wvCI=; b=bK0aqgjulbot lMtUq+zYUTp01SyPGo4IIZPuDE49+aVPuAj9Wp0/6XsE9GgLdmEoljCPtalRC4S+ 0Td8qNtDF+huJkvUsbruE0hMfELqCU7iEh/Nl/6e3Fm3FMwOp7LnmBJxahysWbo1 D6JCpHFUhZQ4yu8drmrXa2iIrEC3fbQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=YuEb0jzExM501ii1BzdrvcPk1EbQk8GFZmhnSj2wv CI=; b=cr8zltyRk6KZzjf8S2fUTwRB0VkFouIfTXwmREIlMGvZcT3uNTh2Q46Aq Fb8qOU8kNVRdDlggY3umg6p9FRvYqHvejE0CFt8Y5bR8uxofRWhhQaG1YhnuPhqX ymO0zAYiJDch5ekxrVuim4agzlVO1WCCQkX8Bf8lV1WKea9asnpT8GSbh9FBTDWN ykKwi/hudHJu8NLZeq79XyTl1HEi+/xIM68rb7pZXweluyaEZwzf/12x5hZNdC8z vttYakPauy1ICtjzyGVrJO4B76rX+dhHugb0xYLRC8zsazEdPpvfbvNNTSHf/Mju I16JH3onuVbzREaWz029O8D011yVg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrgeekgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdeimdenucfjughrpegtggfuhf fojgffgffkfhfvsehtqhhmtdhhtddvnecuhfhrohhmpeflrghsohhnuceurghrsghivghr uceokhhushhurhhihigrsehsvghrvhgvrhhsrghvvgdruhhsqeenucffohhmrghinhepgh hithhhuhgsrdgtohhmnecukfhppedujedvrdehkedrfeehrddunecurfgrrhgrmhepmhgr ihhlfhhrohhmpehkuhhsuhhrihihrgesshgvrhhvvghrshgrvhgvrdhushenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from [IPv6:2607:fb90:a682:fde8:14ca:690c:b168:526] (unknown [172.58.35.1]) by mail.messagingengine.com (Postfix) with ESMTPA id 33295E424F; Tue, 23 Apr 2019 09:57:35 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop From: Jason Barbier X-Mailer: iPhone Mail (16E227) In-Reply-To: <20190423041358.GA2992@admin.sibptus.ru> Date: Tue, 23 Apr 2019 06:57:30 -0700 Cc: freebsd-virtualization@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3E2402FD-CA3E-4471-B7A9-6D6B0CB1B900@serversave.us> References: <20190421154616.GA59283@admin.sibptus.ru> <201904211708.x3LH8DiK028282@gndrsh.dnsmgr.net> <20190423024301.GA940@admin.sibptus.ru> <20190423041358.GA2992@admin.sibptus.ru> To: Victor Sudakov X-Rspamd-Queue-Id: 8D1C472F94 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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 13:57:38 -0000 > On Apr 22, 2019, at 21:13, Victor Sudakov wrote: >=20 > Paul Vixie wrote: >>=20 >> 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=3D$(pgrep -f 'bhyve:') >>>>=20 >>>> echo "Shutting down all bhyve virtual machines" >>>> killall bhyve >>>> sleep 1 >>>> killall bhyve >>>> wait_for_pids ${_pids} >>>> } >>=20 >> yow. Eew no that is painful to read! >=20 > 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. >=20 >>=20 >>>>=20 >>>> I wonder what the effect of the second kill is, >>>> that seems odd. >>>=20 >>> Indeed. >>=20 >> the first killall will cause each client OS to see a soft shutdown=20 >> signal. the sleep 1 gives them some time to flush their buffers. the=20 >> second killall says, time's up, just stop. >>=20 >> i think this is worse than brutal, it's wrong. consider freebsd's own=20 >> work flow when trying to comply with the first soft shutdown it got: >>=20 >> https://github.com/freebsd/freebsd/blob/master/sbin/reboot/reboot.c#L220 >>=20 >> this has bitten me more than once, because using "pageins" as a proxy=20 >> for "my server processes are busy trying to synchronize their user mode=20= >> state" is inaccurate. i think _any_ continuing I/O should be reason to=20= >> wait the full 60 seconds. >=20 > Would it be beneficial to just hack /usr/local/lib/vm-bhyve/vm-* ? >>=20 >> and so i think the "sleep 1" above should be a "sleep 65". I would echo this and say it should probably be done in a way that you can h= ave a sliding window, some servers and services are not very fault tolerant o= n their own. The example that springs to mind for me is the busy AD domain c= ontroller I manage. It takes 15 mins to flush the disk buffer, if I kill it b= efore the buffer flushes I will have a bad day as my domain at best loses a f= ew transactions at worst is corrupted.