Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Apr 2019 07:32:33 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        Victor Sudakov <vas@mpeks.tomsk.su>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop
Message-ID:  <201904211432.x3LEWXqF027753@gndrsh.dnsmgr.net>
In-Reply-To: <20190421071741.GA51438@admin.sibptus.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
-- Start of PGP signed section.
> Jason Tubnor wrote:
> > On Sun., 21 Apr. 2019, 2:51 pm Victor Sudakov, <vas@mpeks.tomsk.su> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904211432.x3LEWXqF027753>