-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive snapshot (zfs snapshot -r) exlusions #8443
Comments
Hi @baryluk , The following sentence from your bug report picked my interest:
Do you have a reproducible case where you snapshot datasets through a channel program and the snapshots are not atomically created together (or rollback together if there is a failure)? If yes, then that would be a channel program bug and we would need to take care of it. |
My reference to My understanding is (possibly wrong?), that if I do |
My mistake then, however the remaining part of my statement, of it being not user friendly in general and pretty complex stands. Updated my initial post. |
I agree that the proposed command (or some variation of it) would be more succinct than writing a channel program script. The problem is there have been many requests of that nature over the years and many of them are conflicting. For example, some users may want Another problem is that we have use cases (like the one mentioned in this issue) which are legitimate but would be hard to implement correctly while maintaining a clean and consistent interface across all Finally from a developer's perspective, the amount of work needed as we add command options increases exponentially and testing gets trickier because we need to test all the different combinations of options (with some of them bound to be incompatible). Since we can't envision all the different user needs that exist out there, we decided to provide the option of trading-off some operational-complexity for more power and flexibility with channel programs ( For your specific use case now, if you can't wait to see if the issue will ever get traction, I'd recommend going the channel program way for now as it should provide both the performance and the consistency that you need. If you need help writing such a script, the man page can be used as a reference. There is also an example of an atomic recursive dataset destroying script here with a few |
How about supporting frequently-requested/generic-enough use-cases with a ZoL-provided set of channel programs? |
How does one join the OpenZFS Slack channels? I am reading a lot of these "join our Slack channel" all over the place but there is very little to no information on how to do it. Even the openzfs wiki "Newcomers" page suggests joining the channel as a "best way to reach us with questions", then you go to the slack website and find out "This team's administrator has not enabled email signups." and "Contact the workspace administrator for an invitation". I asked in the openzfs irc channel and no one seems to know how to join slack. It is very frustrating to feel invited in on the surface and then left out in practice. |
@spaghettopazia You can download the Slack app and search for OpenZFS or join through the web interface in your browser from this link: https://openzfs.slack.com . If you still have issues feel free to reach out to me directly, so we don't go off topic on this thread. |
Can we make OpenZFS slack work without invitation? |
@gmelikov Shoot! For some reason I thought it was open to everyone! I will ping the admins |
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <kash@tripleback.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Clint Armstrong <clint@clintarmstrong.net> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <kash@tripleback.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Clint Armstrong <clint@clintarmstrong.net> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <kash@tripleback.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Clint Armstrong <clint@clintarmstrong.net> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <kash@tripleback.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Clint Armstrong <clint@clintarmstrong.net> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <kash@tripleback.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Clint Armstrong <clint@clintarmstrong.net> Closes #8443 Closes #9050
This is a wishlist for
zfs snapshot -r
command.It would be great to add property on some datasets (
com.sun:auto-snapshot=false
or similar), that when combined with a flag to zfs snapshot (i.e.zfs snapshot -r -x
), will create atomic set of snapshot of all datasets and descendent child, with exception of the ones withcom.sun:auto-snapshot=false
set or inherited from parent.Use case is for automatic periodic snapshots. I.e. I do have my home directory contain about 30 datasets (some with custom compression, mirror, checksum, recsize, redund_md, quota, etc. settings). But there are two or three datasets I wish not to snapshot really (
.cache
,.steam
andZeroNetData
), but rest should be snapshoted.Right now I simply do this from crontab:
/usr/local/sbin/zfs snapshot -r "wctank4@daily_$(date --iso-8601=seconds | sed -e 's/\+/P/g')"
to snapshot entire pool and all datasets in the pool, which is very nice and easy to do.
Right now there is no easy way to do a recursive snapshot of pool or dataset and its childs, with exception, and do it atomically. Using
zfs program
is an option, but this makes the process WAY more complex,and doesn't allow me to do it atomically from the point of view of data stored in this datasets.Basically
zfs snapshot -r -x wctank4@ble
would be equivalent to:but nicer, less error prone (i.e. datasets with spaces in names or other special characters), more performant (when using big number of datasets, as zfs list need to sort list, but we do not need it), more reliable (there are limits in kernel of how many arguments you can pass to a program via argv) and available auto of the box.
Behaviour of
zfs snapshot
andzfs snapshot -r
would be unaffected by the user property.The text was updated successfully, but these errors were encountered: