######################## Configuration Management ######################## This chapter shows how to manage the system configuration. The configuration is loaded at boot time from the ``running://config.boot`` file. If there is an error loading this file, the factory configuration settings are loaded. The boot file cannot be changed. If the admin wants to use different configuration files to later choose between them, the admin must copy the current active configuration into another file to load another file. Save configuration ================== The ``show running | file `` will redirect the output of the currently active configuration into a specific file. *Example:* .. code-block:: none admin@osdx$ show running | file running://saved_config Command's output saved under "saved_config" Filesize: 887.000 B Load configuration ================== The ``load`` command can be used inside the configuration mode to modify the working configuration session. Several options are available. * ``load boot-config``: Uses the disk startup configuration file that was last saved. * ``load factory-config``: Automatically loads the factory configuration settings onto the working configuration session. * ``load file ``: Loads a specific configuration file. Snapshots ========= A *snapshot* shows the state of a system at a particular moment in time. In OSDx, the system state is defined by the configuration that is being run. Snapshots allow you to easily return to a specific configuration state. This is an incredibly powerful tool if you want to quickly change the device configuration. Every time a *commit* or *save* operation is performed, a new snapshot is generated. .. note:: By default, there can be up to five snapshots at the same time (five *commit* snapshots and five *save* snapshots). This parameter can be explicitly changed using the following command: ``set system snapshots limit [0-50]`` If that parameter is set to 0, no snapshots will be generated. And, if that parameter changes and the number of snapshots is greater, then the oldest snapshots will be deleted. Generating snapshots -------------------- Every time a *commit* or *save* operation is performed, a new snapshot is generated. .. note:: This can be changed by selecting the desired option in the following configuration command ``set system snapshots operation ``. Both save/commit operations include the option to add a comment: .. code-block:: none admin@osdx# commit comment Snapshot comment admin@osdx# save comment Snapshot comment *Example:* .. code-block:: none admin@osdx# commit comment Add_VRF_support This way, snapshots can be recognized very quickly: .. code-block:: none admin@osdx$ show snapshot Snapshot Comment --------------------------------------------- 20200501080000_commit Add_VRF_support 20200508153000_commit Add_Policies 20200510200005_commit Remove_Dummy_Interfaces 20200514120037_save Definite_Configuration Snapshot names are formatted like this: ``[YEAR][MONTH][DAY][HOUR][MINUTE][SECOND]_[OPERATION]`` where ``[OPERATION]`` is "commit" or "save". By default, the generation of snapshots for non-commented operations is disabled. It can activated by setting this configuration command: :osdx:cfg:`system snapshots include-uncommented`. Showing and comparing snapshots ------------------------------- The ``show snapshot`` command can be used to print the configuration included in a specific snapshot. It can be used in both operational and configuration menus and a path can be used to retrieve only a particular configuration tree. *Example:* .. code-block:: none admin@osdx# show snapshot 20200519065320_commit path interfaces ethernet eth3 # Teldat OSDx SDE version 202005131344.cc368fc-master-snapshot # Tue May 19 07:00:55 UTC 2020 set interfaces ethernet eth3 address 192.168.213.18/22 You can also compare the current running/working configuration with a snapshot and see the differences between two different snapshots. *Example:* .. code-block:: none admin@osdx$ show changes snapshot 20200519070520_commit # Comment for '20200519070520_commit': Initial_Configuration set interfaces ethernet eth0 traffic policy in DROP_ICMP set traffic policy DROP_ICMP set traffic selector SEL_ICMP If a previous command is executed in the configuration menu, the comparison will be made between the working configuration and the snapshot. *Example:* .. code-block:: none admin@osdx# show changes snapshot 20200519070520_commit # Comment for '20200519070520_commit': Initial_Configuration set interfaces ethernet eth0 traffic policy in DROP_ICMP set interfaces ethernet eth1 traffic policy out DROP_ICMP set traffic policy DROP_ICM The following command allows you to see the differences between two snapshots: ``show changes snapshot snapshot [path ]``. It would display the different commands that need to be issued to reach the *SNAPSHOT_A* configuration state from *SNAPSHOT_B*. *Example:* .. code-block:: none admin@osdx# show changes snapshot 20200519070603_commit snapshot 20200519070520_commit # Comment for '20200519070603_commit': Add_Policies # Comment for '20200519070520_commit': Initial_Configuration set interfaces ethernet eth0 traffic policy in DROP_ICMP set traffic policy DROP_ICMP set traffic selector SEL_ICMP On the other hand, if you swap the snapshots, the required commands would be different. *Example:* .. code-block:: none admin@osdx# show changes snapshot 20200519070520_commit snapshot 20200519070603_commit # Comment for '20200519070520_commit': Initial_Configuration # Comment for '20200519070603_commit': Add_Policies delete interfaces ethernet eth0 delete traffic When comparing a configuration state (running/working/snapshot) with a snapshot that was generated using a different version, a comment will appear pointing out the version of the snapshot. *Example:* .. code-block:: none admin@osdx# show changes snapshot 20200519072903_save snapshot 20200519073016_commit # Version for '20200519072903_save': 202005181818.cc368fc-master-snapshot # Comment for '20200519072903_save': Different_Version # Version for '20200519073016_commit': 202005131344.cc368fc-master-snapshot # Comment for '20200519073016_commit': Add_Policies delete interfaces ethernet eth0 delete traffic Loading snapshots ----------------- Snapshots can be loaded from the configuration menu using the following command: ``load snapshot ``. .. note:: This command does not commit the changes. They are only applied to the working configuration. Therefore, you will be able to modify/discard/commit the configuration.