NXOS Save_Config Appears To Wait For Completion
See original GitHub issuei have two threads connecting to the same box. Netmiko appears to be waiting till save_config() completes with proper response before moving down my code. I need my 2nd thread to execute WHILE a save is occuring. I have 1 min 8 secs to do this.
Im using threading + semaphore. so Im locking and unlocking threads.
Automation : Im trying to perform a config change in a 2nd session while saving in the 1st. I need the change to occur inside the window while its saving. I cannot get the 2nd session to do it.
BAD RESULT
Tue Aug 17 15:12:22 2021:type=update:id=10.24.63.196@pts/5:user=admin:cmd=Performing configuration copy.
Tue Aug 17 15:12:25 2021:type=start:id=vsh.bin.3792:user=admin:cmd=
Tue Aug 17 15:13:29 2021:type=update:id=10.24.63.196@pts/5:user=admin:cmd=copy running-config startup-config (SUCCESS)
GOOD RESULT
Tue Aug 17 15:05:23 2021:type=update:id=10.24.63.196@pts/0:user=admin:cmd=Performing configuration copy.
Tue Aug 17 15:05:26 2021:type=start:id=vsh.bin.18707:user=admin:cmd=
Tue Aug 17 15:05:28 2021:type=update:id=10.24.63.196@pts/3:user=admin:cmd=configure terminal ; no route-map CUSTOM_ROUTE_MAP
-OUT permit 5148 (SUCCESS)
Tue Aug 17 15:06:31 2021:type=update:id=10.24.63.196@pts/0:user=admin:cmd=copy running-config startup-config (SUCCESS)
hostname3#
THIS IS THE SAVE_CONFIG FUNCTION FOR NXOS
def save_config(
self,
cmd="copy running-config startup-config",
confirm=False,
confirm_response="",
):
self.enable()
if confirm:
output = self.send_command_timing(
command_string=cmd, strip_prompt=False, strip_command=False
)
if confirm_response:
output += self.send_command_timing(
confirm_response, strip_prompt=False, strip_command=False
)
else:
# Send enter by default
output += self.send_command_timing(
self.RETURN, strip_prompt=False, strip_command=False
)
else:
# NX-OS is very slow on save_config ensure it waits long enough.
# FIX: this is a hack as delay_factor will be set to .1 via fast_cli=True in
# send_command so increase max_loops.
output = self.send_command(
command_string=cmd,
strip_prompt=False,
strip_command=False,
max_loops=5000,
)
return output
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Cisco Nexus 3000 Series NX-OS Software Upgrade and ...
Only after the BIOS upgrade is complete, it allows the system to perform fast-reload to Release 7.0(3)I2(1) or later releases.
Read more >Installing NX-OS and Reference Configuration Files (RCFs)
Copy complete, now saving to disk (please wait)... Copy complete. 4. Verify the running version of the NX-OS software: cs2# show version.
Read more >timeout trying to send command: copy running-config startup ...
SUMMARY On the NX-OS platform where save operations take more than 10 seconds the module fails with timeout trying to send command: copy ......
Read more >4 Maintaining Other Exadata Database Machine Components
Restoring Settings on a Cisco Nexus 9336C-FX2 RoCE Network Fabric Switch You can restore the Cisco ... 100% Copy complete, now saving to...
Read more >Developer Guide OpenShift Container Platform 3.11
Including builder here ensures this ImageStreamTag appears in the web ... The pipeline will wait until the deployment has completed to trigger the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
write_channel() worked. Thank you
On Tue, Aug 17, 2021 at 10:21 AM Kirk Byers @.***> wrote:
– Nate Demers
You could just use
write_channel("copy running-config startup-config\n")
Note, any subsequent
read_channel()
call on this SSH session will still retrieve whatever that SSH session is doing (i.e. it won’t do anything else on that given SSH session until thecopy run start
is complete).Note, it is possible/likely that NX-OS does not allow config changes while
copy run start
is underway (i.e. there is a good chance even multiple SSH sessions does not allow this at the NX-OS level).Kirk