IOS upgrade for Cisco IE-3400
See original GitHub issueHello,
I am testing netmiko for ios upgrade automation. I wanted to try the script so I can understand it.
The device is a Cisco IE-3400 running IOS-XE. I have tried both cisco_ios and cisco_xe but the end result is the same.
The script in question:
https://github.com/ktbyers/netmiko/blob/develop/EXAMPLES.md#adjusting-delay_factor
from netmiko import ConnectHandler
from getpass import getpass
from datetime import datetime
Traffic_IP = [
"10.199.0.38",
]
username = input("USERNAME: ")
cisco1 = {
"host": Traffic_IP[0],
"username": username,
"device_type": "cisco_ios",
"password": getpass(),
}
command = "copy sftp://SFTPBackup1:kODpYI0Jr)Z8YF5@172.26.3.62/images/IOS/IE/ie3x00-universalk9.17.03.04.SPA.bin flash:/ie3x00-universalk9.17.03.04.SPA.bin"
# Start clock
start_time = datetime.now()
net_connect = ConnectHandler(**cisco1)
# Netmiko normally allows 100 seconds for send_command to complete
# delay_factor=4 would allow 400 seconds.
output = net_connect.send_command_timing(
command, strip_prompt=False, strip_command=False, delay_factor=7
)
# Router prompted in this example:
# -------
# cisco1
#copy flash:c880data-universalk9-mz.155-3.M8.bin flash:test1.bin# Destination filename [test1.bin]?
# Copy in progress...CCCCCCC
# -------
if "Destination filename" in output:
print("Starting copy...")
output += net_connect.send_command("\n", delay_factor=7, expect_string=r"!")
net_connect.disconnect()
end_time = datetime.now()
print(f"\n{output}\n")
print("done")
print(f"Execution time: {start_time - end_time}")
The script works as expected, however it finishes without actually copying the image over.
I am wondering what is causing the script to complete but not actually copy over.
Help is greatly appreciated.
Nick
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Cisco Catalyst IE3400 Rugged Series - Install and Upgrade ...
Cisco Catalyst IE3400 Rugged Series - Some links below may open a new browser window to display the document you selected. ... Install...
Read more >Release Notes for Cisco Catalyst IE3x00 Rugged, IE 3400 ...
Example. Upgrading Cisco IOS XE Software Bundle Mode. This example shows the steps to upgrade the Cisco IOS XE software on a switch...
Read more >New Hardware Versions of Cisco Catalyst IE3400 Rugged ...
A new version of the Cisco Catalyst IE3400 Rugged Series and Cisco Catalyst ... with Minimum Software Release - Software Upgrade Recommended.
Read more >Cisco Catalyst IE3400 Rugged Series
Cisco Catalyst IE3400 Rugged Series - Technical support documentation, ... IE3400 Rugged/IE3400 Heavy Duty Series Will Be Supported with Minimum Software ...
Read more >Cisco IOS XE Software Update Program for Cisco Catalyst ...
The Program provides Software updates to customers at no additional charge. It is designed to complement the existing 5-year limited hardware warranty offered ......
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
For this type of operation, I would use send_command and not send_command_timing:
Also probably should set fast_cli=False as an argument to ConnectHandler.
How long does the transfer normally take i.e. what is the expected execution time?
Yeah, this should all be greatly simplified in the next release of Netmiko, but basically you needed to set fast_cli=False so that things get set back to 100 seconds and so that delay_factor works as you would expect (i.e. * 7 = wait for 700 seconds).