From owner-freebsd-virtualization@freebsd.org Tue Feb 12 01:46:48 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 C482F14EDF64 for ; Tue, 12 Feb 2019 01:46:48 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) Received: from admin.sibptus.ru (admin.sibptus.ru [IPv6:2001:19f0:5001:21dc::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3383195B4B for ; Tue, 12 Feb 2019 01:46:48 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=LYg1waesA/DqhwApgOTcTdBYdf+XkMJcYVewAYaMpVQ=; b=SjjKmoyu52ee+fSZSCk0qU7uGA uGEbPdJwOjeWI8rLjhAUySwfOuTQP6sTPNQwHaahPnuLeKsXb9WO7pIdKjjjg+8aDVsM629OhuUAw g9Tl7wq1F5kkTMvhwEEKfudipDBBZwwB06JORQ/1hPoayCPULk39YFcQb5jzMqV1JnkU=; Received: from vas by admin.sibptus.ru with local (Exim 4.91 (FreeBSD)) (envelope-from ) id 1gtN9r-0004r9-Ci for freebsd-virtualization@freebsd.org; Tue, 12 Feb 2019 08:46:47 +0700 Date: Tue, 12 Feb 2019 08:46:47 +0700 From: Victor Sudakov To: freebsd-virtualization@freebsd.org Subject: Re: mounting/exporting/importing a zfs volume Message-ID: <20190212014647.GB16801@admin.sibptus.ru> References: <20190211170312.GA76683@admin.sibptus.ru> <4465134c-ae48-d39b-dd87-9514da577cc2@fjl.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WYTEVAkct0FjGQmd" Content-Disposition: inline In-Reply-To: <4465134c-ae48-d39b-dd87-9514da577cc2@fjl.co.uk> X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Victor Sudakov 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: Tue, 12 Feb 2019 01:46:49 -0000 --WYTEVAkct0FjGQmd Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Frank Leonhardt wrote: > > > > vm-bhyve keeps virtual machines on zfs volumes with volmode=3Ddev. How = can > > I access/mount the filesystems within the volume when the virtual host > > is offline? > > > > If I kept virtual disks in raw files, I could access them as devices > > with mdconfig. But: > > > > root@newserv:~ # mdconfig -a -f /dev/zvol/zroot/vm/mail/disk0 > > mdconfig: /dev/zvol/zroot/vm/mail/disk0 is not a regular file > > root@newserv:~ # > > > > Also, how can I exchange those zfs volumes for use with other > > hypervisors? They are not real raw disk files so I cannot use > > sysutils/vmdktool etc. > > > I don't know this, but I'll guess(!) >=20 > If you've set volmode to dev then you get a cdev device in devfs, and=20 > you'll never get it to mount. Try using geom instead (which IIRC is the= =20 > default). The default in vm-bhyve is volmode=3Ddev, and I think this is reasonable. Do you know if I can clone an existing volmode=3Ddev volume into a volmode=3Dgeom volume and then work with the clone? >=20 > HOWEVER, I suspect you're doing this because you're hoping that a ZFS=20 > volume is faster than a file.=A0 Well, not actually. > I went through this, in the hope it wouldn't do CoW and would > therefore be a lot better for databases. I was disappointed! > Bascially, it's no better than a ZFS file. If that was your plan, use > a UFS partition.=20 A UFS partition? Where? > I don't use ZFS volumes any more; I=20 > think they're more useful on Solaris. A md mapped on to a ZFS file seems= =20 > to be the BSD way, and for VMs just use a file in its own dataset. You=20 > can then clone the dataset. Just what you need for nearly identical VMs. I've preferred disk0_dev=3D"zvol" VMs for aesthetical reasons since vm-bhyve started supporting them. Those file-based VMs get in the way while backing up $vm_dir, and their disks are not visible in=20 "zfs list -t volume" --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --WYTEVAkct0FjGQmd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcYiWHAAoJEA2k8lmbXsY0NRwH/3GMZxAI0q2lxZAbJsfyJdGW ibyAy7oxDNfqlGnf/rdrAsjbLuLayPgTFZmjC1hVM41MFALUhIvJ4Mmsx7vWH0gU Kx7zkUvI5o6O7nmhjrARNrByBP36MbOqbcLb6AxPRSjHc+Dn1I3saW5avmnw1til /KqO7LzaZUFpn/KDEu9nPZ2Lvy9BV2M2VD7zHq8sMWFdiVe+CpnGXEgUP+LTerkV mscBQBLBmYadKdvrW+urbNl0ifYFLMztEbe4aK5rouhj+iKZvXrpJm92f/DdE9qX aYQ6XTqcHz4fn7hOaBQb3sE487qks52hXt7BMyH/g0SQUnBWrg2chLwAv5dxA0E= =JcbD -----END PGP SIGNATURE----- --WYTEVAkct0FjGQmd--