Description

This article outlines how to confirm whether an image file is already loaded on the device while upgrading the node.

Solution

Ideally, while upgrading a node, we execute both the staging of the image and rebooting of the device at the same time.

{master:0}
root@Switch> request system software add /var/tmp/jinstall-host-qfx-5e-x86-64-17.3R3-S6.3-secure-signed.tgz reboot
Verified jinstall-host-qfx-5e-x86-64-17.3R3-S6.3-secure-signed signed by PackageProductionEc_2019 method ECDSA256+SHA256
Pushing Junos image package to the host...
Installing /var/tmp/install-media-qfx-5e-junos-17.3R3-S6.3-secure.tgz
Extracting the package ...

============================================
Current Host kernel version : 3.14.52-rt50-WR7.0.0.9_ovp
Package Host kernel version : 3.14.52-rt50-WR7.0.0.9_ovp
Current Host version        : 3.1.0
Package Host version        : 3.0.5
Min host version required for applications: 3.0.5
Skipping Host OS upgrade!
============================================

Setting up Junos host applications for installation ...

JUNOS OS upgrade staged. Reboot the system to complete installation!

However, if the staging of the image is done separately first, then reboot, you can confirm the staging of image with the following logs:

{ master:0}
root@Switch> show log vjunos-install.log 
========================================
Mon Jan 27 07:15:45 UTC 2020
/packages/db/pkginst.94359/install_script.sh /packages/db/pkginst.94359/jinstall-host-qfx-5e-x86-64-17.3R3-S6.3-secure.tgz
Pushing Junos image package to the host...
Downloading Junos image package...
Installing /packages/db/pkginst.94359/jinstall-host-qfx-5e-x86-64-17.3R3-S6.3-secure.tgz
Installing /var/tmp/install-media-qfx-5e-junos-17.3R3-S6.3-secure.tgz
Extracting the package ...
 
============================================
Current Host kernel version : 3.14.52-rt50-WR7.0.0.9_ovp
Package Host kernel version : 3.14.52-rt50-WR7.0.0.9_ovp
Current Host version        : 3.1.0
Package Host version        : 3.0.5
Min host version required for applications: 3.0.5
Skipping Host OS upgrade!
============================================
 
Setting up Junos host applications for installation ...
 
JUNOS OS upgrade staged. Reboot the system to complete installation!
 
Install completed

Note: The above log message will be in /var/log , which is created during installation of an image on the device. This log will also show the complete history of all the staged image dates and timings and its status.

If we try to stage a new image while the previously staged image is already installed and the device has not been rebooted, then the following error may appear:

{master:0}
root@Switch> request system software add /var/tmp/jinstall-host-qfx-5e-x86-64-17.3R3-S6.3-secure-signed.tgz    
Verified jinstall-host-qfx-5e-x86-64-17.3R3-S6.3-secure-signed signed by PackageProductionEc_2019 method ECDSA256+SHA256
Pushing Junos image package to the host...
ERROR: There is pending upgrade. upgrade_in_progress=appupgrade_stage
ERROR: Please reboot the system to complete the installation or rollback before attempting another upgrade
ERROR: Failed to add jinstall-host-qfx-5e-x86-64-17.3R3-S6.3-secure-signed.tgz

In the above situation, perform an installation rollback using the following command

{master:0}
root@Switch> request system software rollback 
localre:
----------------------------------------------
Initating rollback on the Host.

Rollback of the staged upgrade is complete.