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

RBMC: Enable Redundancy #65

Open
wants to merge 5 commits into
base: 1110
Choose a base branch
from

Conversation

spinler
Copy link
Contributor

@spinler spinler commented Jan 8, 2025

This PR has 5 commits, all related to enabling redundancy (actually just setting RedundanceEnabled to true for now).

  1. Add an API to be able to remove a persistent data field.
  2. Add an API that will wait for the sibling to get to BMC ready, as redundancy can only be enabled if the sibling passive BMC is at Ready.
  3. Create a derived class for the Redundancy D-Bus interface so that the DisableRedundancyOverride D-Bus property behavior can be modified to actually do something when it is set.
  4. After the active target has been started, the active BMC will now determine if redundancy can be enabled and set the RedundancyEnabled property appropriately. If it can't be, save the reasons to the persistent data file.
  5. Have rbmctool print the reasons that redundancy can't be enabled for debug.

Add data::remove(<name>) to the persistent data API to remove entries
from the persistent data file.  This will be used for entries that don't
make sense for both roles.

Tested:
New unit tests pass

Signed-off-by: Matt Spinler <[email protected]>
Add a Sibling::waitForBMCSteadyState() function that will wait up to 10
minutes for the sibling BMC state to reach either Ready or Quiesced.

This will be used by the new active BMC to wait for the passive BMC to
reach steady state, as the passive BMC needs to be Ready and not
Quiesced to have redundancy enabled.

There are some clang-tidy warnings turned off as it is complaining about
something down in the stdexec code that sdbusplus uses.

Tested:
Works when called

Signed-off-by: Matt Spinler <[email protected]>
Create a RedundancyInterface D-Bus interface class using the modern
style of sdbusplus bindings.

A class is necessary so that the set of the DisableRedundancyOverride
D-Bus property can actually disable redundancy.  The actual code to
disable redundancy will be implemented in a future commit.  This commit
just handles switching to use the class and provides a location to call
a new function to do the real work.

Tested:
Everything still works

Signed-off-by: Matt Spinler <[email protected]>
@spinler spinler force-pushed the rbmc_enable_redundancy branch from b741e6b to 3bfd733 Compare January 9, 2025 16:28
After the active BMC's systemd target has been started, redundancy can
be enabled if possible.

Call the new getNoRedundancyReasons() function after
sibling.waitForSiblingRole() and sibling.waitForBMCSteadyState() are
used to wait for the sibling's role and Ready state.

If getNoRedundancyReasons() returns reasons redundancy can't be enabled,
then write the text descriptions of those reasons to the data.json file
so they are available for debug and set the RedundancyEnabled property
to false.

If there aren't any reasons, then set the RedundancyEnabled property to
true.

This commit just sets the property, future commits could add more
functionality as it becomes available such as starting a data sync.

A future commit will also put the reasons on D-Bus if that turns out to
be necessary.

Tested:
- Property properly follows results of getNoRedundancyReasons() when
changing various inputs to that function.
- Code will wait for the sibling to reach Ready state before determining
  redundancy.

```
busctl get-property xyz.openbmc_project.State.BMC.Redundancy \
/xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC.Redundancy \
RedundancyEnabled
b true
```

Signed-off-by: Matt Spinler <[email protected]>
Display the reasons preventing redundancy from being enabled in the
rbmctool on the active BMC by getting them from the persistent data
file.

Tested:
Reasons are added to the bottom of the rbmtool output:

Local BMC
-----------------------------
Role:                Active
BMC Position:        0
Redundancy Enabled:  false
BMC State:           Ready
Failovers Paused:    false
FW version hash:     804C5074
Provisioned:         true
Role reason:         BMC is position 0
No redundancy reasons:
    Firmware version mismatch

Signed-off-by: Matt Spinler <[email protected]>
@spinler spinler force-pushed the rbmc_enable_redundancy branch from 3bfd733 to 34b9da7 Compare January 9, 2025 16:40
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.

1 participant