From owner-freebsd-virtualization@freebsd.org Wed Apr 24 05:57:10 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 C5C74158D723 for ; Wed, 24 Apr 2019 05:57:10 +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 3528074CDA for ; Wed, 24 Apr 2019 05:57:09 +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 x3O5v6Df041738; Tue, 23 Apr 2019 22:57:06 -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 x3O5v6AK041737; Tue, 23 Apr 2019 22:57:06 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201904240557.x3O5v6AK041737@gndrsh.dnsmgr.net> Subject: Re: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop In-Reply-To: <20190424043656.GA25754@admin.sibptus.ru> To: Victor Sudakov Date: Tue, 23 Apr 2019 22:57:06 -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: 3528074CDA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; 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: Wed, 24 Apr 2019 05:57:10 -0000 > Victor Sudakov wrote: > > > > I've noticed that it takes too long for Windows 2012 and 2016 servers > > guests to shutdown when I issue "vm stopall," several minutes even. > > > > Does vm-bhyve provide a way to power them off ungracefully if they would > > not stop within a predefined time? > > > > Or is there perhaps a way to tune the guest OSes to react more promptly > > to an ACPI shutdown? > > > > My primary concern is that my UPS and "apcupsd --kill-on-powerfail" give > > me about 30 seconds of grace time before the power supply is cut out. It > > is not sufficient for the bhyve box to shutdown shutdown properly > > because it waits for the guests to shutdown. > > For the present I think I've found a workaround not directly related to > vm-bhyve. I'm going to insert "service vm stop" into the doshutdown() > procedure in /usr/local/etc/apcupsd/apccontrol before the actual > ${SHUTDOWN}. It should give the VMs sufficient time to shutdown before > the actual /sbin/shutdown is executed. Make sure it does not do the waitall for pids or your going to sit here waiting for that to complete for a long time, ie until all vm's go to power off. > > > > If you know of a better way to configure apcupsd so that it powers down > > the UPS only after all the guest OSes and other daemons are safely down, > > I'd appreciate that too. > > Do you think the above hack would have any negative effects? I think this is a reasonable approach given the current situation. > -- > Victor Sudakov, VAS4-RIPE, VAS47-RIPN -- Rod Grimes rgrimes@freebsd.org