Hi Gary,
We use this method to implement NexentaStor HA-Cluster and, IIRC,
Solaris Cluster uses shared cachefiles, too.  More below...

On Aug 29, 2011, at 11:13 AM, Gary Mills wrote:

> I have a system with ZFS root that imports another zpool from a start
> method.  It uses a separate cache file for this zpool, like this:
> 
>        if [ -f $CCACHE ]
>        then
>            echo "Importing $CPOOL with cache $CCACHE"
>            zpool import -o cachefile=$CCACHE -c $CCACHE $CPOOL
>        else
>            echo "Importing $CPOOL with device scan"
>            zpool import -o cachefile=$CCACHE $CPOOL
>        fi
> 
> It also exports that zpool from the stop method, which has the side
> effect of deleting the cache.  This all works nicely when the server
> is rebooted.
> 
> What will happen when the server is halted without running the stop
> method, so that that zpool is not exported?  I know that there is a
> flag in the zpool that indicates when it's been exported cleanly.  The
> cache file will exist when the server reboots.  Will the import fail
> with the `The pool was last accessed by another system.' error, or
> will the import succeed?  

The pool metadata has the host's ID stored. When you export the pool,
the host's ID is cleared. So as long as you import on the same host,
it won't pring the "last accessed by another system" message.

> Does the cache change the import behavior?

Only pools in /etc/zfs/zpool.cache are imported automatically at boot.
To import your pool, add a start script.

> Does it recognize that the server is the same system?  I don't want
> to include the `-f' flag in the commands above when it's not needed.

It should just work.  Use "zdb -C /my/cache/file" for exploration and
troubleshooting.
 -- richard

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to