I am new to virtualization and zfs. Could someone re-write 23.6.2. Creating a FreeBSD Guest to use zfs instead of ufs? Create a file to use as the virtual disk for the guest machine. Specify the size and name of the virtual disk: # truncate -s 16G guest.img I read 23.6.6. Using ZFS with bhyve Guests If ZFS is available on the host machine, using ZFS volumes instead of disk image files can provide significant performance benefits for the guest VMs. A ZFS volume can be created by: # zfs create -V16G -o volmode=dev zroot/linuxdisk0 When starting the VM, specify the ZFS volume as the disk drive: # bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s3:0,virtio -blk,/dev/zvol/zroot/linuxdisk0 \ -l com1,stdio -c 4 -m 1024M linuxguest but can't correlate it. I believe the vm man page states that using a zfs volume through a /dev point should be avoided. What is best practice for a mere workstation using root-on-zfs? It looks like these two sections were written by different people. I know much has changed over the last two years.
(In reply to Steven Friedrich from comment #0) Hi Steven, do you happen to remember where you read the recommendation on avoiding zvol device nodes? I'm aware it's a bit of a controversial topic, and I too have sometimes seen better performance with file backed storage instead of zvols. We could add a remark that using file backed storage works on zfs just like on ufs? For reference, there was a discussion on the forums a while back: https://forums.freebsd.org/threads/how-to-set-up-storage-for-a-bhyve-hypervisor-zfs-or-ufs-for-host-guest.93383/ Appreciate your feedback - even if it's been a while... thanks cm
There’s an article from Klara comparing the performance: https://klarasystems.com/articles/virtualization-showdown-freebsd-bhyve-linux-kvm/ Specifically the section “Finding the most performant storage configuration on bhyve”
(In reply to Pat Maddox from comment #2) Well, that settles that then, I guess. We should probably rewrite the advice to use file backed storage on datasets instead of zvols. I'll put that on my todo list. Unless someone beats me to it, I'll look into setting up a review.