-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zpool: Add slot power control, print power status #15662
Conversation
I think the command line interface could be clearer, like |
I'd second that.
Obvious -pP is taken by status, -e (engergy) by online. |
A few commands do. Not hard to add it in to those that don't. |
Ok, should have said zpool clear, offline, online, status... |
What would the short name for
If we want to later add power control to |
1a8dcc0
to
f91d3eb
Compare
Does it need one? Depends how niche this feature is, I suppose. |
I suppose not. We have short names for all the other long args, but there's nothing set in stone that we have to have them. |
There's one we don't: |
@robn thanks, that settles it then - I'll add it as |
5a98c53
to
e05bbc5
Compare
21110fc
to
1dad982
Compare
All the changes requested have been pushed in. I'm still looking into some build warnings on Centos 7 and FreeBSD. |
4bd224b
to
5ce6434
Compare
I think this is ready to go. The checkstyle failure does not appear for me when I run |
a9b470d
to
5ce6434
Compare
Add `zpool` flags to control the slot power to drives. This assumes your SAS or NVMe enclosure supports slot power control via sysfs. The new `--power` flag is added to `zpool offline|online|clear`: zpool offline --power <pool> <device> Turn off device slot power zpool online --power <pool> <device> Turn on device slot power zpool clear --power <pool> [device] Turn on device slot power If the ZPOOL_AUTO_POWER_ON_SLOT env var is set, then the '-1' is automatically implied for `zpool online` and `zpool clear` and does not need to be passed. zpool status also gets a --power option to print the slot power status. Signed-off-by: Tony Hutter <[email protected]>
5ce6434
to
a18a39f
Compare
My latest push uses the ABI files from the checkabi artifacts, which resolves the errors. |
Add `zpool` flags to control the slot power to drives. This assumes your SAS or NVMe enclosure supports slot power control via sysfs. The new `--power` flag is added to `zpool offline|online|clear`: zpool offline --power <pool> <device> Turn off device slot power zpool online --power <pool> <device> Turn on device slot power zpool clear --power <pool> [device] Turn on device slot power If the ZPOOL_AUTO_POWER_ON_SLOT env var is set, then the '--power' option is automatically implied for `zpool online` and `zpool clear` and does not need to be passed. zpool status also gets a --power option to print the slot power status. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Mart Frauenlob <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes openzfs#15662
Add `zpool` flags to control the slot power to drives. This assumes your SAS or NVMe enclosure supports slot power control via sysfs. The new `--power` flag is added to `zpool offline|online|clear`: zpool offline --power <pool> <device> Turn off device slot power zpool online --power <pool> <device> Turn on device slot power zpool clear --power <pool> [device] Turn on device slot power If the ZPOOL_AUTO_POWER_ON_SLOT env var is set, then the '--power' option is automatically implied for `zpool online` and `zpool clear` and does not need to be passed. zpool status also gets a --power option to print the slot power status. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Mart Frauenlob <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #15662
Add `zpool` flags to control the slot power to drives. This assumes your SAS or NVMe enclosure supports slot power control via sysfs. The new `--power` flag is added to `zpool offline|online|clear`: zpool offline --power <pool> <device> Turn off device slot power zpool online --power <pool> <device> Turn on device slot power zpool clear --power <pool> [device] Turn on device slot power If the ZPOOL_AUTO_POWER_ON_SLOT env var is set, then the '--power' option is automatically implied for `zpool online` and `zpool clear` and does not need to be passed. zpool status also gets a --power option to print the slot power status. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Mart Frauenlob <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes openzfs#15662
Add `zpool` flags to control the slot power to drives. This assumes your SAS or NVMe enclosure supports slot power control via sysfs. The new `--power` flag is added to `zpool offline|online|clear`: zpool offline --power <pool> <device> Turn off device slot power zpool online --power <pool> <device> Turn on device slot power zpool clear --power <pool> [device] Turn on device slot power If the ZPOOL_AUTO_POWER_ON_SLOT env var is set, then the '--power' option is automatically implied for `zpool online` and `zpool clear` and does not need to be passed. zpool status also gets a --power option to print the slot power status. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Mart Frauenlob <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes openzfs#15662
Motivation and Context
Use
zpool
commands to control enclosure and NVMe slot power. Sometimes it's useful to power off the slot to a misbehaving drive.Description
Add
zpool
flags to control the slot power to drives. This assumes your SAS or NVMe enclosure supports slot power control via sysfs.The new
-0|-1
flags are added tozpool offline|online|clear
:If the
ZPOOL_AUTO_POWER_ON_SLOT
env var is set, then the-1
is automatically implied forzpool online
andzpool clear
and does not need to be passed.Also add a
zpool status -1
option to print the slot power status as a new column.Note: This also adds a
FOR_EACH_VDEV()
/FOR_EACH_LEAF_VDEV()
macro that makes iterating over vdevs a lot easier.How Has This Been Tested?
Tested locally on NVMe and SAS enclosures.
Types of changes
Checklist:
Signed-off-by
.