[Enterprise SONiC] Installation & Upgrade image Follow
How to install SONiC images, how to upgrade, how to set start-up image when you have multiple images in your device and how to remove the image you don't need.
- Install SONiC from HTTP or TFTP via ONIE
- Install SONiC from USB via ONIE
- Edgecore SONiC Upgrade
- Edgecore SONiC Upgrade via USB
- Specified the startup image
- Remove installed image
Tested model & firmware version:
- Switch model name:
AS7326-56X
- Edgecore SONiC version:
202006.4
202012.0~202012.7
202111.0~202111.8
Restriction:
- Suggest you should not install different branch SONiC image on switch, it may cause some exception issue.
- If your switch installed SONiC, you login to "ONIE :install OS" mode via grub, it will let the grub miss SONiC option. After 202111.3, default login onie will be resued mode. It avoid grub miss SONiC option
Install SONiC from HTTP or TFTP via ONIE
Topology:
Procedure:
Step 1. Enter the ONIE install mode
Note: Switch shall automatically enter the ONIE install mode if there's no NOS installed yet.
GNU GRUB version 2.02
+----------------------------------------------------------------------------+
|*ONIE: Install OS |
| ONIE: Rescue |
| ONIE: Uninstall OS |
| ONIE: Update ONIE |
| ONIE: Embed ONIE |
| DIAG: Accton Diagnostic (accton_as7326_56x) |
| |
| |
| |
| |
| |
| |
+----------------------------------------------------------------------------+
Use the ^ and v keys to select which entry is highlighted.
Press enter to boot the selected OS, `e' to edit the commands
before booting or `c' for a command-line.
The highlighted entry will be executed automatically in 2s.
Caution:
Since switch will automatically start the ONIE Service Discovery, this command can make user types easily.
This is not a necessary command. It won't affect installation no matter user execute it or not.
ONIE:/ # onie-discovery-stop
discover: installer mode detected.
Stopping: discover... done.
Caution: Default ONIE will get ip from DHCP
Step 3. Install the image from remote URL via HTTP or TFTP
If the installation is successful, the device will reboot automatically and boot-up with SONiC.
After finish the installation, user might need to check this article.
Install SONiC from USB via ONIE
Restriction:
- The ONIE don't support NTFS file system.
Topology:
Procedure:
Step 1. Copy Edgecore SONiC installer file to USB flash drive with a name "onie-installer".
Step 2. Reboot switch and plug in USB drive to switch
Step 3. Enter ONIE install mode
GNU GRUB version 2.02
+----------------------------------------------------------------------------+
|*ONIE: Install OS |
| ONIE: Rescue |
| ONIE: Uninstall OS |
| ONIE: Update ONIE |
| ONIE: Embed ONIE |
| DIAG: Accton Diagnostic (accton_as7326_56x) |
| |
| |
| |
| |
| |
| |
+----------------------------------------------------------------------------+
Use the ^ and v keys to select which entry is highlighted.
Press enter to boot the selected OS, `e' to edit the commands
before booting or `c' for a command-line.
The highlighted entry will be executed automatically in 2s.
Step 4. Wait for ONIE to discover USB and start automatically uploading new firmware via USB drive.
ONIE: Starting ONIE Service Discovery
Info: Attempting file://dev/sdb1/onie-installer-x86_64-accton_as7326_56x-r0 ...
Info: Attempting file://dev/sdb1/onie-installer-x86_64-accton_as7326_56x-r0.bin ...
Info: Attempting file://dev/sdb1/onie-installer-x86_64-accton_as7326_56x ...
Info: Attempting file://dev/sdb1/onie-installer-x86_64-accton_as7326_56x.bin ...
Info: Attempting file://dev/sdb1/onie-installer-accton_as7326_56x ...
Info: Attempting file://dev/sdb1/onie-installer-accton_as7326_56x.bin ...
Info: Attempting file://dev/sdb1/onie-installer-x86_64-bcm ...
Info: Attempting file://dev/sdb1/onie-installer-x86_64-bcm.bin ...
Info: Attempting file://dev/sdb1/onie-installer-x86_64 ...
Info: Attempting file://dev/sdb1/onie-installer-x86_64.bin ...
Info: Attempting file://dev/sdb1/onie-installer ...
Info: Attempting file://dev/sdb1/onie-installer.bin ...
Info: Attempting file://dev/sdb/onie-installer-x86_64-accton_as7326_56x-r0 ...
Info: Attempting file://dev/sdb/onie-installer-x86_64-accton_as7326_56x-r0.bin ...
Info: Attempting file://dev/sdb/onie-installer-x86_64-accton_as7326_56x ...
Info: Attempting file://dev/sdb/onie-installer-x86_64-accton_as7326_56x.bin ...
Info: Attempting file://dev/sdb/onie-installer-accton_as7326_56x ...
Info: Attempting file://dev/sdb/onie-installer-accton_as7326_56x.bin ...
Info: Attempting file://dev/sdb/onie-installer-x86_64-bcm ...
Info: Attempting file://dev/sdb/onie-installer-x86_64-bcm.bin ...
Info: Attempting file://dev/sdb/onie-installer-x86_64 ...
Info: Attempting file://dev/sdb/onie-installer-x86_64.bin ...
Info: Attempting file://dev/sdb/onie-installer ...
Info: Attempting file://dev/sdb/onie-installer.bin ...
ONIE: Executing installer: file://dev/sdb1/onie-installer.bin
Verifying image checksum ... OK.
Preparing image archive ... OK.
Installing SONiC in ONIE
ONIE Installer: platform: x86_64-broadcom-r0
onie_platform: x86_64-accton_as7326_56x-r0
If the installation is successful, the device will reboot automatically and boot-up with SONiC.
After finish the installation, user might need to check this article.
Edgecore SONiC Upgrade
Restriction:
If the switch have different branch image, please reset configuration in new image. (Detail refer the section of “Installation / Upgrade” in release note)
Username/password will not be migrated after upgrading SONiC version.
(Starting from versions 202111.10 and 202211.3, the username and password will be migrated to the newly installed image. Please note that this migration only takes effect when upgrading from one supported version to another.)
Topology:
Step 1. Check the image
admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Next: SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Available:
SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Step 2. Set the manangement IP (Refer to Management and front port IPv4/IPv6 Address)
admin@sonic:~$ sudo config interface ip add eth0 192.168.1.2/24
Step 3. Upgrade image from remote HTTP server
admin@sonic:~$ sudo sonic_installer install http://192.168.1.1/Edgecore-SONiC_20231127_051854_ec202111_657.bin -y
Caution:
- It could only use HTTP to upgrade.
- If the current switch configuration include "management vrf" and the http server connect to management port, please do update via "ip vrf exec mgmt" command as bellowing.
admin@sonic:~$ sudo ip vrf exec mgmt sonic_installer install http://192.168.1.3/Edgecore-SONiC_20231127_051854_ec202111_657.bin -y
Step 4. Check the images.
admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Next: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Available:
SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Note: The "Next" boot-up image shall be set with new image automatically.
Step 5. Reboot device
admin@sonic:~$ sudo reboot
Step 6. Check the images status
admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Next: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Available:
SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Edgecore SONiC Upgrade via USB
Restriction:
SONiC doesn't support the filesystem type 'NTFS'.
Username/password will not be migrated after upgrading SONiC version
(Starting from versions 202111.10 and 202211.3, the username and password will be migrated to the newly installed image. Please note that this migration only takes effect when upgrading from one supported version to another.)
root@SWL:/mnt# mount /dev/sdb1 /mnt/test
mount: /mnt/test: unknown filesystem type 'ntfs'.
Topology:
Procedure:
Step 1: Confirm the position of the USB.
root@sonic:~# fdisk -l
Disk /dev/sda: 59.6 GiB, 64023257088 bytes, 125045424 sectors
Disk model: TS64GMTS400
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: CADCD667-AE6B-4F9F-8969-A00D3ADBDBC0
Device Start End Sectors Size Type
/dev/sda1 2048 526335 524288 256M EFI System
/dev/sda2 526336 788479 262144 128M ONIE boot
/dev/sda3 788480 1050623 262144 128M Linux filesystem
/dev/sda4 1050624 68159487 67108864 32G Linux filesystem
Disk /dev/loop0: 405 MiB, 424693760 bytes, 829480 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdb: 3.8 GiB, 4043309056 bytes, 7897088 sectors
Disk model: USB Flash Drive
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x94723316
Device Boot Start End Sectors Size Id Type
/dev/sdb1 128 7897087 7896960 3.8G c W95 FAT32 (LBA)
Step 2: Create a folder and mount the USB to the folder that you create.
root@sonic:~# mkdir /mnt/test
root@sonic:~# mount /dev/sdb1 /mnt/test
root@sonic:~# cd /mnt/test
root@sonic:/mnt/test# ls
Edgecore-SONiC_20231127_051854_ec202111_657.bin
Step 3: Upgrade image from the USB
root@sonic:/mnt/test# sudo sonic_installer install /mnt/test/Edgecore-SONiC_20231127_051854_ec202111_657.bin
Warning: 'sonic_installer' command is deprecated and will be removed in the future
Please use 'sonic-installer' instead
New image will be installed, continue? [y/N]: y
Step 4: Check the images.
root@sonic:/mnt/test# sudo sonic-installer list
Current: SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Next: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Available:
SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Step 5. Reboot device
admin@sonic:~$ sudo reboot
Specified the startup image
Procedure:
Step 1. Check the images status
admin@sonic:~$ sudo sonic_installer list
Current: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Next: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Available:
SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Caution:
- "Current" image, it mean the running image
- "Next" image, it mean the next boot up image.
- "Available" images, it mean installed SONiC images.
Step 2. Change the default boot-up image
admin@sonic:~$ sudo sonic_installer set_default SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Command: grub-set-default --boot-directory=/host 1
Step 2. Check the image status
admin@sonic:~$ sudo sonic_installer list
Current: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Next: SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Available:
SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
Then the "Next" boot-up image changed.
Caution:
You can choose the boot-up image in GRUB menu directly, but this way won't change the default boot-up image.
Remove installed image
Procedure:
Step 1. Check the images status
admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Next: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Available:
SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575
SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Step 2. Remove the image
admin@sonic:~$ sudo sonic-installer remove SONiC-OS-Edgecore-SONiC_20231006_073817_ec202111_575 -y
Updating GRUB...
Done
Removing image root filesystem...
Done
Command: grub-set-default --boot-directory=/host 0
Image removed
Step 3. Check the images status
admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Next: SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Available:
SONiC-OS-Edgecore-SONiC_20231127_051854_ec202111_657
Comments
0 comments
Please sign in to leave a comment.