Rolling back an upgrade on Junos

On Juniper devices, there are two steps performed during the upgrade.

The first is to push the software to the device and the second one is to reboot the device so that the software would be installed.

You can perform these two steps in a single operation(add ‘reboot’ knob) or you can split the two steps in two operations.

You might take the second approach in case you want to install the software(which needs a reboot) later in a MW so you won’t cause a service impact during business hours.

This poses a problem because in case you would like to cancel the upgrade and someone reboot the device, then after reboot, it will have the new version.

So this is how you can cancel a pending upgrade.

For instance, this is the history of the software installations on this VC, first 11.4R8 was installed and then 12.3R6, so the current release is 12.3R6:

 

{master:1}
root@EX4200-VC> show version member 0 
fpc0:
--------------------------------------------------------------------------
Hostname: EX4200-VC
Model: ex4200-24f
JUNOS Base OS boot [12.3R6.6]
JUNOS Base OS Software Suite [12.3R6.6]
JUNOS Kernel Software Suite [12.3R6.6]
JUNOS Crypto Software Suite [12.3R6.6]
JUNOS Online Documentation [12.3R6.6]
JUNOS Enterprise Software Suite [12.3R6.6]
JUNOS Packet Forwarding Engine Enterprise Software Suite [12.3R6.6]
JUNOS Routing Software Suite [12.3R6.6]
JUNOS Web Management [12.3R6.6]
JUNOS FIPS mode utilities [12.3R6.6]

{master:1}
root@EX4200-VC> show system snapshot media internal member 0 
fpc0:
--------------------------------------------------------------------------
Information for snapshot on       internal (/dev/da0s1a) (backup)
Creation date: May 29 01:44:00 2013
JUNOS version on snapshot:
  jbase  : ex-11.4R8.5
  jkernel-ex: 11.4R8.5
  jcrypto-ex: 11.4R8.5
  jdocs-ex: 11.4R8.5
  jswitch-ex: 11.4R8.5
  jpfe-ex42x: 11.4R8.5
  jroute-ex: 11.4R8.5
  jweb-ex: 11.4R8.5
   fips-mode-powerpc: 11.4R8.5
Information for snapshot on       internal (/dev/da0s2a) (primary)
Creation date: Mar 13 10:37:04 2014
JUNOS version on snapshot:
  jbase  : ex-12.3R6.6
  jkernel-ex: 12.3R6.6
  jcrypto-ex: 12.3R6.6
  jdocs-ex: 12.3R6.6
  jswitch-ex: 12.3R6.6
  jpfe-ex42x: 12.3R6.6
  jroute-ex: 12.3R6.6                   
  jweb-ex: 12.3R6.6
  fips-mode-powerpc: 12.3R6.6
                                        
{master:1}
root@EX4200-VC>

 

I will upgrade to 12.3R7, but without rebooting:

 

{master:1}
root@EX4200-VC> ... add /var/tmp/jinstall-ex-4200-12.3R7.7-domestic.tgz    

[Nov  6 09:37:36]: Retrieving software images. This process can take several minutes. Please be patient..

[Nov  6 09:37:40]: Retrieving version and model information from /var/tmp/jinstall-ex-4200-12.3R7.7-domestic.tgz

[Nov  6 09:37:51]: Checking pending install on fpc0

[Nov  6 09:37:51]: Checking pending install on fpc1
[Nov  6 09:37:51]: Pushing bundle to fpc0

[Nov  6 09:38:16]: Validating on fpc0

[Nov  6 09:38:31]: Validating on fpc1
[Nov  6 09:38:32]: Done with validate on all virtual chassis members

fpc0:
WARNING: A reboot is required to install the software
WARNING:     Use the 'request system reboot' command immediately

fpc1:
WARNING: A reboot is required to install the software
WARNING:     Use the 'request system reboot' command immediately

{master:1}
root@EX4200-VC>

 

If I need to cancel the upgrade, I can use ‘request system software rollback’:

 

{master:1}
root@EX4200-VC> request system software rollback    
fpc0:
--------------------------------------------------------------------------
software update backed out.

fpc1:
--------------------------------------------------------------------------
software update backed out.

{master:1}
root@EX4200-VC>

 

The same command can be used to toggle between releases(the current one and the previous one):

 

{master:1}
root@EX4200-VC> request system software rollback    
fpc0:
--------------------------------------------------------------------------
Junos version '11.4R8.5' will become active at next reboot

fpc1:
--------------------------------------------------------------------------
Junos version '11.4R8.5' will become active at next reboot

{master:1}
root@EX4200-VC> request system software rollback                
fpc0:
--------------------------------------------------------------------------
Junos version '12.3R6.6' will become active at next reboot

fpc1:
--------------------------------------------------------------------------
Junos version '12.3R6.6' will become active at next reboot

{master:1}
root@EX4200-VC>

 

Unfortunately, I haven’t found a way to figure out that there is a pending installation.

You could check the logs, but this is not something easily seen:

 

{master:1}
root@EX4200-VC> show log messages | match software    
Nov  6 10:00:54  EX4200-VC mgd[11707]: %INTERACT-6-UI_CMDLINE_READ_LINE: User 'root', command 'request system software add /var/tmp/jinstall-ex-4200-12.3R7.7-domestic.tgz '
Nov  6 10:28:46  EX4200-VC mgd[13146]: %INTERACT-6-UI_CMDLINE_READ_LINE: User 'root', command 'request system software rollback '
Nov  6 10:28:47  EX4200-VC mgd[13217]: %INTERACT-6-UI_CMDLINE_READ_LINE: User 'root', command 'command rpc rpc command request system software rollback rollback no-forwarding '
Nov  6 10:28:57  EX4200-VC mgd[13146]: %INTERACT-6-UI_CMDLINE_READ_LINE: User 'root', command 'show log messages | match software '

{master:1}
root@EX4200-VC>

 

 

The following two tabs change content below.

Paris ARAU

Paris ARAU is a networking professional with strong background on routing and switching technologies. He is a holder of CCIE R&S and dual JNCIE(SP and ENT). The day to day work allows him to dive deeply in networking technologies. Part of the continuously training, he is focusing on Software Defined Network and cloud computing.

Comments

This post currently has 3 responses

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar



%d bloggers like this: