Posted on December 11, 2019 4:19 pm
 |  Asked by Mehdi Lebon
Print Friendly, PDF & Email


Where can I find logs for the ZTP process in CVP?
Is there documentation on the ZTP process configured in CVP?


Posted by Tamas Plugor
Answered on December 11, 2019 7:01 pm

Hi Mehdi,

You can find out the location for any components in cvp using:

cvpi logs


[cvp@cvp-2019-test ~]$ cvpi logs ztp

Executing command. This may take a few seconds...
/cvpi/apps/cvp/logs/ztp.stdout.log [primary]
/cvpi/apps/cvp/logs/upgrade/ztp-upgrade.log [primary]
/cvpi/apps/cvp/logs/ztp.stderr.log [primary]

What exactly are you looking for in the ZTP component logs? There are multiple components involved when you are doing ztp, so you might not find what you're looking for there. Essentially in ztp component logs you'd see errors in the ZTP service itself. For onboarding the device the inventory, device-interaction and other components are involved.

This article should be helpful:
even though it's for an older CVP version the ZTP process didn't change.

In a nutshell this is the flow:

1. Device boots in ZTP, all interfaces are configured as routed ports and it'll send DHCP packets on all active ports.
2. DHCP server which may or may not reside on your CVP VM, will reply to the request and will send along the options specified, including option 67 which will include the bootstrap script.
3. The bootstrap script gets downloaded and is run on the switch (not to be confused with the actual final startup-config), at which point you should have basic config, like eAPI, TerminAttr, temporary username and password, default route, and DNS and NTP servers (if configured as options)

4. At this point on the console you'll see something like this:

Sending request to https://cvpIP/cvpservice/services/ztp/config [0]

This means that it's waiting to get the startup-config from CVP via a configlet push.

In the CVP UI in the Devices page, the device should be streaming (green check mark icon), and in the Network Provisioning page it should be under the Undefined Container.

5. Since you cannot push configs to switches in the Undefined Container, you'll need to move it to your target container, by right clicking on it and selecting the Move action, then selecting your target container and Save.

6. You'll now be able to add your configlets (right click - Manage configlet) and select the target config you want to add to the switch along with the Sys_TelemetryBuilderV2 or Sys_TelemetryBuilderV3 that generates the config for the streaming agent (daemon TerminAttr)

7. After that you can click Save on the Network Provisioning page and go to your Tasks page

8. If you're running on 2019.1 release, you'll need to select the task and create a Change Control, which then we'll have to be reviewed and approved (button in top right) and then executed. On older releases you can execute Tasks without creating a CC from the Task page itself.

9. CVP will push the config to the switch and save it in the filesystem under cvp-config, which then is renamed as startup-config and the switch will be rebooted and booted into normal mode.

10. After CVP is able to reach the device and streaming is working, the Task is completed and marked successful.

The Network Provisioning chapter from the Config guide should be also helpful: (2018.2.x)

and for 2019.1.0 you can find it here:

If you have any issues or questions, feel free to open a TAC case at and some of us would be more than happy to help out!


Posted by Mehdi Lebon
Answered on December 12, 2019 8:37 am

Hi Tamas,

Thank you for that great feedback.
In fact I need to create a flowchart of the ZTP process flow (DHCP, switch and CVP) and I wanted to use the logs to do it.
In the logs, I'm surprised not to find anything in the ztp.stdout.log file, yet we have already run the ZTP process:

-rw-r--r-- 1 cvp cvp cvp 0 Sep 19 12:10 ztp.stdout.log

And I can't find the ztp-upgrade.log file:

[root@cvpqualif-master logs]# ll
total 41184
-rw-r--r-- 1 cvp cvp 16827426 Dec 12 08:24 aaa.stderr.log
-rw-r--r-- 1 cvp cvp 17227887 Dec 12 08:24 aaa.stdout.log
-rw-r--r-- 1 cvp cvp 49063 Dec 12 07:13 audit.stderr.log
-rw-r--r-- 1 cvp cvp 13598 Dec 12 07:13 audit.stdout.log
-rw-r--r-- 1 cvp cvp 258 Sep 19 12:57 cloudmanager.stderr.log
-rw-r--r-- 1 cvp cvp 0 Sep 19 12:10 cloudmanager.stdout.log
-rw-r--r-- 1 cvp cvp 157942 Dec 11 20:59 device-interaction.stderr.log
-rw-r--r-- 1 cvp cvp cvp 0 Sep 19 12:10 device-interaction.stdout.log
-rw-r--r-- 1 cvp cvp 417301 Dec 12 06:16 image.stderr.log
-rw-r--r-- 1 cvp cvp 14292 Dec 12 06:16 image.stdout.log
-rw-r--r-- 1 cvp cvp 148971 Dec 12 07:16 inventory.stderr.log
-rw-r--r-- 1 cvp cvp 167454 Dec 12 07:16 inventory.stdout.log
-rw-r--r-- 1 cvp cvp 3379 Nov 25 16:58 local-provider.stderr.log
-rw-r--r-- 1 cvp cvp cvp 0 Sep 19 12:10 local-provider.stdout.log
-rw-r--r-- 1 cvp cvp 540 Sep 19 12:57 radius-provider.stderr.log
-rw-r--r-- 1 cvp cvp cvp 0 Sep 19 12:10 radius-provider.stdout.log
drwxr-xr-x 2 cvp cvp 4096 Nov 15 12:01 rotated
-rw-r--r-- 1 cvp cvp 0 Sep 19 12:10 script_executor.stderr.log
-rw-r--r-- 1 cvp cvp 612845 Dec 12 00:57 script_executor.stdout.log
-rw-r--r-- 1 cvp cvp 6399963 Dec 12 08:27 snapshot.stderr.log
-rw-r--r-- 1 cvp cvp 4663 Oct 28 13:28 snapshot.stdout.log
-rw-r--r-- 1 cvp cvp 459 Sep 19 12:57 tacacs-provider.stderr.log
-rw-r--r-- 1 cvp cvp 0 Sep 19 12:10 tacacs-provider.stdout.log
-rw-r--r-- 1 cvp cvp 621 Sep 19 12:57 task.stderr.log
-rw-r--r-- 1 cvp cvp cvp 0 Sep 19 12:10 task.stdout.log
-rw-r--r-- 1 cvp cvp 30416 Oct 28 13:33 user.stderr.log
-rw-r--r-- 1 cvp cvp 419 Oct 28 13:33 user.stdout.log
-rw-r--r-- 1 cvp cvp 960 Sep 19 12:57 ztp.stderr.log
-rw-r--r-- 1 cvp cvp cvp 0 Sep 19 12:10 ztp.stdout.log
[root@cvpqualif-master logs]#

I found the logs on the switch, but nothing on the CVP side.

Best regards

As I mentioned earlier you can use cvpi logs ztp to find out location of the logs including on which node the log is located. ztp-upgrade logs are only on one node, and they contain the logs for upgrading the ZTP component itself during CVP upgrades, it will not contain any switch related logs. Regarding stdout logs, generally those don't contain much information, usually logs are written to stderr.log for all components, except for kafka.
(Tamas Plugor at December 12, 2019 3:09 pm)

Post your Answer

You must be logged in to post an answer.