You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Optional ZFS pool features can have three states: disabled, enabled, and active. Enabled means that ZFS will use them if it needs them, but they haven't changed the on-disk format yet, so they can still be switched off. But active features have already changed the on-disk format, so they can't be switched off. Disabled features may not be used.
We have a Salt state in salt/freebsd/zpool.sls that sets some features to "enabled". However, if the feature is already active, then Salt will wrongly try to set it back to "enabled". For example:
Setup
Set livelist on mypool:
zpool.present:
- name: mypool
- properties:
- feature@livelist: enabled
This state will work correctly if the feature is currently disabled or enabled. However, if the feature is active, then it will wrongly try to set it back to "enabled", without effect.
$ zpool get feature@livelist mypool
NAME PROPERTY VALUE SOURCE
mypool feature@livelist active local
$ sudo salt-call --state-verbose=False state.apply
...
ID: Set livelist on mypool
Function: zpool.present
Name: mypool
Result: True
Comment: properties updated
Started: 16:33:44.967972
Duration: 755.072 ms
Changes:
----------
mypool:
----------
feature@livelist:
enabled
...
Please be as specific as possible and give set-up details.
on-prem machine
VM (Virtualbox, KVM, etc. please specify)
VM running on a cloud service, please be explicit and add details
container (Kubernetes, Docker, containerd, etc. please specify)
or a combination, please be explicit
jails if it is FreeBSD
Steps to Reproduce the behavior
Create a zpool and ensure that some zpool feature is active. An easy one to test with is empty_bpobj. Activate it like this:
truncate -s 1g /tmp/zfs.img
zpool create testpool /tmp/zfs.img
zpool set feature@empty_bpobj=enabled testpool
zpool create testpool/foo
zpool get feature@empty_bpobj testpool
NAME PROPERTY VALUE SOURCE
testpool feature@empty_bpobj active local
Then simply apply a zpool.present state that tries to set that feature to enabled.
Expected behavior
The command should complete with no output. It should not try to change the state.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 3004.2Dependency Versions:
cffi: 1.15.0cherrypy: Not Installeddateutil: Not Installeddocker-py: Not Installedgitdb: Not Installedgitpython: Not InstalledJinja2: 3.0.1libgit2: Not InstalledM2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.4msgpack-pure: Not Installedmysql-python: Not Installedpycparser: 2.21pycrypto: Not Installedpycryptodome: 3.12.0pygit2: Not InstalledPython: 3.9.13 (main, Jun 30 2022, 19:10:41)python-gnupg: Not InstalledPyYAML: 5.4.1PyZMQ: 22.3.0smmap: Not Installedtimelib: Not InstalledTornado: 4.5.3ZMQ: 4.3.4System Versions:
dist: freebsd 13.0 locale: utf-8machine: amd64release: 13.0-AXCIENT3-p12system: FreeBSDversion: FreeBSD 13.0
The text was updated successfully, but these errors were encountered:
Optional ZFS pool features can have three states: disabled, enabled, and
active. Enabled means that ZFS will use them if it needs them, but they
haven't changed the on-disk format yet, so they can still be switched
off. But active features have already changed the on-disk format, so
they can't be switched off. Disabled features may not be used.
When enabling such a feature via the zpool.present state, treat "active"
as identical to "enabled".
Fixessaltstack#62390
Description
Optional ZFS pool features can have three states: disabled, enabled, and active. Enabled means that ZFS will use them if it needs them, but they haven't changed the on-disk format yet, so they can still be switched off. But active features have already changed the on-disk format, so they can't be switched off. Disabled features may not be used.
We have a Salt state in salt/freebsd/zpool.sls that sets some features to "enabled". However, if the feature is already active, then Salt will wrongly try to set it back to "enabled". For example:
Setup
This state will work correctly if the feature is currently
disabled
orenabled
. However, if the feature isactive
, then it will wrongly try to set it back to "enabled", without effect.Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior
Create a zpool and ensure that some zpool feature is active. An easy one to test with is
empty_bpobj
. Activate it like this:Then simply apply a
zpool.present
state that tries to set that feature toenabled
.Expected behavior
The command should complete with no output. It should not try to change the state.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)The text was updated successfully, but these errors were encountered: