OpenSwitch is designed to work on ONIE based white-box switches. The build system from OpenSwitch produces ONIE installer images, and you can check the hardware compatibility lists to find if your hardware is supported.
You can get an image by building it yourself or downloading a pre-built one from the download section.
The ONIE specification leaves it up to the NOS to define the layout of the partitions. OpenSwitch uses three partitions on ONIE-based hardware: two partitions are for dual OpenSwitch installation and one partition for persistent configuration. The size of the partitions is defined by the target platform.
+--------------------+
| | Configuration partition:
| OpenSwitch Conf | Preserved across installations
| |
+--------------------+
| |
| OpenSwitch 1 | Primary Image Partition
| |
+--------------------+
| |
| OpenSwitch 2 | Secondary Image Partition
| |
+--------------------+
The two image partitions are used for dual-image boot purposes. During the initial installation the NOS is deployed to the first partition, and in subsequent updates or installations the new image will be installed on the inactive partition.
NOTE: OpenSwitch currently does not implement automatic rollback in case a newly-installed image fails to boot.
The configuration partition stores the permanent configuration of the switch and will be preserved across image installations. It also stores the grubenv file that notifies the installed grub about which is the active image partition.
There are several ways to install OpenSwitch (described below).
Since the images generated by OpenSwitch are ONIE-compatible installers, you can follow ONIE Quick Start Guide to identify a provisioning mechanism that suits your needs.
Follow these steps:
For this guide, Windows laptop running Windows 7 Enterprise is used.
Prerequisites:
- USB to Serial adapter should be used. For this case, Belkin Serial Adapter, model F5U257 is used. The corresponding driver for Windows 7 Enterprise can be found at http://www.belkin.com/us/support-article?articleNum=4644
- Connect the USB to serial adapter to the Windows laptop and install the driver.
- Make sure the new device shows up in Device Manager under Ports (COM & LPT) as Belkin USB-to-Serial-Adapter(COMx) x after COM will vary based on the USB port to which it is connected.
- Copy the onie installer openswitch-onie-installer-x86_64-as5712_54x-<> (eg.openswitch-onie-installer-x86_64-as5712_54x-0.3.0+2016030718) to a USB device. This can be downloaded from https://archive.openswitch.net/artifacts/periodic/master/<version>/as5712/
Follow these steps:
-
Connect the windows laptop to 5712 switch using the USB to Serial adapter
-
Using putty, choose below: Serial line : COM4 Speed : 115200
-
Once connected to the switch, reboot the switch
-
Wait for the menu
+----------------------------------------------------------------------------+
| OpenSwitch Primary Image |
| OpenSwitch Secondary Image |
| OpenSwitch Development -- NFS root |
|*ONIE |
| DIAG: Accton Diagnostic |
| |
+----------------------------------------------------------------------------+
Select ONIE, then ONIE: Rescue
+----------------------------------------------------------------------------+
| ONIE: Install OS |
|*ONIE: Rescue |
| ONIE: Uninstall OS | | ONIE: Update ONIE |
| ONIE: Embed ONIE |
| |
| |
+----------------------------------------------------------------------------+
In the ONIE prompt, run fdisk -l as below
ONIE:/ #
ONIE:/ # fdisk -l
Disk /dev/sda: 8048 MB, 8048869376 bytes
100 heads, 38 sectors/track, 4136 cylinders
Units = cylinders of 3800 * 512 = 1945600 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 4137 7860223+ ee EFI GPT
Disk /dev/sdb: 258 MB, 258998272 bytes
255 heads, 63 sectors/track, 31 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 32 252896+ c Win95 FAT32 (LBA)
Partition 1 has different physical/logical endings:
phys=(30, 254, 63) logical=(31, 124, 29)
Pick the partition that has the flash drive inserted (/dev/sdb1 in this case) and mount it:
ONIE:/ # mkdir /mnt/usb_drive_mount_point
ONIE:/ # mount /dev/sdb1 /mnt/usb_drive_mount_point/
Copy the onie installer file to a folder
ONIE:/ # ls /mnt/usb_drive_mount_point/
openswitch-onie-installer-x86_64-as5712_54x-0.3.0+2016030718
mkdir /onie-installer/
cp /mnt/usb_drive_mount_point/openswitch-onie-installer-x86_64-as5712_54x-0.3.0+2016030718 /onie-installer/
Run the installer:
ONIE:/onie-installer # ./openswitch-onie-installer-x86_64-as5712_54x-0.3.0\+2016030718
ONIE:/onie-installer # ./openswitch-onie-installer-x86_64-as5712_54x-0.3.0\+2016030718
OpenSwitch ONIE installer (version 1.0) for Accton AS5712 54x
Initializing Intel(R) Boot Agent GE v1.5.43
PXE 2.1 Build 092 (WfM 2.0)
Press Ctrl+S to enter the Setup Menu..
--- Installing OpenSwitch GRUB ---
Installation finished. No error reported.
OpenSwitch installation completed
Rebooting...
Once rebooted, login as root and check the version. It should match with the one that was installed:
root@switch:~# vtysh
switch# show version
OpenSwitch 0.3.0 (Build: 0.3.0+2016030718-0.3.0-20160307180748-dev)
switch#
Follow these steps:
- Boot your Switch into ONIE Rescue OS mode.
- Copy the OpenSwitch ONIE installer file to your TFTP directory.
- Enter the following commands:
tftp -g -r <onie-installer-file> -l <onie-installer-file> <tftp-server>
chmod +x <onie-installer-file>
./<onie-file> # will reboot automatically
If there was a previously installed version of OpenSwitch, the installer will identify the inactive partition and will install there (preserving the configuration partition). If you want to perform a clean installation that removes the configuration partition and installs on the first image partition, you can set the variable OPS_CLEAN_INSTALL to true before invoking the installer. For example:
export OPS_CLEAN_INSTALL=true
./<onie-installer-file>
Since OpenSwitch uses a dual image partition you can copy the to the file system inside a running OpenSwitch installation and run the following commands to install a new image on the inactive partition:
chmod +x <onie-installer-file>
./<onie-installer-file>
In this scenario the switch won't reboot automatically and you have to reboot manually. Clean installation is not possible from inside a running OpenSwitch image, and you will have to reboot into ONIE mode to perform it if required. If you want to reboot into ONIE installation mode, the OpenSwitch Linux shell offers a command that will trigger a reboot into ONIE install mode:
systemctl isolate onie-install