From owner-freebsd-virtualization@freebsd.org Mon Mar 11 18:03:02 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 C1F5515282F8 for ; Mon, 11 Mar 2019 18:03:02 +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 0C41572CDB for ; Mon, 11 Mar 2019 18:03:01 +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 x2BI30u0010733; Mon, 11 Mar 2019 11:03:00 -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 x2BI2xTK010732; Mon, 11 Mar 2019 11:02:59 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201903111802.x2BI2xTK010732@ gndrsh.dnsmgr.net> Subject: Re: bhyve: Detecting that a guest kernel has booted In-Reply-To: <20190311174635.63a071e2@almond.int.arc7.info> To: Mark Raynsford Date: Mon, 11 Mar 2019 11:02:59 -0700 (PDT) CC: Shawn Webb , 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: 0C41572CDB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; TAGGED_RCPT(0.00)[org.freebsd.virtualization]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.995,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: Mon, 11 Mar 2019 18:03:02 -0000 > On 2019-03-11T13:27:23 -0400 > Shawn Webb wrote: > > > > Both FreeBSD and Linux supports virtio_console(4). I have no idea > > about OpenBSD, but I'm sure they'd be open to an implementation if > > asked. > > Right. > > > > > The NFS solution would work, but it would be somewhat fragile. What > > happens when a VM crashes? What happens when the host crashes? > > At least in my case: > > If the VM crashes, it'll be restarted by a process supervisor (runit, > here). I think ping would suffice to make that determination? > If the host crashes, I likely have bigger problems. In any case, I > think that's still fine because all the host would care about is if the > guest's file was touched more recently than the last time the host > tried to start a bhyve process for it. You could inside the vm simply touch /tmp/foo from cron and from the host see that the diskimage last modified time updated. Assuming some cacheing does not get in the way. > I suppose I should elaborate a bit: I do have monitoring via Prometheus > in place, but I'd like to try to stagger VM startups a little as > starting up a lot of them in parallel on boot tends to overwhelm the > machine slightly. Once they're all up and running in a steady state, > things are fine. I would typically stagger the startup of > ordinary services (inside a jail, for example) by using dependencies in > runit - it has a facility to pause a service until a dependent service > has been started. Unfortunately, that can't work in this case because > once the bhyve process has been started, the host can't tell if/when > the guest has actually fully started up. As far as runit is concerned, > the service is up and so any dependent services should be started too. The package vmbhyve has starggered startup in a specific ordered list implemented. It is all writtin in /bin/sh, so easy to adapt. > Mark Raynsford | http://www.io7m.com -- Rod Grimes rgrimes@freebsd.org