A saved configuration file can be loaded to the candidate configuration with the rollback command.
The configuration is saved automatically after every successful commit when automatic save is enabled via the MD-CLI, NETCONF, or gRPC auto-config-save commands. Nokia recommends that the auto-config-save values are configured the same for all model-driven interfaces.
*[ex:/configure system management-interface]
A:admin@node-2# info detail
---snip---
md-cli {
auto-config-save true
environment {
more true
time-display local
command-completion {
enter true
space true
tab true
}
The configuration is also saved if an operator issues the admin save command, regardless of the auto-config save settings.
The rollback command loads a previously saved configuration file to the candidate configuration. Loading the file does not automatically initiate a commit command, and the candidate can be examined before committing. The rollback command is the equivalent of a load full-replace of the configuration file, but is identified with the commit history identifier. If no identifier is specified, the last saved configuration file in the most recent commit history entry is used as the default.
The rollback command is available only in model-driven management interface configuration mode.
[ex:/configure]
A:admin@node-2# rollback ?
rollback
[checkpoint] (<number> | <keyword>)
<number> - <0..4294967295>
<keyword> - startup
ID corresponding to the configuration file to roll back
[ex:/configure]
A:admin@node-2# rollback Press Tab
<commit-id>
startup
4
Committed 2022-02-01T11:13:38.7-05:00 by admin (MD-CLI) from 10.1.236.68
Comment "Fourth commit with NETCONF."
Location "cf3:\config.cfg"
3
Committed 2022-02-01T11:01:03.8-05:00 by admin (MD-CLI) from 10.1.145.205
Comment "Third commit with the MD-CLI."
Location "cf3:\config.cfg.1"
2
Committed 2022-02-01T11:00:47.7-05:00 by admin (MD-CLI) from 10.1.145.205
Comment "Second commit with the MD-CLI."
Committed 2022-02-01T10:56:01.3-05:00 by system (MD-CLI) from Console
Log "System booted version 22.2.R1."
Location "cf3:\config.cfg.2"
Configuration files loaded with the rollback command are identified with a number that corresponds to the commit history identifier and location specified configured by the bof configuration primary-location command in the active CPM’s Boot Option File (BOF).
For example, the configuration file executed for a rollback 3 command corresponds to the file location in commit history identifier 3. The keyword startup and commit history identifier 0 correspond to the last saved configuration file. This is also the default when no identifier is specified with the rollback command. By default, five configuration files are saved. The configuration-backups command can be used to save a different number of configuration files.
[ex:/configure system management-interface configuration-save]
A:admin@node-2# info detail
## apply-groups
## apply-groups-exclude
configuration-backups 5
[ex:/configure system management-interface configuration-save]
A:admin@node-2# configuration-backups
configuration-backups <number>
<number> - <1..200>
Default - 5
Maximum number of backup versions maintained
The admin show configuration bof command is executed from the MD-CLI and shows the name of the file as config.cfg.
[/]
A:admin@node-2# admin show configuration bof | match primary-location
primary-location "cf3:\config.cfg"
---snip---
In the MD-CLI, the rollback command references the file in the location of the commit history identifier, in this case, identifier 3.
[ex:/configure]
A:admin@node-2# rollback 3
Executed 386 lines in 0.4 seconds from file cf3:\config.cfg.3
The rollback command can only be executed from the root of the configuration branch.
The startup option of the rollback command loads the contents of the current admin save file set with the primary configuration and not the version of the startup file that was booted.
When auto-config-save is set to true, the rollback command (without an index) is the equivalent of executing the discard command for the current candidate configuration changes.
The following figures show the relationship between the candidate and running configurations, the commit command, the setting of the auto-config-save parameter, and the saved configuration files.
In the following figure, auto-config-save is set to true. With a successful commit, a commit history entry is created and the configuration file is saved.
In the following figure, auto-config-save is set to false. The admin save command saves the running configuration before the commit is issued. However, a commit entry is created without saving the configuration.
In the following figure, the commit fails and no commit history entry or saved configuration file is created, regardless of the auto-config-save setting.