[vm-bhyve] Windows 2012 and 2016 servers guests would not stop

Rodney W. Grimes freebsd-rwg at gndrsh.dnsmgr.net
Sun Apr 21 14:32:36 UTC 2019


-- Start of PGP signed section.
> Jason Tubnor wrote:
> > On Sun., 21 Apr. 2019, 2:51 pm Victor Sudakov, <vas at 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 at freebsd.org


More information about the freebsd-virtualization mailing list