Skip to content

RBMC: Add rbmctool redundancy override options #98

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

Open
wants to merge 1 commit into
base: 1120
Choose a base branch
from

Conversation

spinler
Copy link
Contributor

@spinler spinler commented Jun 16, 2025

Add options to set or clear the DisableRedundancyOverride D-Bus property that manually disables redundancy:

-s,--set-disable-redundancy-override Excludes: --clear-disable-redundancy-override
                            Set override to disable redundancy

-c,--clear-disable-redundancy-override Excludes: --set-disable-redundancy-override
                            Clear override to disable redundancy

Also refactor the CLI11 argument handling to add option groups to make it more explicit that only one argument can be handled at a time. This changes the help text a bit. It now looks like:

$ ./rbmctool -h
RBMC Tool
[Exactly 1 of the following options is required]
Usage: ./rbmctool [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
[Option Group: Display RBMC information]
  Options:
    -d                          Display basic RBMC information
    -e Needs: -d                Add in extended details
[Option Group: Modify the redundancy override]
  Options:
    -s,--set-disable-redundancy-override Excludes: --clear-disable-redundancy-override
                                Set override to disable redundancy
    -c,--clear-disable-redundancy-override Excludes: --set-disable-redundancy-override
                                Clear override to disable redundancy
[Option Group: Reset sibling BMC]
  Options:
    --reset-sibling             Reset the sibling BMC

Finally, it also does some small clean up to remove some unnecessary co_return statements and also return nonzero if the sibling reset option fails.

Testing:

When it works:

$ ./rbmctool -s
<6> Setting disable redundancy override to True

$ ./rbmctool -d | grep Enabled
Redundancy Enabled:  false

$ ./rbmctool -c
<6> Setting disable redundancy override to False

$ ./rbmctool -d | grep Enabled
Redundancy Enabled:  true

When it fails:

$ ./rbmctool -s
<6> Setting disable redundancy override to True
Error: Setting cannot be modified now (see journal for details)

Change-Id: I89b26bd6b744ee282ae643094adca4cf891098ae

Add options to set or clear the `DisableRedundancyOverride` D-Bus
property that manually disables redundancy:

```
-s,--set-disable-redundancy-override Excludes: --clear-disable-redundancy-override
                            Set override to disable redundancy

-c,--clear-disable-redundancy-override Excludes: --set-disable-redundancy-override
                            Clear override to disable redundancy
```

Also refactor the CLI11 argument handling to add option groups to make
it more explicit that only one argument can be handled at a time. This
changes the help text a bit. It now looks like:

```
$ ./rbmctool -h
RBMC Tool
[Exactly 1 of the following options is required]
Usage: ./rbmctool [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
[Option Group: Display RBMC information]
  Options:
    -d                          Display basic RBMC information
    -e Needs: -d                Add in extended details
[Option Group: Modify the redundancy override]
  Options:
    -s,--set-disable-redundancy-override Excludes: --clear-disable-redundancy-override
                                Set override to disable redundancy
    -c,--clear-disable-redundancy-override Excludes: --set-disable-redundancy-override
                                Clear override to disable redundancy
[Option Group: Reset sibling BMC]
  Options:
    --reset-sibling             Reset the sibling BMC
```

Finally, it also does some small clean up to remove some unnecessary
co_return statements and also return nonzero if the sibling reset option
fails.

Testing:

When it works:
```
$ ./rbmctool -s
<6> Setting disable redundancy override to True

$ ./rbmctool -d | grep Enabled
Redundancy Enabled:  false

$ ./rbmctool -c
<6> Setting disable redundancy override to False

$ ./rbmctool -d | grep Enabled
Redundancy Enabled:  true

```

When it fails:
```
$ ./rbmctool -s
<6> Setting disable redundancy override to True
Error: Setting cannot be modified now (see journal for details)
```

Change-Id: I89b26bd6b744ee282ae643094adca4cf891098ae
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
@spinler spinler force-pushed the phosphor-state-manager-rbmctool branch from 3b15146 to 9746114 Compare June 16, 2025 19:02
app.add_flag("-e", extended, "Add extended RBMC details to the display")
auto* displayGroup = app.add_option_group("Display RBMC information");
auto* flag =
displayGroup->add_flag("-d", info, "Display basic RBMC information");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the the -d shows if the override is being used to enable/disable redundancy? If not can we add that (maybe under -e) so we know the value of the override?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's built in already:

root@huygens:~# rbmctool -s
<6> Setting disable redundancy override to True
root@huygens:~# rbmctool -de

Local BMC
-----------------------------
Role:                Active
BMC Position:        0
Redundancy Enabled:  false
BMC State:           Ready
Failovers Allowed:   false
FW version hash:     7969307F
Provisioned:         true
Role Reason:         Sibling is already passive
Reasons for no BMC redundancy:
    Manually disabled    <---------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants