Junos OS

 View Only
last person joined: 3 days ago 

Ask questions and share experiences about Junos OS.
Expand all | Collapse all

ZTP on EX4550-32f 15.1R7-S13 fails to execute shell script

  • 1.  ZTP on EX4550-32f 15.1R7-S13 fails to execute shell script

    Posted 03-28-2023 16:36
    Edited by Michael Pappas 03-30-2023 13:47
    I am working on automation of Zero Touch Provisioning for Juniper devices. We have in our lab EX4550-32F switch with software version 15.1R7-S13, which is used for my tests and development. My task is adopt previously developed ZTP automation script to Juniper device.
    As it is described in the Junos® OS Software Installation and Upgrade Guide the ZTP process supports Shell scripts (/bin/sh) on all the devices. That is the feature that automation process relies on. But in my multiple tests and later by analyzing Junos utility script (image_load), which is invoked by the ZTP process, I found that it expects only boot image file and/or device configuration, which are supplied by DHCP server. Meaning the script option is not considered and therefore the automation process is not possible.
    Additional log information from the device (no sign of script execution or failure):

    root@:RE:0% find / -name test-juniper-script

    /var/tmp/test-juniper-script

    /packages/mnt/jweb-ex-15.1R7.9/jail/var/tmp/uploads/test-juniper-script

    root@:RE:0% /var/tmp/test-juniper-script

    /var/tmp/test-juniper-script: Authentication error.

    root@:RE:0% sh /var/tmp/test-juniper-script

    ###############

    Runnning test-junos-script Shell script on Junos device

    ###############

    root@:RE:0% ls -l /var/tmp/test-juniper-script

    -rw-r--r--  1 root  field  404 Jun 22 18:34 /var/tmp/test-juniper-script

    root@:RE:0% cd /var/log

    root@:RE:0% grep -n "test-juniper-script" *

    dhcp_logfile:361:Jun 22 18:34:28 AIU: Config Filename is test-juniper-script

    dhcp_logfile:380:Jun 22 18:34:28 AIU: Config Filename is test-juniper-script

    dhcp_logfile:431:Jun 22 18:34:36 AIU: spawn : /bin/sh /usr/sbin/image_load -G 172.22.143.63 -I vme -O install_reboot -D /var/tmp  -C test-juniper-script -F jinstall-ex-4500-15.1R7.9-domestic-signed.tgz -T http

    image_load_log:2:[Wed Jun 22 18:34:36 UTC 2022] /usr/sbin/image_load -G 172.22.143.63 -I vme -O install_reboot -D /var/tmp -C test-juniper-script -F jinstall-ex-4500-15.1R7.9-domestic-signed.tgz -T http

    image_load_log:4:[Wed Jun 22 18:34:46 UTC 2022] fetch