From owner-freebsd-virtualization@FreeBSD.ORG Sun Nov 3 13:15:58 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ABCC72C8 for ; Sun, 3 Nov 2013 13:15:58 +0000 (UTC) (envelope-from freebsd@grem.de) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id EF6832E22 for ; Sun, 3 Nov 2013 13:15:57 +0000 (UTC) Received: (qmail 49435 invoked by uid 89); 3 Nov 2013 13:15:55 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@88.217.181.54) by mail.grem.de with ESMTPA; 3 Nov 2013 13:15:55 -0000 Date: Sun, 3 Nov 2013 14:15:58 +0100 From: Michael Gmelin To: Michael Dexter Subject: Re: rc-style script for bhyve VM provisioning and management Message-ID: <20131103141558.379dffa4@bsd64.grem.de> In-Reply-To: <5275F8B1.105@callfortesting.org> References: <5275F8B1.105@callfortesting.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.18; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 03 Nov 2013 13:15:58 -0000 On Sun, 03 Nov 2013 00:18:09 -0700 Michael Dexter wrote: > > Hello all from the FreeBSD 20th Anniversary Party in San Francisco, > > I have published a bhyve virtual machine provisioning and management > framework to simplify the building and deploying of bhyve VMs during > the run-up to the FreeBSD 10.0 release. As you may know, bhyve is > rapidly finalizing for release in FreeBSD 10.0 and most features are > finally becoming stable enough to document in a canonical manner. > These scripts demonstrate the many opportunities for customization of > bhyve deployments and will embrace features like OpenBSD and Linux > support as soon as key components like the userland grub* arrive > (currently in final testing). It will also demonstrate the use of pf > to allow bhyve networking on wireless interfaces. > > It can be downloaded from: > > http://bhyve.org/bhyve-script.tar > > It works like a rc script but does not comply with the FreeBSD way. I > am working with several developers to determine to what degree it > should be compatible with existing frameworks like ezjail. > > ./vm0 will give the usage: > > usage (start|stop|load|boot|destroy|restart|list|debug > mount|umount|jail|format|fetch|install|provision|wipe) > > Some routines like "provision" include steps like fetch (distribution > sets), format (disk images or volumes) and install them. > > The "jail" routine demonstrates how a virtual machine can be launched > using the jail(8) command, because we can, given that bhyve FreeBSD > VMs are simply instances of FreeBSD with the ABI limitations of > different releases. bhyve will support any vision of FreeBSD with > VirtIO, specifically FreeBSD 8.4 and 8-STABLE, 9.2 and 9-STABLE, and > any recent version of 10 or 11. > > Detailed instructions are included in the vm0 script and it is > designed to simply be copied to vm1, vm2 etc. with easily-configured > global variables. > > While tmux(1) is optional and supports both captive and detached > execution, a script is included to list and attach to running > VMs/sessions. A script is also provided for the easy duplication of > VMs and I have tested this with up to 15 X 16 vCPU instances though > far more should work without issue. > > Please throw everything you can at bhyve to expose any remaining flaws > prior to the FreeBSD 10.0 release. > > All the best, > > Michael Dexter Sounds similar to how I ran my VMs for a while (well, I ln -s from the original VM script instead of copying, so it's easier to update all at once). I finally changed the script to use profiles a few days ago, since it seemed much cleaner in general and better for automatic control and also complies to the FreeBSD way. I submitted a PR for sysutils/bhyve-rc literally hours before you released vm0 (http://www.freebsd.org/cgi/query-pr.cgi?pr=183604), great timing ;) It's only good for one use case, but does that very well. I like the idea of the script using the general structure of ezjail. I would also suggest to split this it two scripts, one rc script, that only provides non-destructive operations like (start|stop|restart|rcvar) and one called vm-admin which provides the provisions functions on top, e.g. service vm start vm0 # ok vm-admin start vm0 # ok service vm format vm0 ... # not ok vm-admin format vm0 ... # ok -- Michael Gmelin