Project

General

Profile

Feature #75873

Add support for nested ZFS datasets via shadow_copy_zfs vfs module

Added by Bug Clerk almost 3 years ago. Updated over 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Andrew Walker
Category:
Services
Target version:
Estimated time:
Severity:
Low Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

Description

I'd like to create a snapshot routine that looks something like this, and export it via shadow-copy ("Previous Versions") on CIFS:

  • Every 30 minutes, kept for 72 hours
  • Every 12 hours, kept for 21 days
  • Weekly, kept for 6 months
  • Offline or further snapshots for 1-3 years or as needed, or backups in addition (this list is only as an example)

Creating such a routine in 9.10.2 is easy in principle but there's two problems. First, the GUI doesn't allow much flexibility in snapshot interval (e.g., 1 day/1 week/1 month). Second, if multiple tasks are needed for a snapshot routine (as here), the GUI only seems to allow 1 of them at most to be selected and exported under "Previous Versions" via CIFS, so the client can't see all snapshots available, and exposing newer ones means not exposing older ones.

Google reveals a comment on Github (https://github.com/zfsonlinux/zfs-auto-snapshot/issues/10#issuecomment-46753124) that the latter issue can be worked around by clever choice of snapshot naming, although it doesn't look like it can be done at present in FreeNAS, or might mess around with FreeNAS expectations on snapshot naming, causing other issues:

One can expose all weekly, monthly, hourly snapshots into windows if you're clever with the snapshot naming.. use a number system such as 01, 02, 03 ,04 for week/mon/hour/day etc.. then use the format property to interpret that label as part of the date-time

vfs objects = shadow_copy2
shadow: snapdir = .zfs/snapshot
shadow: sort = desc
shadow: format = zfs-auto-snap_%S-%Y-%m-%d-%H%M
shadow: localtime = yes

too easy :)

Another possible route might be to add a checkbox that activates the vfs-shadow-copy2 setting "shadow:snapdirseverywhere = yes" to automagically solve everything, although I'm not 100% sure if this will solve the issue or have any side effects. But either way it seems useful to fix this, and unhelpful that only a subset of snapshots can be selected to be exposed to the SMB client.

Summary - It seems technically possible, and an important/useful ability, to expose all snapshots for a share via Previous Versions, not just one subset of snapshots, but not doable within the GUI. Can a way to do this be exposed in the GUI?


Related issues

Copied from FreeNAS - Feature #21333: Provide some way to expose all snapshots via shadow-copy2, not just a subset of snapshotsDone

History

#1 Updated by Bug Clerk almost 3 years ago

  • Copied from Feature #21333: Provide some way to expose all snapshots via shadow-copy2, not just a subset of snapshots added

#2 Updated by Bug Clerk almost 3 years ago

  • Target version changed from Master - FreeNAS Nightlies to 11.2-U3

#3 Updated by Bug Clerk almost 3 years ago

  • Status changed from Unscreened to In Progress

#4 Updated by Bug Clerk almost 3 years ago

  • Status changed from In Progress to Ready for Testing

#5 Updated by Dru Lavigne almost 3 years ago

  • Subject changed from Provide some way to expose all snapshots via shadow-copy2, not just a subset of snapshots to Add support for nested ZFS datasets via shadow_copy_zfs vfs module
  • Needs Merging changed from Yes to No

#9 Updated by Timothy Moore II over 2 years ago

#10 Updated by Dru Lavigne over 2 years ago

  • Needs Doc changed from Yes to No

#12 Avatar?id=55038&size=24x24 Updated by Zackary Welch over 2 years ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Confirmed fixed in 11.2-U3.

Testing Steps:
This is basically just Andrew's steps but fleshed out a little.
1. Create a user named 'smbuser' with a password set. Create a dataset and then set permissions for the user/group to smbuser and ACL type to Windows. Create an SMB share on that dataset and enable the SMB service.
2. Create a snapshot of that dataset
3. Go back to the share and in Advanced add a VFS Object of shadow_copy_zfs, then save. Restart the SMB service.
4. On a Windows client, connect to the share. Then right click on the folder and go to Properties->Previous Versions. The snapshot should appear as a previous version.

#13 Updated by Dru Lavigne over 2 years ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF