Zero Touch Provisioning (ZTP) Commands

This chapter describes the commands used to manually invoke Zero Touch Provisioning (ZTP).

ztp clean

To remove all ZTP logs and settings saved on disk, use the ztp clean command in EXEC mode.

ztp clean [ debug ] [ verbose ]

Syntax Description

debug

Run with additional logging to the console.

verbose

Run with logging to the console.

Command Default

No default behavior or values.

Command Modes

EXEC mode

Command History

Release Modification
Release 6.5.31

This command was introduced.

Usage Guidelines

If you wish to run ZTP as if from a clean boot, use the ztp clean command to remove all ZTP logs and settings. Use commit replace to reload, and then ZTP will run again as if from first boot.

No progress logs are shown by default, although there will be XR syslogs for important events. If you wish to see more logs, add verbose after the ztp clean command. If these logs are not enough, add debug before verbose.

Logs can be found in disk0:/ztp/ztp.log.

Examples

The following example shows how to remove all ZTP files saved on the disk.


RP/0/RP0/CPU0:router# ztp clean verbose
Mon Oct 10 17:03:43.581 UTC
Remove all ZTP temporary files and logs? [confirm] [y/n] :y
All ZTP files have been removed.
If you now wish ZTP to run again from boot, do 'conf t/commit replace' followed by reload.

ztp initiate

To invoke a new ZTP DHCP session, use the ztp initiate command in EXEC mode.

ztp initiate {apply configuration | [ debug ] [ verbose ]}

Syntax Description

apply configuration

XR configuration commands to apply

debug

Run with additional logging to the console

verbose

Run with logging to the console

Command Default

No default behavior or values.

Command Modes

EXEC mode

Command History

Release Modification
Release 6.5.31

This command was introduced.

Usage Guidelines

Use the ztp initiate command to forceably inititate the ZTP, ignoring username configuration. ztp initiate allows the execution of a script even when the system has already been configured. This command is useful for testing ZTP without forcing a reload. This command is particularly useful to test scripts or if some manual operations are required before provisioning the router.

No progress logs are shown by default, although there will be XR syslogs for important events. If you wish to see more logs, add verbose after the ztp initiate command. If these logs are not enough, add debug before verbose.

Logs can be found in disk0:/ztp/ztp.log.

Examples

The following example shows how to bring up the interface manually.


RP/0/RP0/CPU0:router# ztp initiate debug verbose
Invoke ZTP? (this may change your configuration) [confirm] [y/n]:

ztp terminate

To terminate all the existing ZTP processes, use the ztp terminate command in EXEC mode.

ztp terminate [ debug ] [ verbose ] [ noprompt ]

Syntax Description

debug

Run with additional logging to the console.

verbose

Run with logging to the console.

noprompt

Run without prompting.

Command Default

No default behavior or values.

Command Modes

EXEC mode

Command History

Release Modification
Release 6.5.31

This command was introduced.

Usage Guidelines

If you want to terminate an already running ZTP process, use the ztp terminate command. Be careful to use the ztp terminate command because unproperly usage of this command may leave your system in a partially configured state.

No progress logs are shown by default, although there will be XR syslogs for important events. If you wish to see more logs, add verbose after the ztp terminate command. If these logs are not enough, add debug before verbose.

Logs can be found in disk0:/ztp/ztp.log.

Examples

The following example shows how to terminate the ZTP sessions in progress.


RP/0/RP0/CPU0:router# ztp terminate verbose
Mon Oct 10 16:52:38.507 UTC
Terminate ZTP? (this may leave your system in a partially configured state) [confirm] [y/n]:y
ZTP terminated