Hello everyone!
I’m migrating my home lab to TrueNAS Scale (25.04.1). I am trying to run all of my previous apps (Bitwarden, Traefik, Pi-Hole, etc.) and some custom apps on TrueNAS. I also want to start using NextCloud and Paperless-NGX since the new system has more CPU and RAM (before I had everything running in docker on a Raspberry PI)
I’m a huge fan of HostPath datasets because they give me better control over my datasets, allowing me to back them up and share them more easily. Also, when an app is deleted, I don’t lose the user data.
I noticed that when you update an app, a snapshot is created for all ix-apps datasets. This is important for keeping the data version synchronous with the app version. For example, if a new app version (Docker image) introduces a database migration step, and I need to roll back due to any issues, the old version of the app will not be compatible with the “modern” database schema. Therefore, I need a snapshot of the old database’s state and/or the user data to ensure consistency.
For a demo I configured the Dockge app to use these two ZFS datasets.
| Type | Source | Destination | Mode |
|---|---|---|---|
| bind | /mnt/storage/stacks | /mnt/storage/stacks | |
| bind | /mnt/.ix-apps/app_mounts/dockge/data | /app/data |
Since I didn’t want to lose the stacks folder when I removed Dockge, I created a HostPath called /mnt/storage/stacks. This allows me to share the stacks folder with other apps, such as Arcane.
Now, when I update an app. Only the /ix-apps/app_mounts/dockge/data ZFS dataset gets a snapshot. The /mnt/storage/stacks HostPath dataset does not.
storage/ix-apps/app_mounts/dockge@1.2.4 0B - 140K -
storage/ix-apps/app_mounts/dockge/data@1.2.4 93K - 157K -
(For Dockge, it’s not a big problem, but let’s pretend it’s Nextcloud or a database.) In the event of a rollback, only the ix-apps datasets would be able to roll back; the other would be left alone, and the app might end up in a corrupted state. I could manually create snapshots of the HostPath dataset, but that would be error-prone and render the centralized versionized update/rollback mechanism in the UI useless.
Is there a way to make HostPath datasets eligible for snapshots when updating an app? A checkbox would be great. Alternatively, there could be a pre-app update script so that I can specify all the datasets belonging to an app in case of an update.
On my old system I was using GitHub - schuhumi/cipug: Container Images Pinning and Updating Gadget which handled my app versions and snapshots all in sync on BTRFS with one simple CLI command.
A’m I missing something? How are you handling this issue besides putting everything in TureNAS managed ix-apps datasets?