arrow-left

All pages
gitbookPowered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

ZTP Boot File

The boot file is written in YAML and contains switch models, and under each switch model are several fields that instruct the ZTP process. The boot file may contain up to four fields under each switch model:

  • Image - This instructs ZTP to update the switch firmware image to the specified image and configure it as the next boot image on the switch

  • Configuration - This instructs ZTP to copy the specified configuration file from the TFTP (or HTTP) server and use it as the startup configuration file on the switch. The file should be renamed to iscli_db.cfg

  • Script - This instructs ZTP to copy the script file and execute it on the switch

  • Reboot - This instructs whether to reboot the switch after ZTP

ZTP checks the boot file for the switch model and executes it according to the fields under the correct switch model. ZTP supports the execution of Python scripts, If there is a script field under the switch model in the boot file, that field has a higher priority than the other two fields (image and configuration), thus ZTP executes it first. ZTP downloads the Python script file to the switch and executes it. The script can also contain instructions to download and install a switch firmware image and a configuration file. Users can leave some of the fields empty, ZTP will just skip the corresponding options.

The platform or hardware model should be taken from the “show platform summary”

The following example shows a boot file for a TFTP server:

The following example shows a boot file for an HTTP server:

pbnoscli# show platform summary
 Platform: x86_64-mlnx_msn4600c-r0
{
	"x86_64-mlnx_msn4600c-r0": {
		"FIRMWARE": {
			"image": "sonicpbnos-broadcom-1.0.0.bin"
		},
		"CONFIGURATION": {
			"config": "iscli_db.cfg"
		},
		"RUN_SCRIPT": {
			"script": "boot_script.py"
		},
		"REBOOT": {
			"reboot": "true"
		}
	}
}
{
	"x86_64-accton_as5812_54x-r0": {
		"FIRMWARE": {
			"image": "http://192.168.0.98/images/sonicpbnos-broadcom-1.0.0.bin"
		},
		"CONFIGURATION": {
			"config": "http://192.168.0.98/images/iscli_db.cfg"
		},
		"RUN_SCRIPT": {
			"script": "http://192.168.0.98/images/boot_script.py"
		},
		"REBOOT": {
			"reboot": "true"
		}
	}
}

Enable ZTP

ZTP can be force enabled to start up the ZTP process. After enabling ZTP, reboot the switch which triggers the ZTP process to kick start.

To force enable/disable ZTP on the switch, use the following command:

hashtag
Reference

Command

hashtag
Example

hashtag
Trigger ZTP manually -

When you run the above commands, the switch will:

  1. It will Trigger the ZTP process and download the image, configuration, and script files.

  2. Install the downloaded files.

  3. Reboot the switch.

hashtag
Trigger ZTP during reboot -

When you run the above commands, the switch will:

  1. Trigger the ZTP process: The ZTP process will automatically kick in after the switch reboots. ZTP will download the image, configuration, and script files, if any.

  2. Install the image, and configuration, and run any script files.

  3. After the files are installed, the switch will automatically reboot.

circle-info

After any of the above methods, the ZTP will not be disabled automatically and will need to be manually enabled if required.

After rebooting, the switch will come up with the new image.

Once the switch comes back up, it will be running the new image.

ztp force <enable/run>

Description

Trigger ZTP process

Parameters

enable,run

Mode

EXEC


pbnoscli# configure terminal 
pbnoscli(config)# ztp force 
 enable                 run                   
pbnoscli(config)# ztp force 
  enable                Enable
  run                   Trigger ZTP process
pbnoscli(config)# ztp force enable
pbnoscli(config)# ztp force run
pbnoscli(config)# end
pbnoscli#
pbnoscli(config)# ztp force enable
pbnoscli(config)# ztp force run
pbnoscli(config)# ztp force enable
pbnoscli(config)# end
pbnoscli# reboot 

Check if running config is saved

Do you want to reboot the device [y/n]: y

pbnoscli# show running-config 
configure terminal
!
interface mgmt
ip address 10.4.4.52/24 gateway 10.4.4.1
!
ztp force enable
!
pbnoscli# 

Zero Touch Provisioning

Zero Touch Provisioning (ZTP) enables a switch to automatically provision itself using the resources available on the network without manual intervention. ZTP is triggered only when it is force-enabled from ISCLI. When APB with ZTP enabled starts up, it locates a DHCP server which provides the switch with an IPv4 management IP address and a gateway IP address. The switch then obtains the IP address of a TFTP (or HTTP) server from which it downloads the necessary boot file. The switch then runs the boot file.

During the boot process, if the ZTP is enabled, the switch enters ZTP mode. The switch searches for available DHCP servers and requests them to acquire an interface address, a gateway address, the TFTP server address, and the boot file name. After the information from the DHCP server is obtained, ZTP downloads and runs the boot file, and then executes the ZTP process according to the boot file. ZTP automatically handles the process of upgrading the switch firmware image and installing configuration files.

ZTP handles firmware upgrades from ONIE to APB and APB to APB

circle-info
  • If ZTP was force enabled and no DHCP server was found during the ZTP process, the switch will remove any management IP that may have been configured previously

  • Important ZTP events are logged by the switch and are available for display from a console

The following topics provide you with more information on Zero Touch Provisioning(ZTP)

DHCP Discoverychevron-right
ZTP Boot Filechevron-right
Enable ZTPchevron-right

DHCP Discovery

After entering ZTP mode, the switch sends a DHCP discovery message on its management interface, requesting DHCP offers from the DHCP servers present on the network. The DHCP server replies with a DHCP offer message. When the switch receives the DHCP offer message, it will look for following information in the offer:

  • An interface IPv4 address

  • A gateway IPv4 address

  • A TFTP or HTTP server IP address (using option 66)

  • Boot file name (using option 67)

The switch completes the DHCP negotiation process (request and acknowledgement) with the DHCP server, which assigns the switch with an IPv4 management address. The switch then uses the acquired TFTP or HTTP server IP address to contact that server to get the boot file, The option 67 contains the complete file path of the boot file on the remote server. The switch then downloads the boot file.

If no DHCP servers reply is received after DHCP discovery message or if the DHCP offer does not meets the ZTP requirements, the switch won't be able to complete the DHCP negotiation and the switch exits ZTP mode and continues the normal boot process.

circle-info
  • The interface IPv4 address obtained from the DHCP server is kept and used as management address even after the ZTP process completes

  • DHCP servers must be configured with options 66 and 67 to ensure that the switch always obtains the TFTP server hostname and the boot file name during the ZTP process. DHCP options 66 and 67 are enabled by default on the APB. If either of them is disabled, the ZTP process results in a failure.