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

eos: Rollback should revert to the running config, not the startup config. #1952

Open
ichilton opened this issue May 28, 2023 · 1 comment
Open

Comments

@ichilton
Copy link

ichilton commented May 28, 2023

Description of Issue/Question

The code in the commit_config method of the eos driver uses the following commands:

            commands = [
                "copy startup-config flash:rollback-0",
                "configure session {} commit".format(self.config_session),
                "write memory",
            ]

src:

"copy startup-config flash:rollback-0",

I would argue this is incorrect. It should save the running configuration, not the startup configuration.

There is no guarantee that the configuration was recently saved/written and therefore the running config could be completely different from the startup config.

I believe it should either save the running config for rollback or do a write before the change, like:

            commands = [
                "write memory",
                "copy startup-config flash:rollback-0",
                "configure session {} commit".format(self.config_session),
                "write memory",
            ]

Setup

napalm version

napalm==4.1.0

Network operating system version

4.29.3M
@ktbyers
Copy link
Contributor

ktbyers commented May 30, 2023

NAPALM on commit_config() should always save the running-config to the startup-config and the startup-config is the permanent config (i.e. is the "durable" state of things wrt ACID transactions i.e. it is what the system will revert to in a reboot event).

So I think NAPALM is doing this correctly.

There is no guarantee that the configuration was recently saved/written and therefore the running config could be completely different from the startup config.

You can always separately call write mem (if you are not confident in your sync state between running-config and startup-config).

If changes came from outside NAPALM, I don't think it is correct for NAPALM to just sync them i.e. the person or process that made the changes should ensure they are synced.

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

No branches or pull requests

2 participants