Before you install SONiC on your switch, make sure the switch is supported.
This topic describes installing SONiC onto an ONIE-enabled NVIDIA Spectrum switch with a Spectrum-family ASIC. If you plan on installing SONiC onto a switch from a different manufacturer, you can get the image from the Azure GitHub site. But the installation steps are the same.
The installation uses ONIE, the Open Network Install Environment, which is a boot loader for installing open network operating systems.
The NVIDIA Mellanox install images are available here. Once you download the image, you can install SONiC from a USB drive or over the network.
If you need to build your own Pure (vendor independent) SONiC image, read this post on the NVIDIA developer blog.
Prepare to Install the SONiC Image
The switch may already have ONIE or another network operating system installed. In order to install SONiC on it, follow the preparatory steps below before you start installing SONiC.
Using a SONiC release earlier than 201811 might require upgrades to the BIOS and ONIE. For instructions, please contact your switch manufacturer.
Verify your switch model is supported.
Connect to the switch via the serial console.
If the switch has a network operating system installed, uninstall the existing NOS first before installing SONiC. To do so, simply boot into ONIE and select Uninstall OS:
GNU GRUB version 2.02-beta3 +----------------------------------- | ONIE: Install OS | ONIE: Rescue | *ONIE: Uninstall OS | ONIE: Update ONIE | ONIE: Embed ONIE
Reboot the switch into ONIE and select Install OS.
A discovery process starts automatically, searching for the OS to install. Stop the ONIE discovery by running:
Verify SMIBIOS parameters by running:
onie:$ dmidecode -t1 -t2 | grep "Product Name" Product Name: MSN2700 Product Name: VMOD0001
Install Using the RJ-45 Console
Connect the host PC to the console (RJ-45) port of the switch system using the supplied cable.
Make sure to connect to the console RJ-45 port of the switch and not to the management port.
Configure a serial terminal with the settings described below.
The baud rate might be different based on the BIOS or ONIE version.
Parameter Setting Baud Rate 115200 Data bits 8 Flow Control None Parity None Stop bits 1
Install Using the Management IP
DHCP is enabled by default over the management port. Therefore, if you configured your DHCP server and connected an RJ-45 cable to the management port, you can log in using the designated IP address.
Install over USB
These steps assume you are using an Ubuntu 18.04 host. The drive paths and formatting might be different on your system and operating system.
To install over USB, do the following:
Insert a formatted USB drive into the system where you downloaded the SONiC install image.
Copy the install image to the root directory of a USB drive, naming it
ubuntu:~$ sudo mkdir /mnt/usb ubuntu:~$ sudo mount /dev/sdb1 /mnt/usb ubuntu:~$ sudo cp sonic-mellanox.bin /mnt/usb/onie-installer ubuntu:~$ sudo umount /mnt/usb
Remove the USB drive from your system and insert it into the USB port on the switch, then power on the switch. ONIE discovers the
onie-installerfile on the root of the USB drive and executes it.
Install over the Network
To install SONiC over the network, make sure the SONiC installer image is available on the network over HTTP. The simplest network installation is when the web/HTTP server is directly connected to the Ethernet management port on the switch where you want to install SONiC.
To install SONiC, do the following:
Copy the SONiC installer image to the root directory of the HTTP server, then create a symlink to
onie_installer.binso ONIE can easily find the installer. For Apache on Ubuntu, the root directory is
image-server:~$ sudo cp sonic_installer.bin /var/www image-server:~$ sudo ln -s sonic_installer.bin ./onie_installer.bin
curlon a different system, verify the SONiC installer download from the HTTP server.
ubuntu_server:~$ curl http://<Your HTTP Server>/onie_installer.bin
Power on the switch. ONIE discovers the IP address (either IPv6 or IPv4) of the link local Web server. For more information on how ONIE discovers its link local neighbors, see the ONIE documentation.
After neighbor discovery, ONIE makes HTTP requests for a series of default installer image file names as described in the ONIE documentation.
Next, ONIE applies the default file name conventions, then it makes HTTP requests looking for an installer image. In our example, ONIE should find the
onie_installer.bindisk image and start the install.