Is there a way to pass thru the ZFS file system to a VM?
I know this can be done for jails but what about VMs?
I’m running truenas core 13.0-U6.1. In there i have a VM with debian 11 in where i install apps that don’t have FreeBSD ports (looking at you openproject!).
At the moment i’m trying to install the docker container for UrBackup which can take advantage of the ZFS filesystem but it needs access to it.
How can i pass these same properties/permissions to a VM?
And before you suggest to just install Urbackup in a jail, i just prefer not to do it. The official port has no maintainer and, according to UrBackup, “The FreeBSD port is currently broken”. This means that it would have to be installed from source which i don’t know how to update.
No, not as a VM. When using a VM you are communicating over a networking protocol, so you must use something like SMB/NFS/ISCSI/S3.
If you want to do bind or nullfs type mounts, you would run applications as a container, which gives you direct dataset access, no network hop required.
Good, i thought i was missing something.
I am familiar with jails but i want to avoid it in this case the FreeBSD port for URbackup is broken and has no maintainer.
I could install it from source in a jail but i have no experience updating apps from source.
This is slowly morphing into another topic but, would you mind walking me through the process?
Lets assume i have a previous version of URBackup which i installed from source (lets call it V2.49).
I want to upgrade it to the newest version which is 2.53.33
so, i would SSH into the jail then
wget https://hndl.urbackup.org/Server/2.5.33/urbackup-server-2.5.33.tar.gz
tar xf urbackup-server-2.5.33.tar.gz
cd urbackup-server-2.5.33
./configure
make
sudo make install
And after this URbackup would be running V2.5.33?
Do i need to uninstall anything prior to these steps?
If that is the case, then my solution would be very simple. Just install it in a Jail.
Since it looks like the make install command just generates a binary, you would just copy the newly compiled binary to the /usr/local/bin directory, and chmod +x the binary.
The make install command should dump the compiled binary into your PWD (current directory) so a chmod +x urbackupsrv && cp urbackupsrv /usr/local/bin/urbackupsrv should do the trick.
You should also get the rc startup script form the pkg install so you don’t have to build your own.
This SO talks about accessing zfs for inside a docker
For me it worked with:
docker container in privileged mode
zfs device mapped into the container (–device /dev/zfs)
zfsutils-linux installed in the container
I think bind mounting /dev/zfs into a sandbox would work. And you could probably use jailmaker docker template, and then a docker image for urbackup too.
I’d suggest using container images (ie docker) whenever possible inside a sandbox for ease of support/maintenance etc
@Stux, your advisement circles back to my original question. How do you expose the truenas core ZFS to a VM running debian so i can “bind mounting /dev/zfs” into a container?
Based on this thread it appears that trueNAS cannot expose its ZFS to a VM. That is why I’m now trying to install URbackup inside a jail.
Now, I’m fighting to learn how to expose the truenas ZFS into a jail.
well, i just discovered that if i do the following on the truenas host i can expose the ZFS dataset to the urbackup jail
zfs jail 37 Vault/Apps/urbackup
Where 37 is the iocage JID for the jail called “urbackup” and “Vault/Apps/urbackup” is the dataset i created to save all the backup files from urbackup.
My new problem is that this is not persistent. It will work until the truenas server is restarted.
How can i associate this command with this jail?
Is there something like a pre-start script for jails in truenas?
I’m not sure that is correct.
My understanding is that the mountpoints would make the dataset’s filesystem available to the jail, not the dataset itself.
In my case, i have already mounted 3 datasets in the jail. But when i do “zfs list” from within the jail i get
root@urbackup:~ # zfs list
no datasets available
but, if i do the following from the truenas host after the jail is running
I’m playing with the jail properties to see where i get.
Ideally i should be able to run that command automatically after the jail has started.
Another issue i found is that, for some reason, in my system that command only works with the JID which changes everytime i start the jail. if i try that command with the Jailname it fails.