[vm-bhyve] shutting down VMs and kern.init_shutdown_timeout

Victor Sudakov vas at mpeks.tomsk.su
Mon Apr 29 15:32:53 UTC 2019


Adam wrote:
> 
> > Patrick M. Hausen wrote:
> > >
> > > > Am 28.04.2019 um 06:41 schrieb Victor Sudakov <vas at mpeks.tomsk.su>:
> > > > "if the /etc/rc.shutdown does not terminate within 120 seconds, init
> > will
> > > > terminate it.  The timeout can be configured via the sysctl variable
> > > > kern.init_shutdown_timeout.“
> >
> >
> > > What’s keeping you from increasing that timeout for your
> > > particular requirements?
> >
> > Is that really necessary? Am I correct assuming that any VM is supposed
> > to shut down within 2 minutes or else the bhyve processes will be
> > killed? Or is this kern.init_shutdown_timeout only about the rc.shutdown
> > script itself and not its children?
> >
> 
> FreeBSD is tuned as a general purpose server OS.  If you find the defaults
> don't meet your needs, you can change them.  That's why tunables exist.

Adam, if you know the answer to my direct question above, please answer it.

I also would like to know if there are any adverse effects of increasing
kern.init_shutdown_timeout. 

> > > IMHO 2 minutes are a reasonable
> > > default for a system that does not run hypervisor VMs -
> > > which is probably the vast majority.
> > >
> > > Anyone with the knowledge to implement a virtualized
> > > environment
> >
> > The lack of information about this caveat in
> > https://wiki.freebsd.org/bhyve, man vm-bhyve,
> >
> > https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/virtualization-host-bhyve.html
> > and other sources suggests that this particular knowledge may be
> > limited. Other hypervisors (non-bhyve) probably wait for all VMs to stop.
> >
> 
> RH implemented this relatively recently.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1334982

Good for them. We need to raise awareness too, so I've created this PR
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237646

> 
> > can simply set that to a more suitable value,
> > > can’t he/she?
> >
> > Yes if they know about it. There should be a warning somewhere in the
> > documentation if we want to be serious about FreeBSD as a hypervisor.
> >
> > Or better still, a warning that rcshutdown_timeout (if set) and
> > kern.init_shutdown_timeout can be too low when running vm-bhyve and
> > such is desirable.
> >
> 
> Why don't you simply write a wrapper script which calls shutdown after
> shutting down guests?  

A lot of things can be done to mitigate this problem, as soon as you are
aware of it.

> I doubt many admins on any hypervisor are
> gratuitously calling shutdown on host with important guests running.

Well, after I started noticing "WARNING: / was not properly dismounted"
in my guest OS's logs, after the perfectly correct shutdown of the host,
I stopped calling shutdown on host, and started thinking why this was
happening. But not before. 


-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49 at fidonet http://vas.tomsk.ru/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20190429/8b7f11dc/attachment.sig>


More information about the freebsd-virtualization mailing list