geoffdavis / puppet-zfsonlinux

Puppet support for ZFS on Linux as provided by zfsonlinux.org
3 stars 1 forks source link

zpool_version fact fails with undefined method 'captures' error #1

Open geoffdavis opened 11 years ago

geoffdavis commented 11 years ago

I'm not sure if this is due to the recent bump to zfsonlinux 0.6.0-rc14 (from rc8) or not, but the zpool_version fact fails now at run time.

Could not retrieve zpool_version: undefined method `captures' for nil:NilClass
geoffdavis commented 11 years ago

This is due to the fact that the zpool version scheme has changed. They are now using feature flags to indicate versions, and thus the output of zpool upgrade -v has changed.

Old output (actually taken from a Solaris 10u10 box):

davis@plinian ~ $ sudo zpool upgrade -v
Password: 
This system is currently running ZFS pool version 22.

The following versions are supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS version
 2   Ditto blocks (replicated metadata)
 3   Hot spares and double parity RAID-Z
 4   zpool history
 5   Compression using the gzip algorithm
 6   bootfs pool property
 7   Separate intent log devices
 8   Delegated administration
 9   refquota and refreservation properties
 10  Cache devices
 11  Improved scrub performance
 12  Snapshot properties
 13  snapused property
 14  passthrough-x aclinherit
 15  user/group space accounting
 16  stmf property support
 17  Triple-parity RAID-Z
 18  Snapshot user holds
 19  Log device removal
 20  Compression using zle (zero-length encoding)
 21  Reserved
 22  Received properties

For more information on a particular version, including supported releases,
see the ZFS Administration Guide.

New output looks like this - no explicit "This system is currently running ZFS pool version blah":

davis@anfnfsl ~ $ sudo zpool upgrade -v
This system supports ZFS pool feature flags.

The following features are supported:

FEAT DESCRIPTION
-------------------------------------------------------------
async_destroy                         (read-only compatible)
     Destroy filesystems asynchronously.
empty_bpobj                           (read-only compatible)
     Snapshots use less space.
lz4_compress                         
     LZ4 compression algorithm support.

The following legacy versions are also supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS version
 2   Ditto blocks (replicated metadata)
 3   Hot spares and double parity RAID-Z
 4   zpool history
 5   Compression using the gzip algorithm
 6   bootfs pool property
 7   Separate intent log devices
 8   Delegated administration
 9   refquota and refreservation properties
 10  Cache devices
 11  Improved scrub performance
 12  Snapshot properties
 13  snapused property
 14  passthrough-x aclinherit
 15  user/group space accounting
 16  stmf property support
 17  Triple-parity RAID-Z
 18  Snapshot user holds
 19  Log device removal
 20  Compression using zle (zero-length encoding)
 21  Deduplication
 22  Received properties
 23  Slim ZIL
 24  System attributes
 25  Improved scrub stats
 26  Improved snapshot deletion performance
 27  Improved snapshot creation performance
 28  Multiple vdev replacements

For more information on a particular version, including supported releases,
see the ZFS Administration Guide.

I guess there are two possible courses of action here:

Since the official Oracle zfs versions apparently go higher than 28 now and don't support feature flags, I think the first option is the better one. We should probably add another fact for zfs_feature_flags.