PackeTsar / freeztp

An Open-Source Zero-Touch Provisioning System for Cisco IOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

External dhcp and 9200 model

zholbrook opened this issue · comments

Hi, per my last issue that is closed it seems the issue is not with external dhcp but something I think in the 9200 model switches. If the switch is not provisioned entirely on first trip through the ztp process it get stuck and I have been unable to fix the issue. Here is the process I am describing.

  1. Plug up switch in lab with dhcp it hits ztp server gets init-template but S/N is not in the idarray of ztp server so config stops here + ios upgrade
  2. Put S/N in idaddray and write erase switch, clear provisioning, and reload switch.
  3. switch boots back up, gets init-template and ios check, but never tries for the second config push.

See logs below from ztp and console output. I do think it may be a switch issue, but I dont know what it would be.

#############ZTP LOGS########################

2020-05-28 15:08:48: Log file has been cleared
2020-05-28 15:09:04: Provisioning history has been cleared
2020-05-28 15:09:08: Downloads have been cleared
2020-05-28 15:15:29: tracking_class.report: New transfer of (freeztp_ios_upgrade) from (x.x.x.189) detected
2020-05-28 15:15:29: interceptor: Called. Checking the cache
2020-05-28 15:15:29: file_cache.get: File (freeztp_ios_upgrade) requested by (x.x.x.189) not in cache
2020-05-28 15:15:29: interceptor: Cache returned None. Running cfact.lookup procedure
2020-05-28 15:15:29: cfact.lookup: Called. Checking filename (freeztp_ios_upgrade) and IP (x.x.x.189)
2020-05-28 15:15:29: cfact.lookup: Requested filename matches the imagediscoveryfile
2020-05-28 15:15:29: cfact.lookup: #############IOS UPGRADE ABOUT TO BEGIN!!!#############
2020-05-28 15:15:29: interceptor: cfact.lookup returned (True)
2020-05-28 15:15:29: interceptor: Returning ztp_dyn_file instantiated object
2020-05-28 15:15:29: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7f53b023d5f0>)
2020-05-28 15:15:29: cfact.request: Called with filename (freeztp_ios_upgrade) and IP (x.x.x.189)
2020-05-28 15:15:29: cfact.request: Filename (freeztp_ios_upgrade) matches the configured imagediscoveryfile
2020-05-28 15:15:29: cfact._check_supression: Called. Checking for image download supression for IP (x.x.x.189)
2020-05-28 15:15:29: cfact._check_supression: Previous session not detected within 3600 seconds.
2020-05-28 15:15:29: cfact.request: Returning the value of the imagefile setting (cat9k_lite_iosxe.16.x.x.SPA.bin)
2020-05-28 15:15:29: ztp_dyn_file: File size is 33 bytes
2020-05-28 15:15:29: file_cache.store: Storing {1590696929.273523: {'ipaddr': 'x.x.x.189', 'file': <main.ztp_dyn_file instance at 0x7f53b023d5f0>, 'filename': 'freeztp_ios_upgrade'}}
2020-05-28 15:15:29: ztp_dyn_file.close: Called. File closing.
2020-05-28 15:15:29: interceptor: Called. Checking the cache
2020-05-28 15:15:29: file_cache.get: File (freeztp_ios_upgrade) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:15:29: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:15:35: tracking_class.report: New transfer of (cat9k_lite_iosxe.16.x.x.SPA.bin) from (x.x.x.189) detected
2020-05-28 15:15:39: file_cache._maintain_cache: Timing out and deleting 1590696929.27:{'ipaddr': 'x.x.x.189', 'file': <main.ztp_dyn_file instance at 0x7f53b023d5f0>, 'filename': 'freeztp_ios_upgrade'}
2020-05-28 15:19:02: tracking_class.report: New transfer of (network-confg) from (x.x.x.189) detected
2020-05-28 15:19:02: interceptor: Called. Checking the cache
2020-05-28 15:19:02: file_cache.get: File (network-confg) requested by (x.x.x.189) not in cache
2020-05-28 15:19:02: interceptor: Cache returned None. Running cfact.lookup procedure
2020-05-28 15:19:02: cfact.lookup: Called. Checking filename (network-confg) and IP (x.x.x.189)
2020-05-28 15:19:02: cfact.lookup: Requested filename matches the initialfilename. Returning True
2020-05-28 15:19:02: interceptor: cfact.lookup returned (True)
2020-05-28 15:19:02: interceptor: Returning ztp_dyn_file instantiated object
2020-05-28 15:19:02: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7f53b0510050>)
2020-05-28 15:19:02: cfact.request: Called with filename (network-confg) and IP (x.x.x.189)
2020-05-28 15:19:02: cfact.request: Filename (network-confg) matches the configured initialfilename
2020-05-28 15:19:02: cfact.request: Generated a TempID with cfact._generate_name: (ZTP-25094B3779)
2020-05-28 15:19:02: cfact.request: Generated a SNMP Request with TempID (ZTP-25094B3779) and IP (x.x.x.189)
2020-05-28 15:19:02: cfact.request: Returning the below initial config to TFTPy:
#########################
hostname ZTP-25094B3779
!
snmp-server community secretcommunity RO
!
end
#########################
2020-05-28 15:19:02: ztp_dyn_file: File size is 72 bytes
2020-05-28 15:19:02: file_cache.store: Storing {1590697142.978622: {'ipaddr': 'x.x.x.189', 'file': <main.ztp_dyn_file instance at 0x7f53b0510050>, 'filename': 'network-confg'}}
2020-05-28 15:19:02: snmp_query._query_worker: Attempting SNMP Query
2020-05-28 15:19:03: interceptor: Called. Checking the cache
2020-05-28 15:19:03: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:03: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:03: ztp_dyn_file.close: Called. File closing.
2020-05-28 15:19:04: interceptor: Called. Checking the cache
2020-05-28 15:19:04: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:04: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:04: interceptor: Called. Checking the cache
2020-05-28 15:19:04: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:04: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:05: interceptor: Called. Checking the cache
2020-05-28 15:19:05: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:05: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:05: interceptor: Called. Checking the cache
2020-05-28 15:19:05: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:05: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:06: interceptor: Called. Checking the cache
2020-05-28 15:19:06: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:06: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:06: interceptor: Called. Checking the cache
2020-05-28 15:19:06: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:06: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:07: interceptor: Called. Checking the cache
2020-05-28 15:19:07: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:07: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:07: interceptor: Called. Checking the cache
2020-05-28 15:19:07: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:07: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:07: interceptor: Called. Checking the cache
2020-05-28 15:19:07: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:07: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:07: interceptor: Called. Checking the cache
2020-05-28 15:19:07: file_cache.get: File (network-confg) requested by (x.x.x.189) found in cache. Checking timeout.
2020-05-28 15:19:07: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-05-28 15:19:08: snmp_query._query_worker: SNMP Query Successful (OID: WS_C3850_SERIAL_NUMBER). Host (x.x.x.189) responded with (JADSANITIZED)
2020-05-28 15:19:13: file_cache._maintain_cache: Timing out and deleting 1590697142.98:{'ipaddr': 'x.x.x.189', 'file': <main.ztp_dyn_file instance at 0x7f53b0510050>, 'filename': 'network-confg'}

###########SWITCH CONSOLE################
--- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:
Loading freeztp_ios_upgrade from x.x.x.x (via Vlan1): !
[OK - 33 bytes]

Press RETURN to get started!

*May 28 20:00:53.604: AUTOINSTALL: Obtain tftp server address (opt 150) x.x.x.x
*May 28 20:00:53.604: PNPA: Setting autoinstall complete to true for x.x.x.x
*May 28 20:00:53.464: %INSTALL-3-OPERATION_ERROR_MESSAGE: Switch 1 R0/0: install_engine: Failed to install_add_activate_commit package flash:cat9k_lite_iosxe.16.x.x.SPA.bin, Error: install_add_activate_commit : Super package already added. Add operation not allowed. 'install remove inactive' can be used to discard added packages
*May 28 20:00:53.750: %SCRIPT_INSTALL-3-SCRPT_TYPE_NOT_MATCHED: Script file format invalid: tftp://x.x.x.x/network-confg
Loading network-confg from x.x.x.x(via Vlan1): !
[OK - 72 bytes]

*May 28 20:00:58.117: %SYS-5-CONFIG_I: Configured from tftp://ztp.server.removed/network-confg by console
*May 28 20:00:59.116: AUTOINSTALL: Tftp script execution successful for Vl1.

This is a issue with the 9200L model switch all other models fully support ztp and the L model does not. Closing issue.