From owner-freebsd-virtualization@freebsd.org Sat Apr 28 11:28:24 2018 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 C0DB6FABB5F for ; Sat, 28 Apr 2018 11:28:24 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.116.210]) (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 5279369C57 for ; Sat, 28 Apr 2018 11:28:24 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from imac.bk.cs.huji.ac.il ([132.65.179.42]) by kabab.cs.huji.ac.il with esmtp id 1fCO1e-000OTX-BQ; Sat, 28 Apr 2018 14:28:22 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: Read-only view of a ZFS filesystem inside a bhyve guest? From: Daniel Braniss In-Reply-To: Date: Sat, 28 Apr 2018 14:28:22 +0300 Cc: freebsd-virtualization@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180427174341.03373bc8@almond.int.arc7.info> <20180428113748.72891422@almond.int.arc7.info> To: Mark Raynsford X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.25 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: Sat, 28 Apr 2018 11:28:24 -0000 > On 28 Apr 2018, at 14:26, Daniel Braniss wrote: >=20 >=20 >=20 >> On 28 Apr 2018, at 13:37, Mark Raynsford = wrote: >>=20 >> On 2018-04-28T09:08:42 +0300 >> Daniel Braniss wrote: >>=20 >>> since the clients and the server are sharing the zfs volume, >>> I=E2=80=99m doing the following: >>> on the server I did: >>> zfs create -sV 4G h/root.ro >>> newfs /dev/zvol/h/root.ro >>> mount /dev/zol/h/root.ro /mnt >>> copy a working root image to it. >>> umount /mnt >>> the clients then mount it as ro, >>> the vm conflg file has: >>> disk0_type=3Dvirtio-blk=E2=80=9D >>> disk0_name=3D=E2=80=9C/dev/zvol/h/root.ro = =E2=80=9D >>> disk0_dev=3D=E2=80=9Ccustom=E2=80=9D >>>=20 >>> one solution to the fact that the root is read-only is to use = unionfs (probably nullfs will do too) >>>=20 >>> the only problem I have is updating the image. >>=20 >> Wow, didn't know this was possible. Is this safe? Two essentially >> independent operating system instances being able to write to the = same >> zvol? >=20 > that=E2=80=99s why it=E2=80=99s mounted rear-only in the client! grr, hate spell checkers, s/rear/read/ :-) > each client can get another vol for writing, ie /var > if you want to have =E2=80=98permanent=E2=80=99 changes that will = survive reboots. >=20 > updating on the server is possible, but > 1- the changes might not be seen by the client > 2- opened files will have issues >=20 > btw, point 2 is also true for NFS. >=20 > danny >=20 >>=20 >> --=20 >> Mark Raynsford | http://www.io7m.com >>=20 >=20