VyOS system rollback

From the previous post, we chatted about upgrading the VyOS system using different methods. However, what if something went sideways and did not go according to the system upgrade plan then what now?

This is going to be a short post and we are going to explore the options based on two different scenarios:

  1. After the system upgrade, the system is accessible, but something broke and need to roll back to the last known working version
  2. After/during the system upgrade, the system won’t boot anymore

Rolling back to the previous version

After upgrading and something broke, the system can always be rollbacked to a previous version. VyOS keeps all the previous firmware versions as long as the system storage provides it. The snippet below shows the output of show system image command.

As you can see, we have several images available for us to select if we were to desire to rollback the image. It also shows the default version it will boot on and the current running image.

# Here is a sample of rolling back from previous known version
vyos@fw01:~$ show system image ?
The system currently has the following image(s) installed:

   1: 1.2.5-epa1 (default boot) (running image)
   2: 1.2.4
   3: 1.2.3
   4: 1.2.2
   5: 1.2.1-lts
   6: 1.2.0-lts
   7: VyOS-1.1.8
   8: 1.2.0-rolling+201904130337
   9: 1.1.8

The system can be rollbacked by changing the default boot using the set system image default-boot <image>. The system needs to be reloaded for the default boot change to take effect.

vyos@fw01:~$ set system image default-boot ?
Possible completions:
  <Enter>       Execute the current command
  1.1.8         Default boot image name
  1.2.0-lts
  1.2.0-rolling+201904130337
  1.2.1-lts
  1.2.2
  1.2.3
  1.2.4
  1.2.5-epa1
  VyOS-1.1.8

      
vyos@fw01:~$ set system image default-boot 1.2.4
Default boot image has been set to "1.2.4".
You need to reboot the system to start the new default image.


vyos@fw01:~$ show system image ?
The system currently has the following image(s) installed:

   1: 1.2.5-epa1 (running image)
   2: 1.2.4 (default boot)
   3: 1.2.3
   4: 1.2.2
   5: 1.2.1-lts
   6: 1.2.0-lts
   7: VyOS-1.1.8
   8: 1.2.0-rolling+201904130337
   9: 1.1.8

vyos@fw01:~$ reboot

Now, what about for the second scenario? If the system upgrades failed, you can still recover from that disastrous situation. You can use the grub menu to select the known stable version and boot from it. Hopefully, the net-admin has access to a monitor or out-of-band such as IPMI or something similar. We will need to access the grub menu and this will happen during the boot-up process as shown in Figure 1.

vyos_grub
Figure 1

As shown in Figure 1, select the last known stable image to boot from and the system will be back the way it was before the disastrous upgrade. I hope you’ll this post useful.

Cheers!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
WordPress Appliance - Powered by TurnKey Linux