Chris Gerhard wrote:
I'm not sure there's an easy way to please everyone to be honest :-/

I'm not sure you are right there. If there was an SMF property that you set to set the default behaviour and then you set it to true on something that looked like a laptop and false otherwise. Or you could just turn it on by default for root pools. Indeed the installation could set the property.

It's going to be turtles all the way down isn't it?

That is, we'd now have a property to set whether or not the system sets properties... Should we have another property set to tell the system whether to look at that property as well? :-)

I can see what you're asking for, but it just seems a bit redundant, when all you have to do is set a property on the pools you don't want auto-snapshotted, or just disable the service altogether.

I've got a suggested fix attached - but we'd need to coordinate with the desktop & install people to work out how they're actually going to set the service property at install time to true. Can you file an rfe against solaris/zfs/utility with me as RE if you still think this is important, but read on...

If we have such a setting, auto-include, set to false by default, then on a brand new system, doing

# svcadm enable auto-snapshot:frequent

would have no effect whatsoever - other than running a cron job that does nothing every 15 minutes. This strikes me as weird.

While on a desktop being on by default has some value on a server that has been upgraded and therefore would have a backup strategy already in place it does not.

In nv_100, SXCE has this off by default - the auto-snapshot SMF service already defaults to disabled, unfortunately time-slider had a postinstall script that enabled the services again. They've got that fixed in nv_102 I believe. So perhaps the auto-include property isn't needed after all.

Do we supply a script to delete all the auto-snapshot snapshots? Is there anyway to recognise them apart from by their name?

Nope. The time-slider service just looks for snapshots of given names.

We could mark those snapshot with another zfs user property, but that'd break backwards compatibility with earlier versions of Solaris that don't have snapshot property support, so I'd rather not do that if possible?

        cheers,
                        tim



That said, how often do you import or create pools where this would be an issue? If you're importing pools you've used on such a system before, then you'd already have the property set on the root dataset.

If you're constantly importing brand new pools, then yes, you've got a point.

You only have to have this mess with one pool which is being uses as the target for a backup for the consequences to be horrible. For that reason alone it needs to default to off.

Don't get me wrong. The service is really nice and the gui integration looks like it could be a thing of beauty if it can be made to scale. Indeed on my daughter's laptop it looks great. It's just it should default to being off with a really easy way to turn it on rather than the other way round.
diff -r ebf8b658f257 README.zfs-auto-snapshot.txt
--- a/README.zfs-auto-snapshot.txt      Sun Oct 26 17:41:39 2008 +0000
+++ b/README.zfs-auto-snapshot.txt      Tue Oct 28 11:13:21 2008 +0000
@@ -110,6 +110,13 @@
                        6343667 need itinerary so interrupted scrub/resilver
                                doesn't have to start over
 
+ zfs/auto-include      Set to false by default, setting to true makes service
+                       instances using the '//' fs-name value attempt to
+                       automatically set the com.sun:auto-snapshot
+                       property to "true" on service start for any pools on the
+                       system where it's not already set to either 
+                       "true" or "false".
+
 
 An example instance manifest is included in this archive.
 
diff -r ebf8b658f257 src/lib/svc/method/zfs-auto-snapshot
--- a/src/lib/svc/method/zfs-auto-snapshot      Sun Oct 26 17:41:39 2008 +0000
+++ b/src/lib/svc/method/zfs-auto-snapshot      Tue Oct 28 11:13:21 2008 +0000
@@ -895,7 +895,7 @@
 function auto_include {
        FS_NAME=$fs_name
        LABEL=$label
-       if [ "$FS_NAME" == "//" ] ; then
+       if [[ "$FS_NAME" == "//" && "$auto_include" == "true" ]] ; then
                POOLS=$(zpool list -H -o name)
                for pool in $POOLS ; do
                        if ! zpool status -x $pool | grep "state: UNAVAIL" > 
/dev/null ; then
diff -r ebf8b658f257 src/samples/auto-snapshot-space-archive.xml
--- a/src/samples/auto-snapshot-space-archive.xml       Sun Oct 26 17:41:39 
2008 +0000
+++ b/src/samples/auto-snapshot-space-archive.xml       Tue Oct 28 11:13:21 
2008 +0000
@@ -45,6 +45,8 @@
                    override="true"/>
          <propval name="avoidscrub" type="boolean" value="true"
                   override="true"/>
+         <propval name="auto-include" type="boolean" value="false"
+                  override="true"/>
 
        </property_group>
 
diff -r ebf8b658f257 src/samples/auto-snapshot-space-timf,backup.xml
--- a/src/samples/auto-snapshot-space-timf,backup.xml   Sun Oct 26 17:41:39 
2008 +0000
+++ b/src/samples/auto-snapshot-space-timf,backup.xml   Tue Oct 28 11:13:21 
2008 +0000
@@ -47,6 +47,8 @@
                    override="true"/>
          <propval name="avoidscrub" type="boolean" value="true"
                   override="true"/>
+         <propval name="auto-include" type="boolean" value="false"
+                  override="true"/>
 
        </property_group>
 
diff -r ebf8b658f257 src/var/svc/manifest/system/filesystem/auto-snapshot.xml
--- a/src/var/svc/manifest/system/filesystem/auto-snapshot.xml  Sun Oct 26 
17:41:39 2008 +0000
+++ b/src/var/svc/manifest/system/filesystem/auto-snapshot.xml  Tue Oct 28 
11:13:21 2008 +0000
@@ -155,6 +155,11 @@
                6343667 need itinerary so interrupted scrub/resilver
                        doesn't have to start over
 
+       auto_include : Set to false by default, this determines whether
+               instances using the '//' fs-name property should
+               attempt to automatically set the com.sun:auto-snapshot
+               property to true on pools where it's not already set
+               to either true or false.
 
         -->
        <property_group name="zfs" type="application">
@@ -173,6 +178,7 @@
          <propval name="label" type="astring" value="" override="true"/>
          <propval name="verbose" type="boolean" value="false" override="true"/>
          <propval name="avoidscrub" type="boolean" value="false" 
override="true"/>
+         <propval name="auto-include" type="boolean" value="false" 
override="true"/>
        </property_group>
 
 
@@ -225,6 +231,9 @@
 
           <propval name="avoidscrub" type="boolean" value="false"
                override="false"/>
+         <propval name="auto-include" type="boolean" value="false"
+               override="true"/>
+
 
        </property_group>
 
@@ -275,6 +284,9 @@
 
          <propval name="avoidscrub" type="boolean" value="false"
                   override="false"/>
+         <propval name="auto-include" type="boolean" value="false"
+                  override="true"/>
+
 
        </property_group>
 
@@ -326,6 +338,9 @@
 
          <propval name="avoidscrub" type="boolean" value="false"
                   override="false"/>
+         <propval name="auto-include" type="boolean" value="false"
+                  override="true"/>
+
 
        </property_group>
 
@@ -376,6 +391,9 @@
 
          <propval name="avoidscrub" type="boolean" value="false"
                   override="false"/>
+         <propval name="auto-include" type="boolean" value="false"
+                  override="true"/>
+
 
        </property_group>
 
@@ -427,6 +445,9 @@
 
          <propval name="avoidscrub" type="boolean" value="true"
                   override="false"/>
+         <propval name="auto-include" type="boolean" value="false"
+                  override="true"/>
+
 
        </property_group>
 
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to