Skip to content

[Feature]: Create Idempotent Update APIs for SMD #79

@erl-hpe

Description

@erl-hpe

Describe the feature

During the development of OpenCHAMI on vTDS we encountered a problem (ochami issue #55 ([BUG] Adding a BMC that already exists causes an error) with using ochami to do static discovery of nodes in which the blind use of POST operations to register data with SMD caused conflicts when two or more nodes were managed by the same BMC. This was fixed in ochami by deduplicating BMC information, but this only allowed a single pass through node data to work successfully. Any subsequent addition of a node on the same BMC or in the same group as previously discovered nodes would cause conflicts and fail.

The analysis of this is as follows:

The ochami discover static command parses the input it is given (whether a file containing node data or a JSON structure containing node data) and submits the contents of the file sequentially in a set of per-node operations that do the following:
POST component information about each node to SMD
POST component information about the BMC (Redfish Endpoint) taken from each node to SMD
POST 'rfe' (RedFish Endpoint) information taken from each node to SMD
POST 'iface' (Ethernet Interface) information taken from each node to SMD
POST a 'group' definition comprised of the group name, description, and the list of nodes to SMD
This was causing conflicts and failures when the node data contained the same BMC data in two or more nodes. By deduplicating the incoming BMC data in ochami it was possible to get past this for a single invocation of static discovery.

The limitation of this, however, is that, since ochami blindly POSTs this information to SMD, if a new node is added to an existing BMC or if a new node is added to an existing 'group' within SMD, and ochami discover static is used to make that change, the data, no matter how carefully collated by the command, will conflict with data already POSTed to SMD in the previous invocation, and the new node will not be completely created.

The obvious, but wrong thing to do is to change ochami discover static to pull data from SMD, massage it, and then PUT the data back on SMD. The reason this won't work well is that there is a cache coherency problem within ochami if two or more people are using ochami at the same time.

The alternative is to modify SMD to have idempotent methods of posting node / bmc and group data in a single atomic chunk. As far as I am aware, an API like that does not exist today, so we would need to modify both SMD and ochami to fix this issue.

The requested feature, then, is to create or modify the SMD APIs to provide an idempotent way to present the data necessary to add a node to SMD and then modify ochami to use that mechanism instead of what it uses today.

Why do you want this feature?

This feature is important to any administrator trying to update SMD with additional node data once initial node data have been ingested. As it stands today, subsequent runs of ochami discover static or similar mechanisms after initial node discovery will encounter collisions and fail.

Alternatives you've considered

As described, we addressed the first run collision issue in ochami by deduplicating data. Extending that solution to subsequent runs, however, would require ochami to fetch from SMD then update SMD which presents the specter of cache coherency and concurrency issues that could corrupt the SMD content. At the moment, I do not see a viable alternative to this feature.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions