How best to store a media library in proxmox?
from Matty_r@programming.dev to selfhosted@lemmy.world on 23 Mar 08:46
https://programming.dev/post/27392108

Hey all, I’ve got ZFS pool created and just create a VM drive in that pool like normal, then Jellyfin just has that drive mounted. I think I’m losing the best parts of ZFS through this manner.

How should I set this up properly? Create a media pool or something and have VMs accessing the pool directly?

#selfhosted

threaded - newest

Xanza@lemm.ee on 23 Mar 08:53 next collapse

So if you’re going through the trouble of setting up proxmox, I would setup the majority of the storage in a ZFS pool for a TrueNAS SMB share/NFS share. Then create a small container just to host jellyfin and jellyfin’s cache–maybe commit 10GB of storage to it–really depends on how big your media library is. Mine is about 5TB and cache, metadata, and other misc things take up about 8GB.

Setting up your share is enough for jellyfin. Since the media and jellyfin are stored on the same metal, additional latency will be sub 100ms. Create a library in Jellyfin and set it to the share; Movies: \\nas\Movies, TV: \\nas\TV, etc.

Works flawlessly and would have more utility than allocating the entirety of your storage to your jellyfin container because it functions as a normal NAS. I’ve been running with a setup like this for a while and it works great.

Matty_r@programming.dev on 23 Mar 11:39 next collapse

Are you suggesting creating a TrueNAS VM? Wouldn’t that be the same as what I’m doing now with creating an image in the ZFS pool?

suicidaleggroll@lemm.ee on 23 Mar 14:07 next collapse

I would separate the media and the Jellyfin image into different pools. Media would be a normal ZFS pool full of media files that gets mounted into any VM that needs it, like Jellyfin, sonarr, radarr, qbittorrent, etc. (preferably read-only mounted in Jellyfin if you’re going to expose Jellyfin to the internet).

pwet@lemmynsfw.com on 23 Mar 22:00 next collapse

Truenas is completely unnecessary, it just brings overhead and complexity. You are good with your setup.

Oisteink@feddit.nl on 24 Mar 00:14 next collapse

If you want to share storage you need some way of doing that. Zfs is a good option for storage on vm-host level, but ist not designed for shared usage. Im not sure what you are after, but maybe you want zfs storage inside the vm for snapshots, dedup etc? Or maybe you want to share your media storage between vm’s? The first case you can use zfs inside your vm, it does not know or care about how its disks are stored or of they are a physical drive. For the second use-case you want some way to share drives, like smb, nfs etc. or a distributed filesystem if you really want to over complicate things. Truenas might be over overkill for sharing a few volumes, but you need something. I believe you can share zfs over nfs now but i have never used that outside of proxmox cluster storage

I use both debian on a vm with samba+nfs and a bare metal truenas for my needs. Find your needs and figure out what solves them

Xanza@lemm.ee on 24 Mar 01:16 collapse

You’d create a ZFS pool for your shares, then a TrueNAS VM which serves your ZFS pool as NAS. Then setup your Jellyfin VM using your NAS as storage for your libraries. Ends up looking like this: x0.at/Gbqm.png

Your media is accessible via the network from any device because they’re SMB shares, and it works just fine in Jellyfin. If you only create a ZFS pool for Jellyfin, your media can then only be accessed through Jellyfin. It limits your future options.

non_burglar@lemmy.world on 23 Mar 13:11 next collapse

Why bother with truenas? Just put the media in a zfs pool and mount it directly into jellyfin.

Oisteink@feddit.nl on 23 Mar 23:58 next collapse

So you mount the pool to each vm that needs the shared data? Afaik zfs is not made for concurrency

non_burglar@lemmy.world on 24 Mar 13:53 collapse

Zfs (and most modern filesystems) are fine with concurrency.

I mount the same data store into several instances, it works well. Just needs some planning for permissions.

Oisteink@feddit.nl on 24 Mar 14:15 collapse

Could you explain further with a bit more detail? I havnt looked at this in a while but back then the options where virtiofs or nfs

non_burglar@lemmy.world on 24 Mar 14:17 collapse

Each cgroup container mounts a host path. That’s it.

Oisteink@feddit.nl on 24 Mar 14:39 collapse

So lxc containers and not vm’s

non_burglar@lemmy.world on 24 Mar 14:50 collapse

Yes, Lxc, docker, whatever cgroup2 isolation environment, but not VMS, true.

Vms can achieve the same thing through shares

Oisteink@feddit.nl on 24 Mar 16:16 collapse

Thanks. My setup is way over complicated with 3 hosts in a cluster and shared storage, so local storage on the hosts stay unused. But i have been thinking about redoing it with separate hosts. This solution looks promising for sharing data, even if just on one host

Xanza@lemm.ee on 24 Mar 01:10 next collapse

You can do a share any number of ways. I simply banked on the fact that anyone willing to ask the question likely doesn’t know how to setup SMB shares without a GUI like TrueNAS.

non_burglar@lemmy.world on 24 Mar 13:47 collapse

Yes, not course. I forgot about the gui, that’s valid.

Xanza@lemm.ee on 24 Mar 01:40 collapse

Sure, you can also do this. But why not make it available to your network in addition to Jellyfin? What if you have a TV that doesn’t have access to the Jellyfin app? If it’s a private ZFS pool not on the network you’re fucked. If you share the media via a network share, you can always do any number of things to stream that media to your TV.

It gives you a ton more options up to and including just watching the media on your PC in your favorite media browser.

non_burglar@lemmy.world on 24 Mar 13:46 collapse

If it’s a private ZFS pool not on the network you’re fucked.

Sorry, i didn’t word that correctly. I understand why you might need a share, I just think a whole truenas instance just for a few shares is way overkill. If I needed a samba share, NFS export, or an iscsi lun i would just spin up a Debian container and be done with it.

MangoPenguin@lemmy.blahaj.zone on 23 Mar 19:12 next collapse

That seems very complex with a lot of overhead vs just mounting a ZFS pool into the container where jellyfin is running.

Xanza@lemm.ee on 24 Mar 01:08 collapse

It’s frankly exactly as complicated as his postulated setup, only provides more flexibility. It’s the best outcome.

minoche@lemmy.world on 23 Mar 21:04 collapse

Setting up an SMB or NFS share is the correct answer because op has stated he plans to use VMs (plural). ZFS is not sharable without it. pve.proxmox.com/wiki/Storage

There are forum posts going back years about it :…proxmox.com/…/share-zfs-storage-between-nodes.14… …proxmox.com/…/create-a-large-pool-of-shared-zfs-…

TrueNAS is not absolutely required. It can be done with a different Linux distro. I use/prefer Debian.

Xanza@lemm.ee on 24 Mar 01:38 collapse

TrueNAS is not absolutely required.

It just seems to be the favorite. Anything would work. OMV, EasyNAS, OpenFiler, Rockstor, even just base *nix with the appropriate packages and config.

ikidd@lemmy.world on 23 Mar 16:43 next collapse

You’re doing it fine. You can overprovision your zpool that way for other VMs with datasets on the pool, and it only uses what it needs for each set. And you can exclude the media pool from backups and repllications if you like. There’s no performance hit the way you’r doing it.

I sure wouldn’t bother with any sort of NAS intermediary, you can share out the media pool via the Jellyfin VM if you really need to, but I can’t see why you would if you’re using Arr stack components already.

Matty_r@programming.dev on 23 Mar 22:09 collapse

OK, sweet thanks. I just thought having the media files directly in the ZFS pool (zfs pool > files) instead of ZFS Pool > Qemu img > Files would be smarter

ikidd@lemmy.world on 23 Mar 23:22 collapse

Then you’d have to share them back from the host to the guest using NFS or samba, and there’s no reason to have them on the host. No, you’re fine. That’s what I would consider the right way to do it for what you describe as your purpose. Putting more layers in there isn’t serving a useful purpose, which is why I say to not bother with a NAS to store them, if your primary use of them is via the Arr stack VM.

possiblylinux127@lemmy.zip on 23 Mar 23:49 next collapse

Either create a virtual disk in Proxmox or get a dedicated SATA/SAS card and pass it though to either a NAS OS or Jellyfin.

Jakeroxs@sh.itjust.works on 24 Mar 14:57 next collapse

I went with ZFS but had some issue where it would randomly disconnect completely and lock up the whole server until I rebooted. Probably something with the nvme I was using but I went back to ext4 and that resolved it.

Anyway my media drives are an lvmthin pool and just mounted to my LXC running jellyfin and such.

MangoPenguin@lemmy.blahaj.zone on 24 Mar 14:59 next collapse

That works fine.

The other option is run a container instead of a VM and just pass-through a ZFS filesystem directly.

Matty_r@programming.dev on 24 Mar 19:22 collapse

That might be a better option really. I might check that out. I kind if wish Proxmox had Docker integration instead of lxc but that’s a different topic.

MangoPenguin@lemmy.blahaj.zone on 24 Mar 22:59 collapse

The easy option is run docker in a privileged LXC container, it’s basically like running it directly on Proxmox and will have no permissions issues.

Matty_r@programming.dev on 24 Mar 23:18 collapse

Oh, that works? That’s some inception level containering right there

MangoPenguin@lemmy.blahaj.zone on 24 Mar 23:50 collapse

Yup, you can do it unprivileged as well but permissions can be funky with any mount points shared with other containers.

gagootron@feddit.org on 25 Mar 05:44 collapse

I mounted my zfs dataset in a Jellyfin VM using 9p. All the features of the host ZFS while still running in a VM