From owner-freebsd-virtualization@freebsd.org Sun Apr 21 14:32:36 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 995DB158E80A for ; Sun, 21 Apr 2019 14:32:36 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F89473A5B for ; Sun, 21 Apr 2019 14:32:35 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3LEWX4W027754; Sun, 21 Apr 2019 07:32:33 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3LEWXqF027753; Sun, 21 Apr 2019 07:32:33 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201904211432.x3LEWXqF027753@gndrsh.dnsmgr.net> Subject: Re: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop In-Reply-To: <20190421071741.GA51438@admin.sibptus.ru> To: Victor Sudakov Date: Sun, 21 Apr 2019 07:32:33 -0700 (PDT) CC: freebsd-virtualization@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 0F89473A5B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,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: Sun, 21 Apr 2019 14:32:36 -0000 -- Start of PGP signed section. > Jason Tubnor wrote: > > On Sun., 21 Apr. 2019, 2:51 pm Victor Sudakov, wrote: > > > > > > > > > > > Does vm-bhyve provide a way to power them off ungracefully if they would > > > not stop within a predefined time? > > > > > > > You'd have to do your own checking but to force an instant power off of a > > guest simply execute: > > > > vm poweroff {guest} > > I don't need an *instant* poweroff, I need a poweroff only if a VM would > not stop gracefully within a predefined time. > > Of course this should not be done manually but from the rc.d/vm script > on shutdown. vm shutdown {guest} & (sleep N && vm poweroff {guest}) & 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. One thing I noted, you said rc.d/vm, so I am assuming your actually using the vm-bhyve port, 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. 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. 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. > Victor Sudakov, VAS4-RIPE, VAS47-RIPN Regards, -- Rod Grimes rgrimes@freebsd.org