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

Regen factory on every boot #180

Merged
merged 3 commits into from
Oct 30, 2023
Merged

Regen factory on every boot #180

merged 3 commits into from
Oct 30, 2023

Conversation

troglobit
Copy link
Contributor

@troglobit troglobit commented Oct 26, 2023

This PR fixes the annoying "RMA" issue we've seen over the past week or so. Instead of saving factory-config and failure-config to /cfg, we now regenerate them on each boot to match our YANG models. The files are stored in /run/confd/, except for startup-config that remains in /cfg.

It also address the "unsorted interfaces" issue we found in customer bridge created by gen-interfaces today.

Operational experience shows that the current Infix Fail Secure mode,
introduced in ca9daef, does not work in practice.

The factory datastore in sysrepo is created at boot with the YANG models
and the factory-config file.  When the factory-config file is generated
from older versions of these models, the resulting datastore may fail to
pass the validation and system will end up in an unrecoverable state.

Instead, both the factory-config and failure-config must be created at
every boot to match the YANG models in the active Linux image.  This
ensures loading the YANG models will always work and the system can
proceed to attempt to load startup-config to the running datastore.

If loading startup-config fails we can fall back to failure-config,
which like factory-config, will then provide a way to log in an dianose
the system.

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit added the enhancement New feature or request label Oct 26, 2023
@troglobit troglobit requested a review from wkz October 26, 2023 16:00
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

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

I think the version sort thing is worth looking into. Other than that this look 💯 👍

src/confd/bin/gen-interfaces Outdated Show resolved Hide resolved
src/confd/bin/gen-interfaces Outdated Show resolved Hide resolved
A list of interfaces: x10 x9 x8 x7 x6 x5 x4 x1 x2 x3 should be sorted in
order with x10 last.  Using the common 'sort -n' would generate: x1 x10
x2 ... so we use version sort.  This way we can ensure that the order of
bridge ports is natural and what end users expect.

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit force-pushed the regen-factory-on-every-boot branch from abf5fe3 to 07a8b6b Compare October 30, 2023 10:22
@troglobit troglobit requested a review from wkz October 30, 2023 10:23
@wkz wkz merged commit fc5310b into main Oct 30, 2023
2 checks passed
@wkz wkz deleted the regen-factory-on-every-boot branch October 30, 2023 11:48
@troglobit troglobit added this to the Infix v23.10 milestone Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants