fix: pick the correct manager/system on multi-system, multi-chassis hosts#108
Open
shevchenko-evgeny wants to merge 3 commits into
Open
fix: pick the correct manager/system on multi-system, multi-chassis hosts#108shevchenko-evgeny wants to merge 3 commits into
shevchenko-evgeny wants to merge 3 commits into
Conversation
…osts Match the system by presence of a Bios resource and select the manager whose Links.ManagerForServers references it, instead of blindly taking the first entry. Adds ManagerLinks, get_manager_with_id, is_bios_attributes. Signed-off-by: Evgeny Shevchenko <eshevchenko@mirantis.com>
| // call set_system_id always before calling set_vendor | ||
| s.set_system_id(system_id)?; | ||
|
|
||
| // Try to find manager with ManagerForServers related to System |
There was a problem hiding this comment.
It might be better to look at the ManagedBy Link on the chosen System to pick the manager instead of traversing all managers for the selected System:
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/BMC_0"
}
],
Author
There was a problem hiding this comment.
good idea!
implemented that way
|
|
||
| //Find another system with BIOS section | ||
| let mut system_with_bios = None; | ||
| for system_member in &systems { |
There was a problem hiding this comment.
Would be better to use the bios property on the fetched System itself:
for id in &systems {
let Ok((_, system)) = s
.client
.get::<ComputerSystem>(&format!("Systems/{id}"))
.await
else {
break; // Use the existing fallback.
};
if system.bios.is_some() {
system_id = id;
break;
}
}
- model: add `bios: Option<ODataId>` to ComputerSystem so BIOS presence can
be read straight off the system resource.
- standard: replace is_bios_attributes() (a separate Systems/{id}/Bios GET +
404 check) with if_system_has_bios(), which fetches the ComputerSystem once
and returns it when it carries a Bios link.
- network: pick the BIOS-bearing system, take manager_id from its
Links.ManagedBy[0] (falling back to the first manager), and drop the
per-manager get_manager_with_id scan.
Signed-off-by: Evgeny Shevchenko <eshevchenko@mirantis.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Match the system by presence of a Bios resource and select the manager whose Links.ManagerForServers references it, instead of blindly taking the first entry.