ZFS Automatic Snapshots SMF service prototype updated
I've just updated the ZFS Automatic Snapshot SMF service that I wrote about before.
Now we've got support to only keep a fixed number of snapshots into the past, deleting older auto-snapshots. This also does the right thing if we've asked the service to snapshot all child datasets. Of course, we only look at snapshots that were created by this service, or at least ones that match our naming scheme (erm) when looking for older snapshots to delete. Perhaps I need to tidy that up...
Also new, though not hugely exciting (unless you've never seen SMF before, in which case you'll love it!) is that the service method is now reasonably well-behaved. If any of the tasks inside the service method fail, we now move the service into maintenance
state, and wait till an administrator fixes it.
There's still a bit more work to do here, in particular, I'd like to find out the correct way to log messages from the cron job to the correct SMF log for that instance of the service - just redirecting stdout and stderr into (say)
/var/svc/log/system-filesystem-zfs-auto-snapshot:space-timf.log just doesn't seem right to me. Any ideas on the proper way to do that ?
timf@haiiro[571] svcs -l svc:/system/filesystem/zfs/auto-snapshot:space-timf fmri svc:/system/filesystem/zfs/auto-snapshot:space-timf name ZFS automatic snapshots enabled true state online next_state none state_time Tue May 30 13:58:35 2006 logfile /var/svc/log/system-filesystem-zfs-auto-snapshot:space-timf.log restarter svc:/system/svc/restarter:default dependency require_all/none svc:/system/filesystem/local (online) dependency require_all/none svc:/system/cron (online)
No GUI changes as yet, but if you'd like to give this a go, you can download the latest tarball, zfs-auto-snapshot-0.3.tar.gz.
Comments and suggestions welcome!
Update 8th June: You probably want to see a recent post on this topic here
Am I doing anything wrong?
# ./zfs-auto-snapshot-admin.sh zfshome
Posted by Wes Williams on May 30, 2006 at 10:33 PM IST #
Posted by Tim Foster on May 31, 2006 at 08:44 AM IST #
Posted by Tim Foster on May 31, 2006 at 01:19 PM IST #
Would you happen to know if the version of JDS in the upcoming S10u2 will support your snapshot tool?
Posted by Wes Williams on May 31, 2006 at 01:43 PM IST #
Posted by Tim Foster on May 31, 2006 at 01:49 PM IST #
BTW, the integration to SMF really looks slick.
Posted by Wes Williams on May 31, 2006 at 02:07 PM IST #
Note for future visitors - this version is now out of date - the latest version is available via a link on the sidebar of my blog (at the time of writing, this is version 0.10)
Posted by Tim Foster on June 15, 2008 at 01:12 PM IST #