ZFS Filesystem passthrough to VM on scale? (specifically for nextcloud)

Wolfspyre

Cadet
Joined
Jun 17, 2021
Messages
8
Hi there Errebody!

I'm POTENTIALLY asking a DumbQuestion(tm)....
but ¯\_(ツ)_/¯
:)

I wanted to set up my nextcloud rig as a VM on my truenas scale rig.

I used the https://www.hanssonit.se/nextcloud-vm/ nextcloud vm previously, and it was quite well put together.

their pattern uses zfs for the nextcloud dataset.

What's the best way to facilitate that easily? is there a good way to pass a zfs filesystem to a VM?

Should I use a passthrough file as a block device?

CURRENTLY, I'm hosing the vm setup and using lvm for the dataset; but I really don't like this pattern too much... feels icky.

anyone have suggestions/ideas?

Appreciate your $.02
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
It's not a dumb question.
The typical way of getting access to a file system from a VM is NFS or SMB.. you can do that today.
There is a possibility of a more direct method via Virtfs..... that's a potential future.
 

Wolfspyre

Cadet
Joined
Jun 17, 2021
Messages
8
hm. I think you misunderstand the question. (or maybe I'm just asking it the wrong way?)


the nextcloudVM uses ZOL and creates a zfs filesystem to store the userdata.

it feels a little turtles-all-the-way-down to have a zfs filesystem (which gets shared to a vm as a block device (which the VM sees, and uses as a vdev for its own pool ( the vm creates a zfs filesystem )))

this feels a little wonky to me?

I also wonder about recovery if things go pear shaped.

so what I was wondering was essentially is there a not horrible way to present a faux pool to a VM, or to present a zfs filesystem blockdev to a VM that's natively recognized as a zfs device without TNScale:zfs(vm(zfs(data)))
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Well, if you want to do it that way, that's more or less the price you pay. There are good or even great reasons to want to use ZFS to store critical data, and most VM environments can be at least a little dodgy at times.

Is there some reason you don't use the Nextcloud stuff provided as a SCALE app?

Basically, you need to find some way to deal with the fact that TrueNAS is *going* to provide the ZFS, so you have options of running it on Scale, running your preferred VM but hacking it to mount via SMB or something like that, just continuing to run your setup as a VM on a full hypervisor, use your preferred VM running it with a single-virtual-disk vdev on top of Scale, etc.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
it feels a little turtles-all-the-way-down to have a zfs filesystem (which gets shared to a vm as a block device (which the VM sees, and uses as a vdev for its own pool ( the vm creates a zfs filesystem )))
You could run TrueNAS CORE and install Nextcloud in a jail and have a native ZFS dataset mounted transparently into the jail without any overhead and "wonkyness" :wink:
There's a reason why FreeBSD and jails still exist and why some (e.g. us) even run them at large scale to provide hosting services.
You will have to run Collabora or OnlyOffice in a separate Linux VM for the time being but these two applications are in the Nextcloud context stateless and don't need any external storage. The Nextcloud application and more or less all other "Apps" run perfectly fine in FreeBSD and we do run a couple of those for customers professionally.
 

Wolfspyre

Cadet
Joined
Jun 17, 2021
Messages
8
Is there some reason you don't use the Nextcloud stuff provided as a SCALE app?
TOTALLY.

k8s* is... well... simply not the right tool for everything. it introduces a nontrivial amount of complexity with the upside of resource density.

Don't get me wrong. There is ABSOLUTELY a place for kube. I'm not knocking it.... AND
The nextcloud offering inside k3s was... uh.... not usable at the time I tried it....
I know it's supposed to be getting better soon(tm)

I'd planned on re-evaluating once multi-node apps are a thing that work; seeing if there's enough value TO ME yet to introduce the complexity.

(I'm not trying to disregard the hard work of the team. I get how hard it is to make a cohesive offering.)

in the meantime, I was looking for 'what IS the least crufty way to do this'? ;)

every choice has a downside.... just trying to pick the least unpleasant amalgam of side-effects.


*(k3s in this case if we're being pedantic)
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
k8s* is... well... simply not the right tool for everything.

That's not a particularly good reason. I feel the same way about all of the crufty middleware webware that I see as mostly bloat on top of a nice OS, but I can understand why the developers used available products to design their UI. If it works, it's hard to argue with it.

nextcloud offering inside k3s was... uh.... not usable

But that's a good reason. Just wanted to make sure I understood the context here. I don't generally run anything inside either FreeNAS's jails or SCALE's containers, so I haven't run into your issues. The container stuff does have going for it that it is SUPPOSED to work, and there's even some sort of partnership between iX and Nextcloud. But I know how these things go, and if it's a hot mess, well, then, that's a perfectly fine answer.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
For now, Nextcloud (plugin or Jail) on TrueNAS CORE is recommended. There has been collaboration and testing on the plugin.

The next step forward for SCALE will be SCALE 22.02-RC2 with TrueCharts NextCloud... it will still need testing, but its on the path to the February release quality.

The SCALE VM is possible, but it will be iSCSI or NFS attached. Should be reliable, but less performant.
 
Top