bhyve VirtFS vs ZVOL for Virtual Machines

martinrame

Member

Reaction score: 10
Messages: 69

Hi, I usually deploy systems using FreeBSD or FreeNAS containing one or more Bhyve (Ubuntu) VMs that shares a PostgreSql db running inside a Jail and a directory containing an ever growing number of files (medical images), that directory is stored in a ZFS dataset and shared through NFS.

I mount the images dataset via NFS because the other way is creating a big ZVOL and mounting it on one VM, but this has many disadvantages, for example having to create a huge file (the zvol) in advance, cannot easily access its files from the host, and some more.

I've been reading about VirtFS and wonder if it would allow accessing files from the host faster than using NFS. Am I right?, is it production ready?, any documentation about implementing it?.
 

bakul

Member

Reaction score: 30
Messages: 65

This is what I use:
  • To the bhyve command line I add -s 8,virtio-9p,sharename=<directory you want to share>.
  • In the ubuntu vm you can check its module is loaded with lsmod | grep 9p.
  • You can mount it as mount -t 9p -o trans=virtio,version=9p2000.L,rw sharename /mnt
It seems fast enough for my use though I have not done any performance testing or pushed it very hard.
 

bakul

Member

Reaction score: 30
Messages: 65

Seems to work fine for me but you should do your own stress testing!
 
Top