10-10-2018 04:36 AM
Hello,
I am developing a Python script to be executed by Catalyst 3850 ZTP during boot up. I am seeing different error when I am connecting the config server to (1) Management port Gi0/0 and (2) Data port Gi1/0/1. I run the same Python script on Cisco ISR4431 and have no problem to make the ZTP work.
%INIT: waited 0 seconds for NVRAM to be available SETUP: new interface Vlan1 placed in "shutdown" state Loading http://192.168.88.88/ztp_python.py Loading http://192.168.88.88/ztp_python.py Press RETURN to get started! *Oct 9 19:37:39.657: %SMART_LIC-6-AGENT_READY: Smart Agent for Licensing is initialized *Oct 9 19:37:40.317: %IOSXE_RP_NV-3-NV_ACCESS_FAIL: Initial read of NVRAM contents failed *Oct 9 19:37:40.438: %IOSXE_RP_NV-3-BACKUP_NV_ACCESS_FAIL: Initial read of backup NVRAM contents failed *Oct 9 19:37:57.354: %SPANTREE-5-EXTENDED_SYSID: Extended SysId enabled for type vlan *Oct 9 19:37:58.386: %LINK-3-UPDOWN: Interface Lsmpi18/3, changed state to up *Oct 9 19:37:58.389: %LINK-3-UPDOWN: Interface EOBC18/1, changed state to up *Oct 9 19:37:58.391: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to down *Oct 9 19:37:58.391: %LINK-3-UPDOWN: Interface LIIN18/2, changed state to up *Oct 9 19:37:58.524: WCM-PKI-SHIM: buffer allocation failed for SUDI support check *Oct 9 19:37:58.524: PKI/SSL unable to send Sudi support to WCM *Oct 9 19:37:41.867: %STACKMGR-1-STACK_LINK_CHANGE: Switch 1 R0/0: stack_mgr: Stack port 1 on Switch 1 is nocable *Oct 9 19:37:41.867: %STACKMGR-1-STACK_LINK_CHANGE: Switch 1 R0/0: stack_mgr: Stack port 2 on Switch 1 is down *Oct 9 19:37:41.867: %STACKMGR-1-STACK_LINK_CHANGE: Switch 1 R0/0: stack_mgr: Stack port 2 on Switch 1 is nocable *Oct 9 19:37:41.867: %STACKMGR-6-SWITCH_ADDED: Switch 1 R0/0: stack_mgr: Switch 1 has been added to the stack. *Oct 9 19:37:41.867: %STACKMGR-6-SWITCH_ADDED: Switch 1 R0/0: stack_mgr: Switch 1 has been added to the stack. *Oct 9 19:37:41.867: %STACKMGR-6-SWITCH_ADDED: Switch 1 R0/0: stack_mgr: Switch 1 has been added to the stack. *Oct 9 19:37:41.867: %STACKMGR-6-ACTIVE_ELECTED: Switch 1 R0/0: stack_mgr: Switch 1 has been elected ACTIVE. *Oct 9 19:37:59.496: %LINEPROTO-5-UPDOWN: Line protocol on Interface Lsmpi18/3, changed state to up *Oct 9 19:37:59.499: %LINEPROTO-5-UPDOWN: Line protocol on Interface EOBC18/1, changed state to up *Oct 9 19:37:59.500: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up *Oct 9 19:37:59.500: %LINEPROTO-5-UPDOWN: Line protocol on Interface LIIN18/2, changed state to up *Oct 9 19:38:00.392: %HMANRP-6-HMAN_IOS_CHANNEL_INFO: HMAN-IOS channel event for switch 1: EMP_RELAY: Channel UP! *Oct 9 19:38:02.840: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down *Oct 9 19:38:03.391: %IOSXE_MGMTVRF-6-CREATE_SUCCESS_INFO: Management vrf Mgmt-vrf created with ID 1, ipv4 table-id 0x1, ipv6 table-id 0x1E000001 *Oct 9 19:38:21.848: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively down *Oct 9 19:38:22.102: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up *Oct 9 19:38:22.764: %SYS-5-RESTART: System restarted -- Cisco IOS Software [Everest], Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 16.6.2, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2017 by Cisco Systems, Inc. Compiled Wed 01-Nov-17 04:27 by mcpre *Oct 9 19:38:23.018: AUTOINSTALL: Obtain siaddr 192.168.88.88 (as config server) *Oct 9 19:38:24.066: [IOX DEBUG] Guestshell start API is being invoked *Oct 9 19:38:24.066: [IOX DEBUG] provided idb is mgmt interface *Oct 9 19:38:24.066: [IOX DEBUG] Setting up guestshell to use mgmt-intf *Oct 9 19:38:24.066: [IOX DEBUG] Setting up chasfs for iox related activity *Oct 9 19:38:24.067: [IOX DEBUG] Setting up for iox pre-clean activity if needed *Oct 9 19:38:24.067: [IOX DEBUG] Waiting for iox pre-clean setup to take affect *Oct 9 19:38:24.067: [IOX DEBUG] Waited for 1 sec(s) for iox pre-clean setup to take affect *Oct 9 19:38:24.067: [IOX DEBUG] Auto-configuring iox feature *Oct 9 19:38:24.074: [IOX DEBUG] Waiting for CAF and ioxman to be up, in that order *Oct 9 19:38:24.186: %LINK-3-UPDOWN: Interface GigabitEthernet1/1/1, changed state to down *Oct 9 19:38:24.186: %LINK-3-UPDOWN: Interface GigabitEthernet1/1/2, changed state to down *Oct 9 19:38:24.189: %LINK-3-UPDOWN: Interface GigabitEthernet1/1/3, changed state to down *Oct 9 19:38:24.189: %LINK-3-UPDOWN: Interface GigabitEthernet1/1/4, changed state to down *Oct 9 19:38:24.191: %LINK-3-UPDOWN: Interface TenGigabitEthernet1/1/1, changed state to down *Oct 9 19:38:24.192: %LINK-3-UPDOWN: Interface TenGigabitEthernet1/1/2, changed state to down *Oct 9 19:38:24.194: %LINK-3-UPDOWN: Interface TenGigabitEthernet1/1/3, changed state to down *Oct 9 19:38:24.249: %LINK-3-UPDOWN: Interface TenGigabitEthernet1/1/4, changed state to down *Oct 9 19:38:24.666: %UICFGEXP-6-SERVER_NOTIFIED_START: Switch 1 R0/0: psd: Server iox has been notified to start *Oct 9 19:38:25.186: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1/1, changed state to down *Oct 9 19:38:25.186: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1/2, changed state to down *Oct 9 19:38:25.189: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1/3, changed state to down *Oct 9 19:38:25.190: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1/4, changed state to down *Oct 9 19:38:25.191: %LINEPROTO-5-UPDOWN: Line protocol on Interface TenGigabitEthernet1/1/1, changed state to down *Oct 9 19:38:25.192: %LINEPROTO-5-UPDOWN: Line protocol on Interface TenGigabitEthernet1/1/2, changed state to down *Oct 9 19:38:25.194: %LINEPROTO-5-UPDOWN: Line protocol on Interface TenGigabitEthernet1/1/3, changed state to down *Oct 9 19:38:25.249: %LINEPROTO-5-UPDOWN: Line protocol on Interface TenGigabitEthernet1/1/4, changed state to down *Oct 9 19:38:25.326: %SYS-6-BOOTTIME: Time taken to reboot after reload = 364 seconds *Oct 9 19:38:28.095: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:38:33.123: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:38:38.125: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:38:43.297: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:38:49.304: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:38:54.304: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:38:59.305: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:04.307: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:09.307: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:14.311: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:19.312: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:24.313: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:29.316: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:34.316: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:39.317: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:44.347: [IOX DEBUG] Waiting for another 5 secs *Oct 9 19:39:49.348: [IOX DEBUG] Waiting for another 5 secs The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable *Oct 9 19:39:53.349: [IOX DEBUG] Waited for 89 sec(s) for CAF and ioxman to come up *Oct 9 19:39:53.350: [IOX DEBUG] Validating if CAF and ioxman are running *Oct 9 19:39:53.350: [IOX DEBUG] CAF and ioxman are up and running *Oct 9 19:39:53.350: [IOX DEBUG] Building the simple mgmt-intf enable command string *Oct 9 19:39:53.350: [IOX DEBUG] Enable command is: request platform software iox-manager app-hosting guestshell enable *Oct 9 19:39:53.350: [IOX DEBUG] Issuing guestshell enable command and waiting for it to be up The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable *Oct 9 19:39:57.410: [IOX DEBUG] Waiting for another 5 secs The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable *Oct 9 19:40:02.467: [IOX DEBUG] Waiting for another 5 secs Guestshell enabled successfully *Oct 9 19:40:34.868: [IOX DEBUG] Checking for guestshell mount path *Oct 9 19:40:34.868: [IOX DEBUG] Validating if guestshell is ready for use *Oct 9 19:40:34.868: [IOX DEBUG] Guestshell enabled successfully *** ZTP Day0 Python Script *** *** Configuring... *** Traceback (most recent call last): File "/bootflash/downloaded_script.py", line 155, in <module> serials = get_serials() File "/bootflash/downloaded_script.py", line 13, in get_serials inventory = cli('show inventory | format') File "/usr/lib/python2.7/site-packages/cli/__init__.py", line 253, in cli response = pnp.listener.cli_exec_request(command) File "/usr/lib/python2.7/site-packages/pnp/_pnp.py", line 493, in cli_exec_request raise PnPSocketError() pnp._pnp.PnPSocketError: SocketError: Socket /cisco/nginx_shared/pnp_python.sock not present. Make sure to enable http server Loading http://192.168.88.88/ztp_python.py Loading http://192.168.88.88/ztp_python.py *Oct 9 19:40:41.293: SHELL-EXECUTION: error executing the python script: return code 1 (script itself stored in file "/bootflash/downloaded_script.py") *Oct 9 19:40:41.293: SHELL-EXECUTION: error executing the downloaded python script (url "http://192.168.88.88/ztp_python.py") *Oct 9 19:40:42.317: [IOX DEBUG] Guestshell start API is being invoked *Oct 9 19:40:42.317: [IOX DEBUG] provided idb is mgmt interface *Oct 9 19:40:42.317: [IOX DEBUG] Setting up guestshell to use mgmt-intf *Oct 9 19:40:42.317: [IOX DEBUG] Setting up chasfs for iox related activity *Oct 9 19:40:42.317: [IOX DEBUG] Skipping pre-clean setup *Oct 9 19:40:42.318: [IOX DEBUG] Skipping removal of previous iox feature configuration *Oct 9 19:40:42.318: [IOX DEBUG] Skipping iox feature re-configuration *Oct 9 19:40:42.318: [IOX DEBUG] Validating if CAF and ioxman are running *Oct 9 19:40:42.318: [IOX DEBUG] CAF and ioxman are up and running *Oct 9 19:40:42.318: [IOX DEBUG] Building the simple mgmt-intf enable command string *Oct 9 19:40:42.318: [IOX DEBUG] Enable command is: request platform software iox-manager app-hosting guestshell enable *Oct 9 19:40:42.318: [IOX DEBUG] Issuing guestshell enable command and waiting for it to be up *Oct 9 19:40:42.318: [IOX DEBUG] Checking for guestshell mount path *Oct 9 19:40:42.318: [IOX DEBUG] Validating if guestshell is ready for use *Oct 9 19:40:42.319: [IOX DEBUG] Guestshell enabled successfully *** ZTP Day0 Python Script *** *** Configuring... *** Traceback (most recent call last): File "/bootflash/downloaded_script.py", line 155, in <module> serials = get_serials() File "/bootflash/downloaded_script.py", line 13, in get_serials inventory = cli('show inventory | format') File "/usr/lib/python2.7/site-packages/cli/__init__.py", line 253, in cli response = pnp.listener.cli_exec_request(command) File "/usr/lib/python2.7/site-packages/pnp/_pnp.py", line 493, in cli_exec_request raise PnPSocketError() pnp._pnp.PnPSocketError: SocketError: Socket /cisco/nginx_shared/pnp_python.sock not present. Make sure to enable http server Loading http://192.168.88.88/ztp_python.py Loading http://192.168.88.88/ztp_python.py *Oct 9 19:40:48.657: SHELL-EXECUTION: error executing the python script: return code 1 (script itself stored in file "/bootflash/downloaded_script.py") *Oct 9 19:40:48.657: SHELL-EXECUTION: error executing the downloaded python script (url "http://192.168.88.88/ztp_python.py") *Oct 9 19:40:49.677: [IOX DEBUG] Guestshell start API is being invoked *Oct 9 19:40:49.677: [IOX DEBUG] provided idb is mgmt interface *Oct 9 19:40:49.677: [IOX DEBUG] Setting up guestshell to use mgmt-intf *Oct 9 19:40:49.677: [IOX DEBUG] Setting up chasfs for iox related activity *Oct 9 19:40:49.677: [IOX DEBUG] Skipping pre-clean setup *Oct 9 19:40:49.677: [IOX DEBUG] Skipping removal of previous iox feature configuration *Oct 9 19:40:49.678: [IOX DEBUG] Skipping iox feature re-configuration *Oct 9 19:40:49.678: [IOX DEBUG] Validating if CAF and ioxman are running *Oct 9 19:40:49.678: [IOX DEBUG] CAF and ioxman are up and running *Oct 9 19:40:49.678: [IOX DEBUG] Building the simple mgmt-intf enable command string *Oct 9 19:40:49.678: [IOX DEBUG] Enable command is: request platform software iox-manager app-hosting guestshell enable *Oct 9 19:40:49.678: [IOX DEBUG] Issuing guestshell enable command and waiting for it to be up *Oct 9 19:40:49.679: [IOX DEBUG] Checking for guestshell mount path *Oct 9 19:40:49.679: [IOX DEBUG] Validating if guestshell is ready for use *Oct 9 19:40:49.679: [IOX DEBUG] Guestshell enabled successfully *Oct 9 19:42:06.749: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Config Wizard)
*Oct 9 19:45:51.916: %IOSXE-5-PLATFORM: Switch 1 R0/0: Oct 9 19:45:51 provision.sh: %INSTALL-5-OPERATION_START_INFO: Started install package flash:cat3k_caa-universalk9.16.06.04.SPA.bin *Oct 9 19:45:54.595: %IOSXE-5-PLATFORM: Switch 1 R0/0: Oct 9 19:45:54 packtool.sh: %INSTALL-5-OPERATION_START_INFO: Started expand package flash:cat3k_caa-universalk9.16.06.04.SPA.bin *Oct 9 19:46:19.447: %SYS-5-RELOAD: Reload requested by on vty0. Reload Reason: Reload Command. Loading http://192.168.88.88/ztp_python.py Loading http://192.168.88.88/ztp_python.py Chassis 1 reloading, reason - Reload command Oct 9 19:47:00.715 RP0/0: %INSTALL-5-OPERATION_COMPLETED_INFO: Completed expand package flash:cat3k_caa-universalk9.16.06.04.SPA.bin Oct 9 19:47:03.021 RP0/0: %INSTALL-5-OPERATION_COMPLETED_INFO: Completed install package flash:cat3k_caa-universalk9.16.06.04.SPA.bin Oct 9 19:47:04.185 FP0/0: %PMAN-5-EXITACTION: Process manager is exiting: reload fp action requested Oct 9 19:47:09.295 RP0/0: %PMAN-5-EXITACTION: Process manager is exiting: process exit w octeon_wdt: WDT device closed unexpectedly. WDT will not stop! systemd-shutdown[1]: Could not unmount /var/run/netns/guestshell: No such file or directory reboot: Restarting system
%INIT: waited 0 seconds for NVRAM to be available --- System Configuration Dialog --- Would you like to enter the initial configuration dialog? [yes/no]: Loading http://192.168.88.88/ztp_python.py Loading http://192.168.88.88/ztp_python.py The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable The process for the command is not responding or is otherwise unavailable Guestshell enabled successfully *** ZTP Day0 Python Script ***
Traceback (most recent call last): File "/bootflash/downloaded_script.py", line 190, in <module> new_image = get_new_image_version(serials) File "/bootflash/downloaded_script.py", line 59, in get_new_image_version response = urllib2.urlopen(url) File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/usr/lib64/python2.7/urllib2.py", line 431, in open response = self._open(req, data) File "/usr/lib64/python2.7/urllib2.py", line 449, in _open '_open', req) File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain result = func(*args) File "/usr/lib64/python2.7/urllib2.py", line 1227, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib64/python2.7/urllib2.py", line 1197, in do_open raise URLError(err) urllib2.URLError: <urlopen error [Errno 128] Network is unreachable>
[guestshell@guestshell ~]$ ifconfig eth0 Link encap:Ethernet HWaddr 52:54:DD:1D:B3:61 inet addr:192.168.30.2 Bcast:192.168.30.7 Mask:255.255.255.248 inet6 addr: fe80::5054:ddff:fe1d:b361%lo/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:16 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1368 (1.3 KiB) TX bytes:1144 (1.1 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1%1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:594 errors:0 dropped:0 overruns:0 frame:0 TX packets:594 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:92014 (89.8 KiB) TX bytes:92014 (89.8 KiB) [guestshell@guestshell ~]$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.30.1 0.0.0.0 UG 1 0 0 eth0 192.168.30.0 * 255.255.255.248 U 0 0 0 eth0 [guestshell@guestshell ~]$ sudo ping 192.168.88.88 We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. PING 192.168.88.88 (192.168.88.88) 56(84) bytes of data. From 192.168.30.1 icmp_seq=1 Destination Net Unreachable From 192.168.30.1 icmp_seq=2 Destination Net Unreachable From 192.168.30.1 icmp_seq=3 Destination Net Unreachable From 192.168.30.1 icmp_seq=4 Destination Net Unreachable %Error opening tftp://192.168.88.88/router-confg (Timed out)^C --- 192.168.88.88 ping statistics --- 21 packets transmitted, 0 received, +4 errors, 100% packet loss, time 20004ms [guestshell@guestshell ~]$ [guestshell@guestshell ~]$ sudo ping 192.168.30.1 PING 192.168.30.1 (192.168.30.1) 56(84) bytes of data. 64 bytes from 192.168.30.1: icmp_seq=1 ttl=64 time=0.217 ms 64 bytes from 192.168.30.1: icmp_seq=2 ttl=64 time=0.180 ms 64 bytes from 192.168.30.1: icmp_seq=3 ttl=64 time=0.174 ms 64 bytes from 192.168.30.1: icmp_seq=4 ttl=64 time=0.161 ms 64 bytes from 192.168.30.1: icmp_seq=5 ttl=64 time=0.182 ms 64 bytes from 192.168.30.1: icmp_seq=6 ttl=64 time=0.159 ms ^C --- 192.168.30.1 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 4999ms rtt min/avg/max/mdev = 0.159/0.178/0.217/0.025 ms [guestshell@guestshell ~]$
Appreciate your advice on this. Thanks in advanced.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide