Rollbacks

Introduction

NSO support creating rollback files during the commit of a transaction that allows for rolling back the introduced changes. Rollbacks does not come without a cost and should be disabled if the functionality is not going to be used. Enabling rollbacks impact both the time it takes to commit a change and requires sufficient storage on disk.

Rollback files contain a set of headers and the data required to restore the changes that were made when the rollback was created. One of the header fields includes a unique rollback id that can be used to address the rollback file independent of the rollback numbering format.

Rollback file numbering and content are configurable and care needs to be taken if using 'rolling' numbering as the content of the rollback of a given number will change whenever a new rollback is created.

When retrieving the rollback id from a transaction using any of the supported APIs the 'fixed' number is always returned to avoid race conditions.

Use of rollbacks from the supported APIs and the CLI is documented in the documentation for the given API.

Configuration

NSO is configured through a configuration file - ncs.conf. In that file we have the following items related to rollbacks:

/ncs-config/rollback/enabled

If 'true', then a rollback file will be created whenever the running configuration is modified.

/ncs-config/rollback/directory

Location where rollback files will be created.

/ncs-config/rollback/history-size

Number of old configurations to save.

/ncs-config/rollback/rollback-type

Type of rollback file to use. If 'full' is specified, then a full configuration dump is stored in each rollback file. Rollback file 0 will always contain the running configuration. If 'delta' is used, then only the changes are stored in the rollback file. Rollback file 0 will contain the changes from the last configuration.

Using deltas is more space and time efficient for large configurations. Full rollback files are more robust when multiple external databases are used. If the external databases becomes inconsistent a previous configuration can always be restored using a full rollback file.

/ncs-config/rollback/rollback-numbering

Can be either 'fixed' or 'rolling'. If set to 'rolling' then rollback file '0' will always contain the last commit. When using 'fixed' each rollback will get a unique increasing number.