Discussion:
individual fs auto snaps to suite
Harry Putnam via illumos-zfs
2014-04-30 18:06:33 UTC
Permalink
Setup: oi build 151_9
Running in Vbox vm as guest on windows 7 64 host

Trying to get my head around the autosnap process and services.

Its pretty confusing to me, since there seems a million or so sources
of info using google. So much that it's a little un-nerving without
enough knowledge before hand to refine searches.

I found something here:

https://github.com/pdxcat/zfs-auto-snapshot/blob/master/README.zfs-auto-snapshot.txt

Its five years old but seems to be saying it is possible to define in
some way, auto snaps for individual zfs fs or groups of them.

Even says there is an example of such a configuration somewhere.

The page has numbered lines so starting a line 33 I see:

These instances use the special "//" fs-name to determine which
filesystems should be included in each snapshot schedule. See the
description for "fs-name" below.

And on to bottom of page appears to indicate one could configure an
individual filesystem (as example) to have only `frequent' snaps
And set the number to keep.

A little further is says:

The :default service instance does not need to be enabled.

I really could not follow how this is supposed to be done, and it is
not really described in detail.

Also, of course, it is 5yr old.

So, is something like the ability to configure auto snapshots for
individual or groups of zfs fs outside the normal service possible on
recent oi-illumos OS?

(I don't mean `possible' in the sense of writing piles of code .. )

If so, where can I get some detailed (recent) documentation about it?
Jim Klimov via illumos-zfs
2014-05-02 11:24:59 UTC
Permalink
Post by Harry Putnam via illumos-zfs
So, is something like the ability to configure auto snapshots for
individual or groups of zfs fs outside the normal service possible on
recent oi-illumos OS?
(I don't mean `possible' in the sense of writing piles of code .. )
The "ZFS Automatic Snapshot SMF Service, version 0.12" you referenced
was the first implementation of auto-snapshots, available in OpenSolaris
and relatively simply portable to Solaris 10. For later OpenSolaris and
by consequence illumos and Solaris 11 it was completely rewritten (in
another language, by another team, etc.) as the Time-Slider project,
though with mostly the same concepts and configuration techniques.
In particular, the new time-slider daemon has an ability to destroy
the older automatic snapshots earlier than the schedule would command,
if the pool runs out of space (threshold is configurable, see more in
"svcprop time-slider").

The part of configuration you are probably interested in - to select
the datasets for snapshooting - is in both cases a setting of the custom
ZFS dataset attribute for the service or a particular schedule to "true"
or "false", with the value being inherited to child datasets. Then the
service calculates the datasets for which "individual" or "recursive"
snapshots should be requested, and does just that regularly.

Example for a typical root pool:
:; zfs set com.sun:auto-snapshot=true rpool
:; zfs set com.sun:auto-snapshot=false rpool/dump
:; zfs set com.sun:auto-snapshot=false rpool/swap

You can also enable only individual schedules like this:
:; zfs set com.sun:auto-snapshot=false pool/export/DUMP
:; zfs set com.sun:auto-snapshot:weekly=true pool/export/DUMP

Some other options, typically set in the SMF instance properties,
include the actual schedule for snapshots and the amount of copies
to retain normally, the commands to run after snapshot (i.e. rsync
or zfs-send a copy to another box), etc. - see in "svcprop hourly"
for example.

HTH,
//Jim Klimov
Harry Putnam via illumos-zfs
2014-05-02 19:43:10 UTC
Permalink
Post by Jim Klimov via illumos-zfs
Post by Harry Putnam via illumos-zfs
So, is something like the ability to configure auto snapshots for
individual or groups of zfs fs outside the normal service possible on
recent oi-illumos OS?
[...]
Post by Jim Klimov via illumos-zfs
The part of configuration you are probably interested in - to select
the datasets for snapshooting - is in both cases a setting of the custom
ZFS dataset attribute for the service or a particular schedule to "true"
or "false", with the value being inherited to child datasets. Then the
service calculates the datasets for which "individual" or "recursive"
snapshots should be requested, and does just that regularly.
Thank you sir for a good brief history and walkthru of what is
possible.

One thing I'm curious about is if it might be possible to have
something like what is described below without major heaving and
hawing?

Specific zfs fs to have the regular auto-snap turned on AND to have a
separate auto-snapping arrangement (applied to individual or groups of zfs
fs) where the things below or something similar is possible.

1) naming convention won't interfere with the default service naming
(settable per zfs fs)

2) Frequency, number to keep (backlog) and whether to rollover into
hourly weekly etc. (settable per zfs fs)
Jim Klimov via illumos-zfs
2014-05-03 07:54:29 UTC
Permalink
Post by Jim Klimov via illumos-zfs
Post by Jim Klimov via illumos-zfs
Post by Harry Putnam via illumos-zfs
So, is something like the ability to configure auto snapshots for
individual or groups of zfs fs outside the normal service possible
on
Post by Jim Klimov via illumos-zfs
Post by Harry Putnam via illumos-zfs
recent oi-illumos OS?
[...]
Post by Jim Klimov via illumos-zfs
The part of configuration you are probably interested in - to select
the datasets for snapshooting - is in both cases a setting of the
custom
Post by Jim Klimov via illumos-zfs
ZFS dataset attribute for the service or a particular schedule to
"true"
Post by Jim Klimov via illumos-zfs
or "false", with the value being inherited to child datasets. Then
the
Post by Jim Klimov via illumos-zfs
service calculates the datasets for which "individual" or "recursive"
snapshots should be requested, and does just that regularly.
Thank you sir for a good brief history and walkthru of what is
possible.
One thing I'm curious about is if it might be possible to have
something like what is described below without major heaving and
hawing?
Specific zfs fs to have the regular auto-snap turned on AND to have a
separate auto-snapping arrangement (applied to individual or groups of zfs
fs) where the things below or something similar is possible.
1) naming convention won't interfere with the default service naming
(settable per zfs fs)
2) Frequency, number to keep (backlog) and whether to rollover into
hourly weekly etc. (settable per zfs fs)
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
https://www.listbox.com/member/archive/rss/182191/22497542-d75cd9d9
https://www.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com
I am not certain I've got your description correctly, but it sounds like you want to define your own SMF instance similar to hourly, and to have its tag set to true on your specific datasets, and an overall false for this service at pool's root dataset. If you don't need the other schedules, you might keep their services disabled.

To add the instance you could 'svccfg export zfs-auto-snap > /tmp/z.xml', edit the file (clone a block for a service instance and change it to your desired name, schedule and other parameters), and 'svccfg import /tmp/z.xml' to get the resulting file and import your updated definitions.
Finally 'svcadm refresh yoursvcname; svcadm enable yoursvcname' to activate.

HTH, Jim
--
Typos courtesy of K-9 Mail on my Samsung Android

Loading...