Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zfs_prepare_disk script for disk firmware install #15243

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

tonyhutter
Copy link
Contributor

@tonyhutter tonyhutter commented Sep 6, 2023

Motivation and Context

Add a way to update disk firmware before including a disk in pool.

Description

Have libzfs call a special zfs_prepare_disk script before a disk is included into the pool. The user can edit this script to add things like a disk firmware update or a disk health check. Use of the script is totally optional. See the zfs_prepare_disk manpage for full details.

This also reformats the code so that both zfs_prepare_disk and the zpool.d/ scripts use similar codepaths.

How Has This Been Tested?

Created a pool on a VM and saw script run. Added a disk and saw script get run. Replaced a disk and saw script get run. Tested autoreplace.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@tonyhutter tonyhutter force-pushed the newdisk2 branch 6 times, most recently from 90d18bd to 78e8c1a Compare September 9, 2023 00:05
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Sep 9, 2023
@tonyhutter tonyhutter changed the title WIP: Add zfs_prepare_disk script for disk firmware install Add zfs_prepare_disk script for disk firmware install Sep 12, 2023
lib/libzfs/os/linux/libzfs_pool_os.c Outdated Show resolved Hide resolved
lib/libzfs/os/linux/libzfs_pool_os.c Outdated Show resolved Hide resolved
lib/libzfs/os/linux/libzfs_pool_os.c Outdated Show resolved Hide resolved
lib/libzfs/os/linux/libzfs_pool_os.c Outdated Show resolved Hide resolved
man/man8/zfs_prepare_disk.8 Outdated Show resolved Hide resolved
man/man8/zfs_prepare_disk.8 Outdated Show resolved Hide resolved
man/man8/zfs_prepare_disk.8 Outdated Show resolved Hide resolved
man/man8/zfs_prepare_disk.8 Outdated Show resolved Hide resolved
@tonyhutter
Copy link
Contributor Author

@behlendorf I included your fixes in my latest push, however I see some FreeBSD build errors and still need to deal with those

@tonyhutter tonyhutter force-pushed the newdisk2 branch 14 times, most recently from ffaeb57 to 50b91f3 Compare September 20, 2023 17:47
lib/libzfs/libzfs_util.c Show resolved Hide resolved
man/man8/zfs_prepare_disk.8.in Outdated Show resolved Hide resolved
man/man8/zfs_prepare_disk.8.in Outdated Show resolved Hide resolved
scripts/zfs_prepare_disk Outdated Show resolved Hide resolved
Have libzfs call a special `zfs_prepare_disk` script before a disk is
included into the pool.  The user can edit this script to add things
like a disk firmware update or a disk health check.  Use of the script
is totally optional. See the zfs_prepare_disk manpage for full details.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Sep 20, 2023
@behlendorf behlendorf merged commit b53077a into openzfs:master Sep 21, 2023
20 of 25 checks passed
defaziogiancarlo pushed a commit to LLNL/zfs that referenced this pull request Sep 22, 2023
Have libzfs call a special `zfs_prepare_disk` script before a disk is
included into the pool.  The user can edit this script to add things
like a disk firmware update or a disk health check.  Use of the script
is totally optional. See the zfs_prepare_disk manpage for full details.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#15243
ixhamza pushed a commit to truenas/zfs that referenced this pull request Nov 20, 2023
Have libzfs call a special `zfs_prepare_disk` script before a disk is
included into the pool.  The user can edit this script to add things
like a disk firmware update or a disk health check.  Use of the script
is totally optional. See the zfs_prepare_disk manpage for full details.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#15243
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
Have libzfs call a special `zfs_prepare_disk` script before a disk is
included into the pool.  The user can edit this script to add things
like a disk firmware update or a disk health check.  Use of the script
is totally optional. See the zfs_prepare_disk manpage for full details.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#15243
behlendorf pushed a commit that referenced this pull request Feb 13, 2024
Have libzfs call a special `zfs_prepare_disk` script before a disk is
included into the pool.  The user can edit this script to add things
like a disk firmware update or a disk health check.  Use of the script
is totally optional. See the zfs_prepare_disk manpage for full details.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #15243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants