Big config replacement on IOS-XE fails

Hi all!

I am having troubles replacing a quite big configuration (3000+ lines) with nornir on a Cisco IOS-XE box.
The replace task fails with the error “OSError: Search pattern never detected in send_command_expect: (?:[>##]\s*$|.*all username.*confirm)”.
On the box itself the configuration does get replaced.
So my assumption is, that the IOS-XE box is too busy rendering that big config, so it does not answer the ssh connection in time.

Did anyone else have similar issues?
Or can someone tell, if my assumption is feasible, and how I could proceed here?

Thank you very much in advance!

1 Like

I would manually test the “configuration replace” operation and see how long it takes and whether anything unusual happens when you do it.

The command should be (flash: might be different depending on your device)

configure replace flash:/candidate_config.txt force revert trigger error

This is assuming you are doing a full configuration replace. Make sure your “candidate_config.txt” is correct, however, i.e. the file you want to load.

Hi!
Thanks for the hint!
It turned out to be a missing default config line in the OOB management interface!

The replacing configuration has

!
interface GigabitEthernet0
description ### OOB Management ###
vrf forwarding Mgmt-intf
ip address 192.168.1.3 255.255.255.0
end

but after the “config replace …” it is changed to

!
interface GigabitEthernet0
description ### OOB Management ###
vrf forwarding Mgmt-intf
ip address 192.168.1.3 255.255.255.0
negotiation auto
end

That new line “negotiation auto” toggles the management interface, and I assume this is the reason why the ssh session gets in trouble and never sees the expected answer.

I added that line to the template, and it is working now.

Thanks,
Thomas

1 Like