I know this isn’t the best idea but I have a situation with a hyper v host that I can’t really change but the client would like nas functionality. I would like to use zfs for redundancy and snapshots (have a vhdx file on each disk) but want to know how bad of an idea it is to run Truenas in a vm.
I used to run TrueNAS in KVM and it ran great. I don’t know anything about hyper-v, so can’t comment on that aspect. You’ll want to make sure you can give ZFS direct access to the storage disks.
I’d spin up a test if you can and make sure everything works like you expect.
It’s far from ideal, but as long as you’re either not relying on zfs automatic repair, or have given ZFS redundant vdevs that reside on separate physical devices, it’s doable.
You will not get the same degree of protection and reliability you would from ZFS on the bare metal, but you’ll still be in better shape than you would be with no ZFS checksum and repair ability whatsoever.
I don’t see any problems with this.
Hyper-V is faster than KVM I think, or it used to be.
So you’re stuck with Hyper-V so there are really no options.
ZFS will run in a VM just fine.
Sure ZFS is better than NTFS for underlying storage but we don’t really have that option if the client wants NAS in a Hyper-V VM.
Another option is to run a Windows share and not even use TrueNAS. All you get from TrueNAS is a SAMBA anyway since your client won’t use NFS because it seems like he uses Windows.
TrueNAS is good for handling real Disks and all that but the OS itself wouldn’t bring much in your case. You would have a UI to enable a SMB share and you can do that on Windows and don’t even need Hyper-V.
If you do run TrueNAS in a VM will you be backing up the VM?
You could still do snapshots in case you delete something in the NAS but you can do snapshots in Hyper-V too although not so automatic.
If you do plan to do zfs send from TrueNAS then it could be useful to send datasets offsite for backup but then again you can backup the Hyper-V VM.
I say you try it and see how it goes and when you realize it’s not worth it delete it and make a Windows share. Does the Windows server have Disk redundancy?
How much storage are you looking to share using the TrueNAS VM?
Am I correct that you are being “forced” to run a NAS from a VM or is it possible to have it run bare metal on separate hardware? As others have said you can certainly make this work, but you are giving up performance and much of the benefits of ZFS running it this way.
It may just be me, but I have always been uneasy with using a VM on any hypervisor to provide NAS functionality, except for testing or in very small storage requirements. Perhaps it’s just my old school training that compute and storage are always separate unless you have a damn good reason/justification, and the storage then mapped or mounted in the VM’s that needed it? This seemed to make backups and replication of the VM’s and the storage easier and quicker with them being separate.