PackeTsar / freeztp

An Open-Source Zero-Touch Provisioning System for Cisco IOS.
GNU General Public License v3.0
214 stars 28 forks source link

C3650 stuck when firmware image is discovered #92

Closed brokoler closed 2 years ago

brokoler commented 2 years ago

Hello,

I've been trying to update my WS-C3650-48TS via FreeZTP, but it's failing. tftproot is set to the default /etc/ztp/tftproot/ and file permissions were adjusted via chmod to 777. Factory configuration template is used. I discovered following behavior:

I'm doing an upgrade from cat3k_aaa-universalk99.16.06.07.SPA.bin to cat3k_caa-universalk9.16.12.06.SPA.bin.

ztp configuration parameters:

ztp set suffix -confg ztp set initialfilename network-confg ztp set community secretcommunity ztp set tftproot /etc/ztp/tftproot/ ztp set imagediscoveryfile freeztp_ios_upgrade ztp set file-cache-timeout 10 ztp set imagefile cat3k_caa-universalk9.16.12.06.SPA.bin ztp set image-supression 30 ztp set delay-keystore 1000

ztp show downloads

image

ztp show log tail output:

root@ps-ztp:~# ztp show log tail 2021-10-13 10:16:39: Log file has been cleared 2021-10-13 10:25:32: tracking_class.report: New transfer of (freeztp_ios_upgrade) from (10.6.13.240) detected 2021-10-13 10:25:32: interceptor: Called. Checking the cache 2021-10-13 10:25:32: file_cache.get: File (freeztp_ios_upgrade) requested by (10.6.13.240) not in cache 2021-10-13 10:25:32: interceptor: Cache returned None. Running cfact.lookup procedure 2021-10-13 10:25:32: cfact.lookup: Called. Checking filename (freeztp_ios_upgrade) and IP (10.6.13.240) 2021-10-13 10:25:32: cfact.lookup: Requested filename matches the imagediscoveryfile 2021-10-13 10:25:32: cfact.lookup: #############IOS UPGRADE ABOUT TO BEGIN!!!############# 2021-10-13 10:25:32: interceptor: cfact.lookup returned (True) 2021-10-13 10:25:32: interceptor: Returning ztp_dyn_file instantiated object 2021-10-13 10:25:32: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7f6e71117d70>) 2021-10-13 10:25:32: cfact.request: Called with filename (freeztp_ios_upgrade) and IP (10.6.13.240) 2021-10-13 10:25:32: cfact.request: Filename (freeztp_ios_upgrade) matches the configured imagediscoveryfile 2021-10-13 10:25:32: cfact._check_supression: Called. Checking for image download supression for IP (10.6.13.240) 2021-10-13 10:25:32: cfact._check_supression: Previous session not detected within 30 seconds. 2021-10-13 10:25:32: cfact.request: Returning the value of the imagefile setting (cat3k_caa-universalk9.16.12.06.SPA.bin) 2021-10-13 10:25:32: ztp_dyn_file: File size is 38 bytes 2021-10-13 10:25:32: file_cache.store: Storing {1634113532.334158: {'ipaddr': '10.6.13.240', 'file': <main.ztp_dyn_file instance at 0x7f6e71117d70>, 'filename': 'freeztp_ios_upgrade'}} 2021-10-13 10:25:32: ztp_dyn_file.close: Called. File closing. 2021-10-13 10:25:32: interceptor: Called. Checking the cache 2021-10-13 10:25:32: file_cache.get: File (freeztp_ios_upgrade) requested by (10.6.13.240) found in cache. Checking timeout. 2021-10-13 10:25:32: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning 2021-10-13 10:25:33: tracking_class.report: New transfer of (cat3k_caa-universalk9.16.12.06.SPA.bin) from (10.6.13.240) detected 2021-10-13 10:25:42: file_cache._maintain_cache: Timing out and deleting 1634113532.33:{'ipaddr': '10.6.13.240', 'file': <main.ztp_dyn_file instance at 0x7f6e71117d70>, 'filename': 'freeztp_ios_upgrade'}

Switch CLI output (I did not press any button to cancel ZTP):

Would you like to enter the initial configuration dialog? [yes/no]: Loading freeztp_ios_upgrade from 10.6.13.30 (via Vlan1): ! [OK - 38 bytes] Press RETURN to get started! Oct 13 08:25:38.536: %SSH-5-ENABLED: SSH 1.99 has been enabled Oct 13 08:25:45.876: %AN-6-AN_ABORTED_BY_CONSOLE_INPUT: Autonomic disabled due to User intervention on console. configure 'autonomic' to enable it.

brokoler commented 2 years ago

It's working, TFTP transfer is just really slow with a blocksize of 512 bytes.

I switched to ZTP-Watcher to install firmware updates after the configuration is pushed, which allows me to increase the TFTP transfer size in my merged template.