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


Comments:

Tim, thanks for the update. As a data point, I'm unable to input the interval, period, & keep_num into the GUI when run on a W2100z and OpenSolaris b36. The first question I get is about all children, and answering OK goes straight to the Summary screen to write the manifest.

Am I doing anything wrong?

# ./zfs-auto-snapshot-admin.sh zfshome

Posted by Wes Williams on May 30, 2006 at 10:33 PM IST #

Hey Wes, that's weird. Can you tell me what version of zenity you're running ? I have:
timf@haiiro[520] zenity --version
2.14.1
It might also be interesting if you run it using "ksh -x zfs-snapshot-admin.sh", which should print more detailed output as to what the script is doing, if you could mail that to me, I might be able to work out what's going wrong. Thanks for giving it a go, much appreciated!

Posted by Tim Foster on May 31, 2006 at 08:44 AM IST #

Thanks for the mail Wes, you've confirmed my suspicions - the version of zenity inside snv_36 is too old (it's GNOME 2.6-based). The gui script here needs at least version 2.14 - thankfully, that's going into Solaris Express soon, but early development builds are also available off the OpenSolaris desktop community webpage.

Posted by Tim Foster on May 31, 2006 at 01:19 PM IST #

Thanks again for the update Tim.

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 #

Erk, I'm guessing it won't. I'll see if I can knock together a port of the script to the version of zenity used in s10u2, or better yet, have one version of the script which detects the right version. Give me a few days and I'll see what I can come up with. (this is all "ample free time" stuff :-)

Posted by Tim Foster on May 31, 2006 at 01:49 PM IST #

Please don't rush this on my account Tim, I'm just thinking your tool may find greater acceptance and uptake once "ZFS hits the streets", officially in S10u2. Perhaps as a BigAdmin link or email announcement?

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 #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by timf