See the following
configuration examples for configuration replace:
-
Use the
configure replace
bootflash:
<file>
show-patch
CLI command to display the difference between the running-configurations and
user-provided configurations.
switch(config)# configure replace bootflash:<file> show-patch
Collecting Running-Config
Converting to checkpoint file
#Generating Rollback Patch
!!
no role name abc
-
Use the
configure replace
bootflash:
<file>
verbose CLI
command to replace the entire running-configuration in the switch with the
user-configuration.
switch(config)# configure replace bootflash:<file> verbose
Collecting Running-Config
Generating Rollback patch for switch profile
Rollback Patch is Empty
Note: Applying config parallelly may fail Rollback verification
Collecting Running-Config
#Generating Rollback Patch
Executing Rollback Patch
========================================================
config t
no role name abc
========================================================
Generating Running-config for verification
Generating Patch for verification
Rollback completed successfully.
Sample Example with adding of BGP configurations.
switch(config)# sh run | section bgp
switch(config)# sh file bootflash:file | section bgp
feature bgp
router bgp 1
address-family ipv4 unicast
neighbor 1.1.1.1
switch(config)#
switch(config)# configure replace bootflash:file verbose
Collecting Running-Config
Generating Rollback patch for switch profile
Rollback Patch is Empty
Note: Applying config parallelly may fail Rollback verification
Collecting Running-Config
#Generating Rollback Patch
Executing Rollback Patch
========================================================
config t
feature bgp
router bgp 1
address-family ipv4 unicast
neighbor 1.1.1.1
========================================================
Generating Running-config for verification
Generating Patch for verification
Rollback completed successfully.
switch(config)# sh run | section bgp
feature bgp
router bgp 1
address-family ipv4 unicast
neighbor 1.1.1.1
Sample Example with ACL
switch(config)# configure replace bootflash:run_1.txt
Collecting Running-Config
Generating Rollback patch for switch profile
Rollback Patch is Empty
Note: Applying config parallelly may fail Rollback verification
Collecting Running-Config
#Generating Rollback Patch
Executing Rollback Patch
========================================================
config t
no ip access-list nexus-50-new-xyz
ip access-list nexus-50-new-xyz-jkl-abc
10 remark Newark
20 permit ip 17.31.5.0/28 any
30 permit ip 17.34.146.193/32 any
40 permit ip 17.128.199.0/27 any
50 permit ip 17.150.128.0/22 any
========================================================
Generating Running-config for verification
Generating Patch for verification
Rollback completed successfully.
switch(config)#
switch(config)# show run aclmgr | sec nexus-50-new-xyz-jkl-abc
ip access-list nexus-50-new-xyz-jkl-abc
10 remark Newark
20 permit ip 17.31.5.0/28 any
30 permit ip 17.34.146.193/32 any
40 permit ip 17.128.199.0/27 any
50 permit ip 17.150.128.0/22 any
-
Use the configure replace bootflash:user-config.cfg verify-only CLI command to generate and verify the patch semantically.
switch(config)# configure replace bootflash:user-config.cfg verify-only
Version match between user file and running configuration.
Pre-check for User config PASSED
Collecting Running-Config
Converting to checkpoint file
Generating Rollback Patch
Validating Patch
========================================================
`config t `
`interface Ethernet1/1`
`shutdown`
`no switchport trunk allowed vlan`
`no switchport mode`
`no switchport`
`exit`
Skip non dme command for CR validation
`interface Vlan1`
`shutdown`
`interface Ethernet1/1`
`shutdown`
`no switchport`
`ip address 1.1.1.1/24`
`exit`
Skip non dme command for CR validation
=============================================
Patch validation completed successful
switch(config)#
-
Use the configure replace bootflash:user-config.cfg best-effort verify-and-commit CLI command to replace the switch running configuration with the given user configuration after performing the sematic validation
on patch.
switch(config)# configure replace bootflash:user-config.cfg best-effort verify-and-commit
Version match between user file and running configuration.
Pre-check for User config PASSED
ADVISORY: Config Replace operation started...
Modifying running configuration from another VSH terminal in parallel
is not recommended, as this may lead to Config Replace failure.
Collecting Running-Config
Generating Rollback patch for switch profile
Rollback Patch is Empty
Collecting Running-Config
Generating Rollback Patch
Validating Patch
Patch validation completed successful
Executing Rollback Patch
During CR operation,will retain L3 configuration
when vrf member change on interface
Generating Running-config for verification
Generating Rollback Patch
Configure replace completed successfully. Please run 'show config-replace log exec' to see if there is any configuration that requires reload to take effect.
switch(config)#
-
Use the show config-replace log exec CLI command to check all the configuration that is executed and failures if any.
switch(config)# show config-replace log exec
Operation : Rollback to Checkpoint File
Checkpoint file name : .replace_tmp_28081
Scheme : tmp
Rollback done By : admin
Rollback mode : atomic
Verbose : enabled
Start Time : Wed, 06:39:34 25 Jan 2017
--------------------------------------------------------------------------------
time: Wed, 06:39:47 25 Jan 2017
Status: SUCCESS
End Time : Wed, 06:39:47 25 Jan 2017
Rollback Status : Success
Executing Patch:
----------------
switch#config t
switch#no role name abc
-
Use the
show config-replace log
verify CLI command to check the failed configuration if any.
switch(config)# show config-replace log verify
Operation : Rollback to Checkpoint File
Checkpoint file name : .replace_tmp_28081
Scheme : tmp
Rollback done By : admin
Rollback mode : atomic
Verbose : enabled
Start Time : Wed, 06:39:34 25 Jan 2017
End Time : Wed, 06:39:47 25 Jan 2017
Status : Success
Verification patch contains the following commands:
---------------------------------------------------
!!
! No changes
--------------------------------------------------------------------------------
time: Wed, 06:39:47 25 Jan 2017
Status: SUCCESS
-
Use the
show config-replace
status CLI command to check the status of configuration replace.
switch(config)# show config-replace status
Last operation : Rollback to file
Details:
Rollback type: atomic replace_tmp_28081
Start Time: Wed Jan 25 06:39:28 2017
End Time: Wed Jan 25 06:39:47 2017
Operation Status: Success
switch(config)#
Configure Replace might fail when the manually created configuration is used instead of the configuration generated from the
switch. The reason for possible failures is the potential difference in the default configuration that isn't shown in the
show running configuration. Refer to the following examples:
If the power redundant command is the default command, it doesn't get displayed in the default configuration. But it's displayed
when you use the show run all command. See the following example:
switch# show run all
!Command: show running-config all
!Running configuration last done at: Tue Nov 12 11:07:44 2019
!Time: Tue Nov 12 11:16:09 2019
version 9.3(1) Bios:version 05.39
power redundancy-mode ps-redundant
no hardware module boot-order reverse
no license grace-period
<snip>
hostname n9k13
The power redundant command isn't shown in the show running configuration command out. See the following example:
!Command: show running-config
!Running configuration last done at: Tue Nov 12 11:07:44 2019
!Time: Tue Nov 12 11:17:24 2019
version 9.3(1) Bios:version 05.39
hostname n9k13
When the power redundancy-mode ps-redundant command is added in the user configuration for the configure replace; then the verification/commit might fail. See the following
example:
switch# show file bootflash:test
!Command: show running-config
!Running configuration last done at: Tue Nov 12 10:56:49 2019
!Time: Tue Nov 12 11:04:57 2019
version 9.3(1) Bios:version 05.39
power redundancy-mode ps-redundant
hostname n9k13
The power redundancy-mode ps-redundant command will not be shown in the show running after configure replace; therefore it will be considered as “missing” and the
CR will fail. An example is given below.
switch# config replace bootflash:test verify-and-commit
Version match between user file and running configuration.
Pre-check for User config PASSED
ADVISORY: Config Replace operation started...
Modifying running configuration from another VSH terminal in parallel
is not recommended, as this may lead to Config Replace failure.
Collecting Running-Config
Generating Rollback patch for switch profile
Rollback Patch is Empty
Collecting Running-Config
.Generating Rollback Patch
Validating Patch
Patch validation completed successful
Executing Rollback Patch
During CR operation,will retain L3 configuration
when vrf member change on interface
Generating Running-config for verification
Generating Rollback Patch
Executing Rollback Patch
During CR operation,will retain L3 configuration
when vrf member change on interface
Generating Running-config for verification
Generating Patch for verification
Verification failed, Rolling back to previous configuration
Collecting Running-Config
Cleaning up switch-profile buffer
Generating Rollback patch for switch profile
Executing Rollback patch for switch profiles. WARNING - This will change the
configuration of switch profiles and will also affect any peers if configured
Collecting Running-Config
Generating Rollback Patch
Rollback Patch is Empty
Rolling back to previous configuration is successful
Configure replace failed. Use 'show config-replace log verify' or 'show config-replace
log exec' to see reasons for failure
n9k13# show config-replace log verify
Operation : Config-replace to user config
Checkpoint file name : .replace_tmp_31849
Scheme : tmp
Cfg-replace done By : agargula
Cfg-replace mode : atomic
Verbose : disabled
Start Time : Tue, 11:20:59 12 Nov 2019
Start Time UTC : Tue, 10:20:59 12 Nov 2019
-------------------------------------------
End Time : Tue, 11:21:28 12 Nov 2019
End Time UTC : Tue, 10:21:28 12 Nov 2019
Status : Failed
Verification patch contains the following commands:
---------------------------------------------------
!!
Configuration To Be Added Missing in Running-config
===================================================
!
power redundancy-mode ps-redundant
Undo Log
--------------------------------------------------------------------------------
End Time : Tue, 11:21:32 12 Nov 2019
End Time UTC : Tue, 10:21:32 12 Nov 2019
Status : Success
n9k13#
In the above example, CR will consider the default commands that are missing and will therefore fail.