Junos OS Upgrade with request system software add - 夜莺博客

Junos OS Upgrade with request system software add

Upgrading Junos OS looks like a one-liner - request system software add ... reboot - but the details decide whether the upgrade is boring or a change-window disaster: the image must live in /var/tmp, the configuration should be validated against the new version first, and you need a rollback path if the new release misbehaves. This guide walks through a safe Junos OS upgrade from image download to verification and rollback, including the validate/no-validate choice and the behavior on dual Routing Engine systems.

Step 1: Download the Image to /var/tmp

Always download the software image to /var/tmp - on EX and QFX switches other directories are not supported, and /var/tmp is the recommended location on all platforms:

user@switch> request file copy ftp://10.10.10.5/junos-install-qfx-x86-64-22.4R1.15.tgz /var/tmp/
user@switch> file list /var/tmp

Step 2: Validate Before Installing

The validate option checks the candidate software against the current configuration for compatibility, without changing anything. Run it when upgrading between releases that support direct validation:

user@switch> request system software validate /var/tmp/junos-install-qfx-x86-64-22.4R1.15.tgz

If validation reports a configuration incompatibility, fix the config before proceeding. When direct validation is not supported between your current and target releases, choose one of these instead: no-validate (skips validation; configuration could fail after upgrade - only for the first hop to a new train), validate-on-host (validate against a host already running the target version), or validate-on-routing-engine on dual-RE systems where the other RE already runs the target.

Step 3: Install and Reboot

Add the package with reboot in one command so the device installs and restarts automatically:

user@switch> request system software add /var/tmp/junos-install-qfx-x86-64-22.4R1.15.tgz reboot

The device verifies the package signature, installs it, and reboots. If you add the package without reboot, Junos continues running the old version until you issue request system reboot - and you can still cancel the pending install with request system software delete.

Step 4: Verify the New Version

user@switch> show version
user@switch> show system uptime
user@switch> show chassis environment

Confirm the new version is active, all FPCs/modules are online, and alarms are clear before moving on.

Step 5: Roll Back If Needed

Junos keeps the previous software set so you can return to it if the new release has issues. Roll back and reboot to load the old version:

user@switch> request system software rollback
Reboot the system to complete the rollback? [yes,no] yes

After the reboot the device runs the previous release. You can also delete stored software packages you no longer need:

user@switch> request system software delete junos-install-qfx-x86-64-22.2R1.tgz

Dual-RE and High-Availability Notes

  • On dual-Routing Engine systems, direct (in-service) upgrades are possible by specifying the RE or using ISSU-capable flows; otherwise upgrade the backup RE first, switch over, then upgrade the other.
  • Take a configuration snapshot before upgrading (the rescue configuration is a good baseline): request configuration rescue save.
  • Schedule maintenance windows for non-ISSU upgrades on devices carrying production traffic, and always keep the old image until the new release has run stable for a few days.

Related reading: Junos rescue configuration save and recovery and Junos commit confirmed and safe configuration rollback.

Original article: request system software add (Junos OS CLI Reference)