Re: mounting/exporting/importing a zfs volume

2019-02-11 Thread Paul Vixie




Victor Sudakov wrote on 2019-02-11 17:46:
...

I've preferred disk0_dev="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
"zfs list -t volume"


+1.

--
P Vixie

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: mounting/exporting/importing a zfs volume

2019-02-11 Thread Victor Sudakov
Frank Leonhardt wrote:
> >
> > vm-bhyve keeps virtual machines on zfs volumes with volmode=dev. 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(!)
> 
> If you've set volmode to dev then you get a cdev device in devfs, and 
> you'll never get it to mount. Try using geom instead (which IIRC is the 
> default).

The default in vm-bhyve is volmode=dev, and I think this is reasonable.
Do you know if I can clone an existing volmode=dev volume into a
volmode=geom volume and then work with the clone?

> 
> HOWEVER, I suspect you're doing this because you're hoping that a ZFS 
> volume is faster than a file. 

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. 

A UFS partition? Where?

> I don't use ZFS volumes any more; I 
> think they're more useful on Solaris. A md mapped on to a ZFS file seems 
> to be the BSD way, and for VMs just use a file in its own dataset. You 
> can then clone the dataset. Just what you need for nearly identical VMs.

I've preferred disk0_dev="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 
"zfs list -t volume"

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: mounting/exporting/importing a zfs volume

2019-02-11 Thread Victor Sudakov
Paul Webster wrote:
> mdconfig -a -t vnode -f  afaik

Sorry, this does not work. 

root@newserv:~ # mdconfig -a -t vnode /dev/zvol/zroot/vm/mail/disk0
mdconfig: /dev/zvol/zroot/vm/mail/disk0 is not a regular file

There must be some other way.

> once they are mounted you could dd them 

Indeed, I can dd the volume to a regular file:

dd if=/dev/zvol/zroot/vm/mail/disk0 of=/var/tmp/rawimage bs=1m conv=sparse

and then work with the /var/tmp/rawimage (I can mdconfig it) but it's a waste
of disk space.


-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: mounting/exporting/importing a zfs volume

2019-02-11 Thread Paul Webster via freebsd-virtualization
mdconfig -a -t vnode -f  afaik

once they are mounted you could dd them over to the zvols and then resize
them from within the vm

On Mon, 11 Feb 2019 at 17:04, Victor Sudakov  wrote:

> Dear Colleagues,
>
> vm-bhyve keeps virtual machines on zfs volumes with volmode=dev. 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.
>
> --
> Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
> 2:5005/49@fidonet http://vas.tomsk.ru/
>
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"