PackeTsar / freeztp

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

Not able to update image of 3850 #88

Closed Macleykun closed 3 years ago

Macleykun commented 3 years ago

I've been trying for a while to update my 3850 with FreeZTP, but i'm not entirely sure why the upgrade never happens. The tftproot is set on /home/macley/ and it has the default permissions. (i also tried with /etc/ztp/tftproot/ but sadly same issue. Also tried with chmod 777 but alas.

I'm doing an upgrade from cat3k_caa-universalk9.16.09.06.SPA.bin to cat3k_caa-universalk9.16.12.05b.SPA.bin.

The ZTP config is set to do the following: ztp set imagefile cat3k_caa-universalk9.16.12.05b.SPA.bin ztp set image-supression 30

note that all bin files have full read permissions (default).

The logs that i have goes as followed:

2021-06-16 19:11:53:   cfact.lookup: Called. Checking filename (freeztp_ios_upgrade) and IP (45.168.0.3)
2021-06-16 19:11:53:   cfact.lookup: Requested filename matches the imagediscoveryfile
2021-06-16 19:11:53:   cfact.lookup: #############IOS UPGRADE ABOUT TO BEGIN!!!#############
2021-06-16 19:11:53:   interceptor: cfact.lookup returned (True)
2021-06-16 19:11:53:   interceptor: Returning ztp_dyn_file instantiated object
2021-06-16 19:11:53:   ztp_dyn_file: Instantiated as (<__main__.ztp_dyn_file instance at 0x7f22286f32d0>)
2021-06-16 19:11:53:   cfact.request: Called with filename (freeztp_ios_upgrade) and IP (45.168.0.3)
2021-06-16 19:11:53:   cfact.request: Filename (freeztp_ios_upgrade) matches the configured imagediscoveryfile
2021-06-16 19:11:53:   cfact._check_supression: Called. Checking for image download supression for IP (45.168.0.3)
2021-06-16 19:11:53:   cfact._check_supression: Previous session not detected within 30 seconds.
2021-06-16 19:11:53:   cfact.request: Returning the value of the imagefile setting (cat3k_caa-universalk9.16.12.05b.SPA.bin)
2021-06-16 19:11:53:   ztp_dyn_file: File size is 39 bytes
2021-06-16 19:11:53:   file_cache.store: Storing {1623870713.429773: {'ipaddr': '45.168.0.3', 'file': <__main__.ztp_dyn_file instance at 0x7f22286f32d0>, 'fi                                                 lename': 'freeztp_ios_upgrade'}}
2021-06-16 19:11:53:   ztp_dyn_file.close: Called. File closing.
2021-06-16 19:11:54:   interceptor: Called. Checking the cache
2021-06-16 19:11:54:   file_cache.get: File (freeztp_ios_upgrade) requested by (45.168.0.3) found in cache. Checking timeout.
2021-06-16 19:11:54:   file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2021-06-16 19:11:56:   tracking_class.report: New transfer of (network-confg) from (45.168.0.3) detected

I've made sure to make the imagesupress to 30 seconds. So it will always trigger. However, when i check the flash content of the switch after it's finished with it's config. I notice no new image/bin file was added.

I've also restarted the FreeZTP service to apply the changes.

I haven't changed the initial config, but did change the long_template to something else. However i do think this is unrelevant?

Everything works except this last part, other then that the program works flawlessly :D it's truely amazing in my eyes!

Macleykun commented 3 years ago

I can verify that tftproot is set correct etc, b/c if i request the image i want manually (copy tftp: flash:) it will actually start downloading the whole file. So i'm not exactly sure why this happens.

pschapman commented 3 years ago

Hi -

Use tcpdump to see if the switch is actually requesting the file. I have not successfully used this feature on IOS-XE devices (e.g. Catalyst 3850/9K). See issue #37. Functionality for this feature seems to be platform sensitive. EEM-based upgrade automation is recommended.

PSC

Macleykun commented 3 years ago

I have checked with a college and found out that the 3850 was in bundle mode. Therefore it could never request the file and had to be configured into install mode!

If any user has the same issue, here is the appropiate documentation: https://content.cisco.com/chapter.sjs?uri=/searchable/chapter/c/en/us/td/docs/switches/lan/Denali_16-1/ConfigExamples_Technotes/Config_Examples/Misc/qos/m_install_vs_bundle.html.xml

Thank you for all your help! The whole provisioning works!