The Cisco NX-OS software has two types of configuration files: running configuration and startup configuration. The device uses the startup configuration (startup-config) during device startup to configure the software features. The running configuration (running-config) contains the current changes that you make to the startup configuration file. The two configuration files can be different. You might want to change the device configuration for a short time rather than permanently. In this case, you would change the running configuration by using commands in global configuration mode but not save the changes to the startup configuration.
Configuration files contain the Cisco NX-OS software commands used to configure the features on a Cisco Nexus device. Commands are parsed (translated and executed) by the Cisco NX-OS software when the system is booted (from the startup-config file) or when you enter commands at the CLI in a configuration mode.
To change the startup configuration file, you need to save the running-configuration file to the startup configuration using the following command:
copy running-config startup-config
The NX-OS copy command also can be used to back up the running configuration to the remote server using tftp: or ftp: or scp: or sftp: protocols:
copy running-config scheme://server/[url /]filename
You can configure Cisco NX-OS by using a file saved on the remote server. The command is similar, except that the source is the remote file and the destination is the running configuration:
copy scheme://server/[url /]filename running-config
Many automation tools provide config archive and config change tracking. Cisco Prime is one Cisco tool that offers regular configuration archives.
Nexus Config Rollback and Checkpoint
The NX-OS rollback feature enables you to take a snapshot, or user checkpoint, of Cisco NX-OS configuration and then reapply that configuration to the device at any point without having to reload the device. A rollback allows any authorized user to apply this checkpoint configuration without requiring expert knowledge of the features configured in the checkpoint.
Cisco NX-OS automatically creates system checkpoints. You can use either a user or system checkpoint to perform a rollback. You can create a checkpoint copy of the current running configuration at any time by using this command:
checkpoint {[ cp-name ] [ description descr ] | file filename }
Cisco NX-OS saves this checkpoint as an ASCII file that you can use to roll back the running configuration to the checkpoint configuration at a future time. You can create multiple checkpoints to save different versions of your running configuration.
To roll back the running configuration, you use the following command:
rollback running-config { checkpoint cp-name | file cp-file } [ atomic |
best-effort | stop-at-first-failure ]
The rollback trigger types are
atomic: Implements a rollback only if no errors occur
best-effort: Implements a rollback and skips any errors
stop-at-first-failure: Implements a rollback that stops if an error occurs
The default rollback type is atomic.
When you are ready to roll back to a checkpoint configuration, you can view the changes that will be applied to the current running configuration before committing to the rollback operation using show diff rollback-patch.
show diff rollback-patch { checkpoint src-cp-name | running-config |
startup-config | file source-file } { checkpoint dest-cp-name | running-config
| startup-config | file dest-file }
If an error occurs during the rollback operation, you can choose to cancel the operation, or you can ignore the error and proceed with the rollback. If you cancel the operation, Cisco NX-OS provides a list of changes already applied before the error occurred. You need to clean up these changes manually.
After creating a checkpoint, you can verify the difference between the checkpoint and the running-config(if you made any changes to running-config) and rollback by skipping any errors.