From owner-freebsd-virtualization@FreeBSD.ORG Wed Mar 26 15:49:22 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EF5A5A8 for ; Wed, 26 Mar 2014 15:49:22 +0000 (UTC) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFF2BE7D for ; Wed, 26 Mar 2014 15:49:21 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id lc6so2635836vcb.35 for ; Wed, 26 Mar 2014 08:49:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=r1v3ezgmolbLAMHEnzF0A03hNd0e4U2vLltZIJdU/cE=; b=h7riVZc/aCRvD07TY7+X+nXMbZ53saWlcUOR69WC9XTb8c2tzO13SmWYlzNwCmpTzT CBbzc04OtAzg54X1abhLQepwrMg+/K+V5dOqO0lEAX0Pn5necM13t3wgj2mj5PrB1cmn G/J5TqTcOFiE0oAbrHw3yFRIy/cG64yQCmii+iHOdM8jAoP461agHrvhKDgx/nMcyf5o zprDKsnUA+V0S1MMV+ibDjX18EH5xCHRKQPFEy6KLiBMKUCTfhvs12/AWTGKFLk896Ky 3KF8zPs44nBEGrtGJIjWgyYFs4dUC9RkWuKYyO0xs9AxUTgouOC30MaXdavhXyVHScnP tVoQ== X-Gm-Message-State: ALoCoQnvjYWeaaFsW5/bh2Xl5obbVwIvXvRxSQC7urxx9yDIbKJjKEajXqfAy4D3adrmejV47v2q X-Received: by 10.220.159.4 with SMTP id h4mr50213791vcx.1.1395848954769; Wed, 26 Mar 2014 08:49:14 -0700 (PDT) Received: from torb.pix.net (verizon.pix.net. [71.178.232.3]) by mx.google.com with ESMTPSA id dv1sm39010900vdd.21.2014.03.26.08.49.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 08:49:14 -0700 (PDT) Message-ID: <5332F6F8.1030400@pi-coral.com> Date: Wed, 26 Mar 2014 11:49:12 -0400 From: Kurt Lidl User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: freebsd-virtualization@freebsd.org Subject: booting bhyve off zfs - a cautionary tale Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 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: Wed, 26 Mar 2014 15:49:22 -0000 Greetings all - I'm writing to report a solution to a puzzling problem that I've had for a while and just worked out a solution over the last two days. I've been working with the boot-bhyve-from-zfs patch that has been floating around for a while, and had good success with it initially. My configuration is such: the machine that run the hypervisor only has ZFS filesystems. As such, I just create new zvols on that machine, and map those into bhyve as the various vtbdX devices. I have a script that will create the zvols, then carefully partitions the zvol, create a zpool on the zvol, create a few other zfs filesystems on the zpool, and unpack the distribution .txz files into the resulting zpool. This worked well for a while and I could create new virtual machines without issue. And then, after an upgrade of the hosting machine to a more recent stable/10 image, all the new images I created would fail to start properly. The userboot.so support would locate the kernel, and load it, but the mounting of the root partition would fail: --- snip, snip --- ZFS filesystem version: 5 ZFS storage pool version: features support (5000) Timecounters tick every 10.000 msec Timecounter "TSC-low" frequency 1149929960 Hz quality 800 Trying to mount root from zfs:nine5/ROOT/default []... Mounting from zfs:nine5/ROOT/default failed with error 45. Loader variables: vfs.root.mountfrom=zfs:nine5/ROOT/default --- snip, snip --- After far too much time groveling through the boot code, I finally had the realization of what was going on. Since I was creating the new zpool for the client machine under stable/10, and I couldn't boot it under stable/9, there must have been some incompatibility introduced. Anyway, to make a long debugging story shorter, the newest zpool-features (enabled by default) in stable/10 prevent the stable/9 kernel from successfully being about to mountroot() the zpool that created under stable/10. It turns out there is a flag to suppress enabling all the zpool-features when a new zpool is created. So I switched my script to generate the zpool, specifying "zpool create -d ...", and then enabling the features that are OK for stable/9: zpool set feature@async_destroy=enabled ${zroot} zpool set feature@empty_bpobj=enabled ${zroot} zpool set feature@lz4_compress=enabled ${zroot} After these small changes with regards to the creation of the zpool, I can now successfully boot the resulting zpool-on-a-zvol without issue. Hopefully this information will save someone a bunch of time debugging this problem in the future. -Kurt