Shared data disk for several VMs

fabienfs

Member
Jun 6, 2021
25
2
8
33
Hello,

I did a ZFS raid to use as data disk for all of my VMs.

I would also like to make a data disk that would also be used (shared) on several VMs (with the possibility of also accessing this disk remotely in SMB)

Do I have to assign this disk to a VM that would act as a server for the others? Or should I use a solution like FreeNAS or other?

Thanks

Best regards,
Fabien
 
Hi,

Do I have to assign this disk to a VM that would act as a server for the others? Or should I use a solution like FreeNAS or other?
For a simple use case, I would say it's easiest to assign a disk to one of your existing VMs and use that VM as the smb server (granted it will generally be running). Alternatively, you could set up a dedicated VM for hosting the share (like a minimal Debian install). Unless you have a specific idea in mind and have done your reading, I wouldn't recommend virtualising something like FreeNAS/TrueNAS, as it seems to be more intended as a bare-metal installation, with direct access to storage hardware.
 
Another option would be to create a LXC to work as your SMB/NFS server. The advantage is that you can bind-mount the mountpoint of a ZFS dataset directly into the LXC so the LXC can share that dataset. That way you can share the hosts storage using SMB/NFS without additional virtualization overhead because you don't need any virtual disks and you are not limited to a fixed storage size because datasets and not zvols are used.

But stuff like a OpenMediaVault VM would be more beginner friendly because you would get a nice WebGUI to manage your shares.
 
Last edited:
  • Like
Reactions: dylanw