ZTP logs its operation on the flash file system in the directory /disk0:/ztp/. ZTP logs all the transaction with the DHCP
server and all the state transition.
The following example displays the execution of a simple configuration script that is downloaded from a management interface:
2023-05-12 14:43:18,406 5845 [Env ] INF: MgmtDhcp4Fetcher fetcher created.
2023-05-12 14:43:18,482 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:idle. Processing work: [privileged] start an engine. done = False
2023-05-12 14:43:18,484 5845 [Engine ] INF: MgmtDhcp4Fetcher, current state:active: state changed to active
2023-05-12 14:43:18,508 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: Monitor fetcher work for ZAdmin. done = False
2023-05-12 14:43:18,585 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: epoch work. done = False
2023-05-12 14:43:18,586 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: [privileged] getting engine status. done = False
2023-05-12 14:43:18,587 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: Bringing up interfaces before next retry. done = False
2023-05-12 14:43:18,589 5845 [Port ] DEB: <Port count=1>: bringing interface(s) up "MgmtEth0/RP0/CPU0/0"
2023-05-12 14:43:18,624 5845 [Port ] DEB: Saving 1 interfaces to /disk0:/ztp/xr_config/interface_list
2023-05-12 14:43:18,626 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: Filtering up interfaces for MgmtDhcp4Fetcher. done = False
2023-05-12 14:43:18,627 5845 [Management ] DEB: Determining operstate of interface: brXRmgmt1
2023-05-12 14:43:18,666 5845 [Port ] DEB: Filtered up interfaces: [Name: MgmtEth0/RP0/CPU0/0 (Type: Management) (Up: False)]
2023-05-12 14:43:18,670 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: Setup interfaces for MgmtDhcp4Fetcher. done = False
2023-05-12 14:43:18,671 5845 [Env ] INF: Env::getVlanIDs: vlan.mode:2
2023-05-12 14:43:18,672 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: Start Dhclient for MgmtDhcp4Fetcher. done = False
2023-05-12 14:43:18,687 5845 [Port ] DEB: <Dhclient count=1>: started dhclient using "ip netns exec xrnns /sbin/dhclient -4 -cf /etc/dhcp/dhclient.conf.ztp -lf /var/lib/dhcp/dhclient.leases.ztp -sf /etc/dhcp/dhclient-script.ztp2 brXRmgmt1"
2023-05-12 14:43:19,090 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: Checking for username configuration. done = False
2023-05-12 14:43:19,630 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: Monitor fetcher work for ZAdmin. done = False
2023-05-12 14:43:19,692 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: [privileged] getting engine status. done = False
2023-05-12 14:43:20,696 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: Monitor fetcher work for ZAdmin. done = False
2023-05-12 14:43:20,797 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: [privileged] getting engine status. done = False
2023-05-12 14:43:21,099 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: Sending standby sync message. done = False
2023-05-12 14:43:21,212 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: [privileged] getting engine status. done = False
2023-05-12 14:43:21,700 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:active. Processing work: Monitor dhclient for MgmtDhcp4Fetcher on interface ['brXRmgmt1']. done = False
2023-05-12 14:43:21,704 5845 [MgmtDhcp4Fetcher] DEB: Received DHCP4 response
2023-05-12 14:43:21,705 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) reason=BOUND
2023-05-12 14:43:21,706 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) interface=brXRmgmt1
2023-05-12 14:43:21,706 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_ip_address=10.58.227.177
2023-05-12 14:43:21,707 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_network_number=10.58.227.0
2023-05-12 14:43:21,708 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_subnet_mask=255.255.255.0
2023-05-12 14:43:21,708 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_broadcast_address=10.58.227.255
2023-05-12 14:43:21,709 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_routers=10.58.227.1
2023-05-12 14:43:21,710 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_dhcp_server_identifier=10.58.227.11
2023-05-12 14:43:21,711 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_domain_name=cisco.com
2023-05-12 14:43:21,711 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_domain_name_servers=198.51.100.3 198.51.100.1
2023-05-12 14:43:21,712 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_filename=http://10.58.227.11/rosco/mys-p1b-212/ztp.sh
2023-05-12 14:43:21,713 5845 [MgmtDhcp4Fetcher] INF: (dhclient env) new_ip6_prefixlen=64
2023-05-12 14:43:21,714 5845 [Engine ] INF: MgmtDhcp4Fetcher, current state:active, exit code:success
2023-05-12 14:43:21,815 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: Monitor fetcher work for ZAdmin. done = False
2023-05-12 14:43:21,828 5845 [Port ] DEB: Dhclient processes:
root 7033 0.0 0.0 31096 7312 ? Ss 14:46 0:00 /sbin/dhclient -4 -cf /etc/dhcp/dhclient.conf.ztp -lf /var/lib/dhcp/dhclient.leases.ztp -sf /etc/dhcp/dhclient-script.ztp2 brXRmgmt1
root 7052 0.0 0.0 20316 1592 ? S 14:46 0:00 /bin/sh -c ps aux | grep dhclient
root 7054 0.0 0.0 16248 948 ? Sl 14:46 0:00 grep dhclient
2023-05-12 14:43:21,830 5845 [Port ] DEB: <Dhclient count=1>: dhclient 4 is stopped: keepIpAddress=True
2023-05-12 14:43:21,831 5845 [Engine ] INF: MgmtDhcp4Fetcher, current state:final, exit code:success: state changed to final
2023-05-12 14:43:21,832 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:final, exit code:success. Processing work: [privileged] getting engine status. done = False
2023-05-12 14:43:21,834 5845 [MgmtDhcp4Fetcher] DEB: dhcp: shutdown : Entry
2023-05-12 14:43:21,933 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:final, exit code:success. Processing work: [privileged] prepare engine shutdown. done = False
2023-05-12 14:43:22,035 5845 [Engine ] DEB: MgmtDhcp4Fetcher, current state:final, exit code:success. Processing work: [privileged] shutting down MgmtDhcp4Fetcher engine. done = False
2023-05-12 14:43:22,036 5845 [Engine ] INF: MgmtDhcp4Fetcher, current state:final, exit code:shutdown
2023-05-12 14:43:22,037 5845 [Engine ] INF: MgmtDhcp4Fetcher, exit code:shutdown: state changed to None
2023-05-12 14:43:22,038 5845 [Engine ] DEB: MgmtDhcp4Fetcher, exit code:shutdown: breaking engine loop after shutdown
2023-05-12 14:43:22,039 5845 [Engine ] DEB: ZAdmin, current state:active. Processing work: Setup fetching. done = False
2023-05-12 14:43:22,039 5845 [Engine ] DEB: MgmtDhcp4Fetcher, exit code:shutdown: end of event loop
2023-05-12 14:43:22,052 5845 [Env ] DEB: No authentication required for Mgmt Interface
2023-05-12 14:43:22,053 5845 [Env ] DEB: No authentication required when initiated using CLI
2023-05-12 14:43:22,055 5845 [Xr ] DEB: Writing to file /tmp/ztp2-fzwmlfid/sysdb_cfg_cmd.tmp
2023-05-12 14:43:22,181 5845 [Xr ] DEB: No inconsistency found in config
2023-05-12 14:43:23,460 5845 [Xr ] DEB: Applying TPA default route
2023-05-12 14:43:23,523 5845 [Xr ] DEB: No IPv4 Address assigned to linux management interface
2023-05-12 14:43:23,524 5845 [Xr ] DEB: Applying IPv4 configuration
2023-05-12 14:43:23,525 5845 [Xr ] DEB: Validating IP Address: 10.58.227.177
2023-05-12 14:43:23,527 5845 [Xr ] DEB: Applying IPv4 gateway route configuration
2023-05-12 14:43:23,527 5845 [Xr ] DEB: Validating DHCP server identifier IP Address: 10.58.227.11
2023-05-12 14:43:23,528 5845 [Xr ] DEB: Validating Gateway IP Address: 10.58.227.1
2023-05-12 14:43:23,530 5845 [Xr ] DEB: Configuring domain name with domain-name-server 198.51.100.3 198.51.100.1
2023-05-12 14:43:23,532 5845 [Configuration] DEB: Config file type is IOS XR config. Replace False
2023-05-12 14:43:23,534 5845 [Configuration] DEB: Applying following config:
tpa
vrf default
address-family ipv4
default-route mgmt
address-family ipv6
default-route mgmt
interface MgmtEth0/RP0/CPU0/0
no ipv4 address
ipv4 address 10.58.227.177 255.255.255.0
no shutdown
tpa
vrf default
address-family ipv4
default-route mgmt
router static
address-family ipv4 unicast
0.0.0.0/0 10.58.227.1
domain name cisco.com
domain name-server 198.51.100.3
domain name-server 198.51.100.1