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”

pbnoscli# show platform summary
 Platform: x86_64-mlnx_msn4600c-r0

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

{
	"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"
		}
	}
}

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

{
	"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"
		}
	}
}