"0 snapshots found. Snapshots will be created automatically." (ZFS replication hint)

Hello, I am currently trying to configure a new replication task as follows:

What confuses me, is the blue hint/warning in low middle:

0 snapshots found. Snapshots will be created automatically.

In my view, I’ve done everything to allow for proper replication:

  • main/encrypted is the parent of a couple child datasets.
  • Multiple snapshots already exist for each child dataset.
  • All of these snapshots have been created by automated snapshot tasks.
  • Retention policy "Will be automatically destroyed at … " is shown for all of these snapshots.

Periodic job example (dataset and naming schema):
main/encrypted/mediaauto-media-weekly-%Y-%m-%d_%H-%M

I also tried to directly select a single child dataset like main/encrypted/media, but the same warning is shown.

Why doesn’t TrueNAS recognize any snapshots here, and sees need to create ones? TIA

My impression is, the popup description for “Replicate Custom Snapshots” is wrong/misleading:

Help: Replicate Custom Snapshots
Replicate snapshots that have not been created by an automated snapshot task. Requires setting a naming schema for the custom snapshots.

It should rather be described as:

Replicate snapshots that don’t have default naming schema auto-%Y-%m-%d_%H-%M.

At least, if I check this toggle and set one of my snapshot naming schemas, snapshots are finally found.


What still does not work: Selecting a parent dataset source with “Recursive” option and using any naming schema for snapshots of contained child datasets, or even wilcard .* - none of the snapshots are found here.

To illustrate

with a screenshot: Shouldn’t this configuration find all snapshots from child datasets under main/encrypted?

Or should I rather create own replication jobs for each child dataset (which is more work to do)?

Am I understanding this correctly? You created Periodic Snapshot Tasks for each child dataset, but not as atomic recursive snapshots on the parent itself?

When you select the parent as the “source”, the replication (zfs send) is contingent on the parent itself to have the relevant snapshots. Only if the child datasets have the same atomic/recursive snapshots will they also be replicated in tandem.


Look at it this way: Where the replication “begins” from a top-down hierarchy, is where the snapshots must be found from a top-down hierarchy.

1 Like

Thanks @winnielinnie , that helps a lot!

Yes, exactly.
I created periodic snapshot tasks for each of main/encrypted dataset’s children (.e.g. main/encrypted/media), as they need different retention policies. No recursive snapshot task is created on main/encrypted itself.

So, if I understand you correctly, I need to exactly mimic periodic snapshot task structure for replication tasks - and create separate replication tasks for each of the datasets/snapshots that are below parent main/encrypted.

To be honest, this behavior is hard to understand by reading help popup:

Help: Recursive
Set to also replicate all snapshots contained within the selected source dataset snapshots. Unset to only replicate the selected dataset snapshots.

So, does that mean, in order to replicate main/encrypted dataset with its own and all child snapshots, I need to

  • create periodic snapshot task for main/encrypted with Recursive option
  • create replication task for main/encrypted with Recursive option

?

Yes.

But there’s the other method of creating a separate replication task for each child dataset. In this case, you wouldn’t select main/encrypted, but rather main/encrypted/child1, and then another task you’d select main/encrypted/child2, and rinse and repeat for each replication task.


Even with vanilla ZFS using only the command-line, you cannot choose a parent dataset as the “replication source” (zfs send) if it does not have the relevant snapshots itself. It doesn’t matter what the children have, nor does it matter that you invoke the recursive option.

Let’s say I have a dataset tank/media and for its individual children (tv and movies) I have snapshots created with the “@auto” name.

If I issue this command:

zfs send -R tank/media@auto-2025-01-15

…it will abort with an error that reads “snapshot @auto-2025-01-15 does not exist!”

It doesn’t matter that the snapshots exist further down with the children.

1 Like

OK, understood.

And it also seems important, that the replication task dialog can only discover/find snapshots with default naming schema auto-%Y-%m-%d_%H-%M. Otherwise you need to use “Replicate Custom Snapshots”.

Simple example without Recursive complexities:
If using dataset main/encrypted/media as replication source, it’ll warn with “0 snaphots found”, because I use custom naming schema auto-media-weekly-%Y-%m-%d_%H-%M.

So I checked “Replicate Custom Snapshots” and by providing this schema, TrueNAS will indeed find them again.

Are you sure?

I think the GUI gives you more control if you use the “Advanced Replication Creation” page, rather than the “wizard”.

There’s an option to select an existing Periodic Snapshot Task to tether to the Replication Task currently being configured.

This video may help with setting up your snapshot tasks.

You will then be able to select whichever tasks you want to replicate and whichever datasets, nested if you want, in a single replication task.

2 Likes

Yeah, at least from end user perspective. Proof:

screenshot2

Thanks @Stux , will have a look at it.

Which page is that? The “Advanced” page?

Where is this option?
periodic-snapshots-task

No, my screenshot is from the “Replication Task Wizard” page.
I have yet to try the “Advanced” section - wanted to learn about the wizard first.

That’s why I wrote in this post.

Yeah, I read that. Will certainly look at the advanced page later on as well, for now my focus was on the more beginner-friendly wizard.

What I tried to express: The popup text from “Replicate Custom Snapshots”

Replicate snapshots that have not been created by an automated snapshot task.

seems misleading. Either its text is wrong, because snapshot discovery for source dataset can only find snapshots with default schema. Or the feature does not work as intended, because my snapshots indeed have been created by an automated snapshot task, so this option should not be needed.

I am now quite sure, Replication Task Wizard only find snapshots with default schema auto-%Y-%m-%d_%H-%M:
When a task is created via wizard, click on edit afterwards, and you’ll see this format is automatically set under “Also Include Naming Schema”.

So a better popup description for “Replicate Custom Snapshots” would be:

Replicate snapshots that have not been created with default naming schema auto-%Y-%m-%d_%H-%M.

Thanks @winnielinnie for mentioning advanced section - tried it out and now understand better what you meant.

Out of interest: Is the “Periodic Snapshot Tasks” just for syncing snapshot with replication task schedule? Popup says “Selecting a periodic snapshot schedule removes the Schedule field.”, but curiously this field isn’t hidden for me.

It’s the “default” way to create Replication Tasks.

The rationale goes something like: “The user wants to make regular snapshots of a dataset. ZFS replications use snapshots. Might as well have them tether a Replication Task to a Periodic Snapshot Task. Nice and simple.”


Yeah. I know. :confused: It’s been like this on Core (still is).

I’ll borrow a quote from another thread:

:warning: Disclaimer: I’m not saying to use the command-line or avoid the GUI for ZFS replications. I made this personal decision (back on FreeNAS 11) to bypass the GU for replications, since it put a bad taste in my mouth from the very start.

I could possibly switch to the GUI now, but I don’t have a reason to.

One of my original ideas to use the GUI for replications was a “Syncoid” style, simple backup: with a single click it will create a new snapshot (i.e, @backup-YYMMDD), and send it incrementally to a backup pool. (No need to tether a Periodic Snapshot Task or “naming schema” of a separate snapshot pattern to the replication job.)

This is not possible with the GUI.

Sounds great!

Assuming this field links a replication task to a periodic snapshot task, I would have expected, that a user choice in this field auto-fills certain other fields like dataset source and destination, snapshot naming schema and schedule by reading from linked snapshot task. Otherwise you might get inconsistencies.

Hence I’ve the feeling to still not have understood this field fully. Will give it some more testing.

Being new to TrueNAS/ZFS, I am quite happy to have this appliance GUI at hand, to not shoot myself in the foot!

Some more insights:

“Periodic Snapshot Tasks” field within “Add Replication Task” is specifically used to trigger a replication immediately after selected snapshot task ran.

It only makes sense, if “Run automatically” is also enabled.

Help: Periodic Snapshot Tasks

Selecting a periodic snapshot schedule removes the Schedule field.

seems outdated: “Run automatically” will trigger a replication, when either of following conditions is met:

  • Linked Periodic snap just finished
  • “Schedule” is checked and frequency matches.

Unfortunately user interface does not reflect dependencies between input fields and e.g. doesn’t auto-hide fields, if others are enabled/disabled.
Errors are shown at the moment, when job is started, not when it is configured.