How to Upgrade/Downgrade SONiC ?

How to Upgrade/Downgrade SONiC ?

 SONiC Installer

This is a command line tool available as part of the SONiC software. If the device is already running the SONiC software, this tool can be used to install an alternate image in the partition. This tool has the facility to install an alternate image, list the available images and to set the next reboot image.

sonic-installer install

This command is used to install a new image on the alternate image partition. This command takes a path to an installable SONiC image or URL and installs the image.

Usage:sonic-installer install

Example:

admin@sonic:~$ scp servername@ipaddress:/image-file (To copy image file)

admin@sonic:~$ sonic-installer install filename.bin


New image will be installed, continue? [y/N]:y


sonic-installer list

This command displays information about currently installed images, currently running image and image set to be loaded in next reboot.

Usage:
sonic-installer list

Example:

admin@sonic:~$ sonic-installer list 
Current: SONiC-OS-HEAD.XXXX
Next: SONiC-OS-HEAD.XXXX
Available: 
SONiC-OS-HEAD.XXXX
SONiC-OS-HEAD.YYYY

 

sonic-installer set_default

This command is be used to change the image which can be loaded by default in all the subsequent reboots.

Usage:
sonic-installer set_default <image_name>

Example:

admin@sonic:~$ sonic-installer set_default SONiC-OS-HEAD.XXXX

sonic-installer set_next_boot

This command is used to change the image that can be loaded in the next reboot only. Note that it will fallback to current image in all other subsequent reboots after the next reboot.

Usage:
sonic-installer set_next_boot <image_name>

Example:

admin@sonic:~$ sonic-installer set_next_boot SONiC-OS-HEAD.XXXX

sonic-installer remove

This command is used to remove the unused SONiC image from the disk. Note that it's not allowed to remove currently running image.

Usage:
sonic-installer remove <image_name>

Example:

admin@sonic:~$ sonic-installer remove SONiC-OS-HEAD.YYYY

Image will be removed, continue? [y/N]: y


Updating GRUB...
Done
Removing image root filesystem...
Done
Command: grub-set-default --boot-directory=/host 0

Image removed