Installing PICOS on Bare Metal Switches using AmpCon



AmpCon™ (Amplified Control) is an automation framework explicitly designed for open access networks. AmpCon radically simplifies the turn-on and configuration of very large numbers of remote switches via its unique Push-Button-Deployment capability. This guide assumes the AmpCon application has been previously installed on a server and set up with the appropriate PICOS images and configurations to perform automated switch configuration and deployment tasks.


PICOS can be installed using one of the following ways:

  1. If switch already has OS, then follow steps given in section Install PICOS by Breaking into ONIE Recue Mode.
  2. If switch has no OS or if you have uninstalled OS, then follow steps given in section Zero Touch Provisioning (ZTP) of the PICOS Image on the Dell Switch Using AmpCon.

Install PICOS by Breaking into ONIE Recue Mode

For the Dell switches that came with preinstalled OS and ONIE, follow these two steps:

Step 1: Break into ONIE (Open Network Install Environment). This is done for the switches that came with preinstalled OS and ONIE. ONIE is an open-source project of the OCP (Open Compute Project), and comes preinstalled on all Dell open networking switches. ONIE provides the environment to install any network operating system on a bare metal network switch.

Step 2: From the ONIE prompt install the PICOS image in the switch using AmpCon.

Prerequisite

To install PICOS on bare metal switches using AmpCon, you should finish the following four steps on AmpCon Server before proceeding to the next operation.

  1. Setup the PICOS image for a specific switch model
  2. Setup Global and Security configurations
  3. Upload switch model-specific template
  4. Generate the switch config

For details of each step, see the following link: Staging a Switch for Automated Deployment in AmpCon.

Interrupt the Boot Sequence to Break into ONIE to Install the PICOS Image

Dell N3048EP-ON/N3048ET-ON

These are the steps to break into ONIE to install a PICOS image:

  • You need to log in through the console port of the switch and perform the ONIE installation described in this section.
  • Enter the Boot Main Menu then power on the switch. When the Dell Networking Boot Options menu appears, choose option "2" to enter Boot Main Menu. The following Boot Options may vary between various models of Dell switches. Select "Display Boot Menu" option.

  • Enter ONIE rescue mode. When Boot Main Menu appears, choose option "13" to enter ONIE rescue mode. The following Boot Main Menu options may vary between various models of Dell switches. Select "Boot ONIE (Rescue mode)" option.

X86 Platforms

On x86 platform, it uses GRUB menu to install OS via ONIE.

These are the steps to break into ONIE to install a PICOS image:

  • You need to log in through the console port of the switch and perform the ONIE installation described in this section.
  • Reboot the system, and enter ONIE installation environment from the GRUB menu:

  • Enter ONIE rescue mode. From GRUB prompt, choose ONIE: Rescue to Install OS, boot ONIE in rescue mode.

ARM Platforms

1.  Power on the switch and interrupt the boot sequence by pressing any key when the following line is shown:

2.  From U-Boot prompt, boot ONIE in rescue mode.

Installing the PICOS Image on the Switch Using AmpCon

AmpCon acts as both HTTP PICOS firmware repository and ZTP platform. Once the device contacts AmpCon, AmpCon deploys the switch firmware.  The device then installs the new PICOS firmware and automatically reboots as part of the normal ONIE process. The deployed firmware includes an Automation Agent that (runs on the device after initial bootup) to help setup a secure (OpenVPN) tunnel to AmpCon  and assists the device in continuing with the ZTP process. Once the PICOS device has completed the boot process, the Automation Agent will attempt to contact AmpCon and register with it to complete the rest of the ZTP process. If the agent can’t find a route to AmpCon via eth0, it will automatically change the device’s management configuration to use “system inband” to try and find a route to AmpCon, or if either of the following events occur:

  • No default gateway has been configured on the switch or provisioned by DHCP to the device’s out-of-band management-ethernet interface/port.
  • A STATIC IP has been set for the out-of-band management-ethernet port/interface, but no default Gateway has been defined.

Hence it is important to configure a default gateway as part of the Global Config file for using Out-Of-Band (OOB).

If the device can’t find a route to AmpCon, the agent will automatically rotate between the out-of-band and “system inband” paths until it is able to reach AmpCon. Once the switch is fully deployed, AmpCon sets a local flag (read by the agent) to “Deployed” and the agent will not run again on subsequent reboots of the switch.

From the ONIE prompt, run the following command to install PICOS using AmpCon.

ONIE# wget http://<IP Address or AmpConServerName.domain.com>:80/onie&&sh onie 


In the above URL, AmpCon host name is used. Alternatively, you can also use the IP address of the AmpCon server. After entering the above command, the installer will run, install PICOS, and then reboot the switch reboot automatically. After this reboot, the system will come up running the PICOS operating system.
Following is an example output for this installation.

ONIE:/ # wget http://192.168.42.106:80/onie&&sh  onie
Connecting to ac.ampcon.local:80 (192.168.0.1:80)	
onie	100% |*******************************| 1048	0:00:00 ETA
Connecting to ac.ampcon.local:80 (192.168.0.1:80)  PICOS.bin	100% |*******************************|  167M 0:00:00 ETA
Connecting to ac.ampcon.local:80 (192.168.0.1:80)	
auto-deploy.conf	100% |*******************************| 1437  0:00:00 ETA
Connecting to ac.ampcon.local:80 (192.168.0.1:80)  PICOS_patch.sh	100% |*******************************|	221  0:00:00 ETA
discover: Rescue mode detected. No discover stopped.	
ONIE: Executing installer: PICOS.bin	
Verifying image checksum ... OK.	
Preparing image archive ... OK.	
Installation start. If you use usb disk to install nos, please remember to pull out the usb disk after installation success, and before machine restart. ONIE installation will overwrite the configuration file of existing system.
It is recommended to follow the upgrade procedure to upgrade the system.
Press any key to stop the installation...
10987654321...
machine is : n3024_uboot_gpt
machine type is POWERPC_OR_ARM
checking installer name...
ubi0: detaching mtd6
ubi0: mtd6 is detached
ubi0: attaching mtd6
ubi0: scanning is finished
ubi0: attached mtd6 (name "open", size 946 MiB)
ubi0: PEB size: 524288 bytes (512 KiB), LEB size: 516096 bytes
ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
ubi0: good PEBs: 1888, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 17/11, WL threshold: 4096, image sequence number: 411781434
ubi0: available PEBs: 1848, total reserved PEBs: 40, PEBs reserved for bad PEB handling: 36
ubi0: background thread "ubi_bgt0d" started, PID 1107
Allocate 953745408 bytes to open partition.
UBIFS (ubi0:0): default file-system created
UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1116
UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "open"
UBIFS (ubi0:0): LEB size: 516096 bytes (504 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
UBIFS (ubi0:0): FS size: 948068352 bytes (904 MiB, 1837 LEBs), journal size 33546240 bytes (31 MiB, 65 LEBs)
UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 6A906B5A-0E80-489D-B876-4C66CD8657A8, small LPT model extracting rootfs.tar.gz to /mnt/PICOS, this may need some minutes, please wait. /tmp/tmp.JVbrjS/installer
UBIFS (ubi0:0): un-mount UBI device 0
UBIFS (ubi0:0): background thread "ubifs_bgt0_0" stops
update_uboot_env...
if test -n $onie_boot_reason; then setenv onie_boot_reason; saveenv; exit; else; usb start;setenv bootargs root=/PICOS/PICOS1.sqsh quiet rw console=$consoledev,$baudrate maxcpus=2 mem=$memsize envaddr=$envaddr; ubi part nand0,6 0;ubifsmount open;ubifsload $loadaddr /PICOS/uImage1.itb;bootm $loadaddr#n3024_1G; fi; Setup OS environment ...
loadaddr=0x70000000
fdtaddr=0xc00000
ramdiskaddr=0x3000000
bootcmd=run check_boot_diag;run check_boot_reason;run PICOS_bootcmd;run onie_bootcmd System installs successfully, exit now
If you are using usb disk to install os, please plug out the usb disk in 10 seconds ONIE: NOS install successful: PICOS.bin
ONIE: Rebooting...
ONIE:/ # discover: Rescue mode detected. No discover stopped.
Stopping: dropbear ssh daemon... done.
Stopping: telnetd... done.
Stopping: syslogd... done.
Info: Unmounting kernel filesystems
umount: can't umount /: Invalid argument
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to reboot: Restarting system 

Zero Touch Provisioning (ZTP) of the PICOS Image on the Dell Switch Using AmpCon

If no OS is installed on the switch or you have uninstalled the OS, then you can power up the switch with network cable connected to Out of Band port (eth0). It will automatically enter into Install OS Install discovery mode and PICOS can be installed on switches using AmpCon with Zero Touch Provisioning using DHCP option 60. Please note ONIE only has access to and support for Out-of-Band port eth0. Hence in-band ports can’t be used for ZTP.

For Zero Touch Provisioning of the PICOS image on the Dell switch using AmpCon, we will use DHCP Option 60 (vendor-class-identifier) to pass the image download URL to the switch.
To configure ZTP of the PICOS image on Dell switch using AmpCon, follow these two steps:

  1. Configure DHCP option 60 in the DHCP server to pass the image download URL to the switch.
  2. Power up the switch with OOB management cable attached to the network, to install PICOS image.

Figure1: DHCP option 60 sequence

Configure DHCP Option 60

To configure DHCP option, edit the /etc/dhcp/dhcpd.conf file in the DHCP server as per example configuration given below. 192.168.42.106 is the IP address of the AmpCon server in this example.

# Classes
class "dellemc-n3248pxe" {
  match if substring(option vendor-class-identifier, 0, 44) = "onie_vendor:x86_64-dellemc_n3248pxe_c3338-r0";
  option default-url = "http://192.168.42.106:80/onie";
}

subnet 192.168.42.0 netmask 255.255.255.0 {
  option routers 192.168.42.1;
  option subnet-mask 255.255.255.0;
  #range 192.168.42.10 192.168.42.50;
  pool {
    allow members of "dellemc-n3248pxe";
    range 192.168.42.51 192.168.42.60;
  }
  pool {
    range 192.168.42.10 192.168.42.20;
  }
}
Save the dhcpd.conf file.

Restart the DHCP service. Following example is executed on Ubuntu DHCP server.

sudo systemctl restart isc-dhcp-server.service

Power up the Switch with OOB Management Cable to Install PICOS Image

X86 Platforms

Following is the output of Dell switch with no OS on powerup with network cable attached to OOB management port.

sudo systemctl restart isc-dhcp-server.service
  Booting `ONIE: Install OS'
ONIE: OS Install Mode ...
Platform  : x86_64-dellemc_n2200_n3200_c3338-r0
Version   : 3.45.1.9-4
Build Date: 2019-06-19T19:10-07:00
Info: Mounting kernel filesystems... done.
Info: Mounting ONIE-BOOT on /mnt/onie-boot ...
Info: Mounting EFI System on /boot/efi ...
Info: BIOS mode: UEFI
Info: Making NOS install boot mode persistent.
Info: Using eth0 MAC address: 50:9a:4c:e6:7e:70
Info: eth0:  Checking link... up.
Info: Trying DHCPv4 on interface: eth0
ONIE: Using DHCPv4 addr: eth0: 192.168.42.51 / 255.255.255.0
Starting: klogd... done.
Starting: dropbear ssh daemon... done.
Starting: telnetd... done.
discover: installer mode detected.  Running installer.
Starting: discover... done.
Please press Enter to activate this console. Info: eth0:  Checking link... up.
Info: Trying DHCPv4 on interface: eth0
ONIE: Using DHCPv4 addr: eth0: 192.168.42.51 / 255.255.255.0
ONIE: Starting ONIE Service Discovery
<...>
Info: Attempting file://dev/mmcblk0p1/onie-installer ...
Info: Attempting file://dev/mmcblk0p1/onie-installer.bin ...
Info: Attempting http://192.168.42.106:80/onie ...
ONIE: Executing installer: http://192.168.42.106:80/onie
Connecting to 192.168.42.106:80 (192.168.42.106:80) PICOS.bin             11% |***                            | 23053k  0:00:07 ETA PICOS.bin             69% |*********************          |   134M  0:00:00 ETA PICOS.bin            100% |*******************************|   194M  0:00:00 ETA

Connecting to 192.168.42.106:80 (192.168.42.106:80)
auto-deploy.conf     100% |*******************************|   379   0:00:00 ETA

Connecting to 192.168.42.106:80 (192.168.42.106:80) PICOS_patch.sh       100% |*******************************|   202   0:00:00 ETA

discover: installer mode detected.
Stopping: discover... done.
ONIE: Executing installer: PICOS.bin
Verifying image checksum ... OK.
Preparing image archive ... OK.
ONIE installation will overwrite the configuration file of existing system.
It is recommended to follow the upgrade procedure to upgrade the system.
Press any key to stop the installation...
stty: standard input: Inappropriate ioctl for device
stty: standard input: Inappropriate ioctl for device
stty: standard input: Inappropriate ioctl for device
10 9 8 7 6 5 4 3 2 1 ...
stty: standard input: Inappropriate ioctl for device
stty: standard input: Inappropriate ioctl for device
Found the storage device: /dev/sda
Format /dev/sda4
Install image to /dev/sda4, please wait...
/root/PICOS_patch.sh found!
Install GRUB on /dev/sda3
Image(PICOS-3.6.2) successfully installed.
ONIE: NOS install successful: PICOS.bin
ONIE: Rebooting...
<...>
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system reboot
reboot: Restarting system
BIOS Boot Selector for N3200
Version 3.45.0.9-2
POST Configuration
<..>
                             GNU GRUB  version 2.02

 +----------------------------------------------------------------------------+
 |*PICOS-3.6.2                                                                |
 | ONIE                                                                       |
+----------------------------------------------------------------------------+
<...>
  Booting `PICOS-3.6.2'

Loading, please wait...
[    2.720836] systemd-fsck[362]: User-Data: 11/201600 files (0.0% non-contiguous), 30245/804913 blocks
[   14.699483] PICOS-pre.sh[543]: Auto Provisioning Tool - checking updates ....
[   14.881160] PICOS-pre.sh[543]: No tftp server address found, exit now
[   14.893504] PICOS_monitor[757]: Starting monitor
[   16.181924] system-diag[756]: ************ System Diagnosis Start ************
<...>
[   16.585166] system-diag[756]: ************  System Diagnosis End  ************
[   73.110249] PICOS.sh[755]: .
2020-06-12 18:08:42,001 Auto-deploy WARNING : Auto-deploy Agent Start

Debian GNU/Linux 8 Xorplus ttyS0

Xorplus login: 2020-06-12 18:08:52,085 Auto-deploy WARNING : Sync time with ntp server.
2020-06-12 18:08:52,002 Auto-deploy WARNING : Got platform name N3248PXE-ON
2020-06-12 18:08:52,031 Auto-deploy WARNING : Got serial num TW0WYGRVDNT0097I0015
2020-06-12 18:08:52,040 Auto-deploy WARNING : Got hardware id 3A92-DA18-A8DD-E644
2020-06-12 18:08:52,043 Auto-deploy WARNING : Agent Initialized
2020-06-12 18:08:52,044 Auto-deploy WARNING : This switch is not deployed, agent will start to connect server
2020-06-12 18:08:52,045 Auto-deploy WARNING : Loading default config in switch
2020-06-12 18:08:53,379 Auto-deploy WARNING : Try to use out-of-band network
2020-06-12 18:08:53,380 Auto-deploy WARNING : Getting MGMT IP address
2020-06-12 18:08:53,386 Auto-deploy WARNING : Got MGMT IP address 192.168.42.33
2020-06-12 18:08:53,390 Auto-deploy WARNING : Got MGMT local gateway 192.168.42.1
<...>
search pica8.pica8.com
nameserver 8.8.8.8
nameserver 192.168.42.71
2020-06-12 18:09:14,175 Auto-deploy WARNING : Registering in server
2020-06-12 18:09:15,211 Auto-deploy WARNING : Sending request url https://10.8.0.1:443/reg/TW0WYGRVDNT0097I0015;10.8.0.10;N3248PXE-ON;3A92-DA18-A8DD-E644;0;2
2020-06-12 18:09:15,393 Auto-deploy WARNING : Received reply message: "registered"
2020-06-12 18:09:15,394 Auto-deploy WARNING : Agent has already connected to server
2020-06-12 18:09:15,394 Auto-deploy WARNING : Agent will wait 120s
2020-06-12 18:09:51,532 Auto-deploy WARNING : Auto-deploy Agent Stop
2020-06-12 18:09:53,634 Auto-deploy WARNING : Auto-deploy Agent Start
2020-06-12 18:10:04,572 Auto-deploy WARNING : Sync time with ntp server pool.ntp.org.
2020-06-12 18:10:04,705 Auto-deploy WARNING : Got platform name N3248PXE-ON
2020-06-12 18:10:04,706 Auto-deploy WARNING : Got serial num TW0WYGRVDNT0097I0015
2020-06-12 18:10:04,714 Auto-deploy WARNING : Got hardware id 3A92-DA18-A8DD-E644
2020-06-12 18:10:04,714 Auto-deploy WARNING : Got Service Tag: 67QFXC2
2020-06-12 18:10:04,716 Auto-deploy WARNING : Agent Initialized
2020-06-12 18:10:04,717 Auto-deploy WARNING : Clean deploy flag
<...>
2020-06-12 11:16:39,749 Auto-deploy WARNING : This switch has been already deployed, agent will quit

ARM Platforms

1.  Power on the switch and interrupt the boot sequence by pressing any key when the following line is shown:

2.  Input command run onie_bootcmd, which will automatically install PICOS on the switch.

Deployment Use Case Where Only In-band Port is Supported in Production

For this use case follow steps mentioned in the above section  Installing PICOS on Bare Metal Switches using AmpCon. Use eth0 port initially to get the image deployed. Running configuration will not have any CLIs for out-of-band port configuration.  ONIE boot loader will use DHCP server to get an IP for the out-of-band port. Please make sure the IP given by DHCP server does not conflict with in-band IP address range.

dhcpd.conf example: 

# Here we are assigning addresses 192.168.42.10 to 192.168.42.50 for eth0.
# Goal is to limit DHCP server to assign IP in lower network range 192.168.42.0/24 and
# higher address range IPs will be reserved  for assigning static IP for  In-band.
subnet 192.168.42.0 netmask 255.255.255.0 {
    option routers 192.168.42.1;
    option subnet-mask 255.255.255.0;
    pool {
    range 192.168.42.10 192.168.42.50;
    }
}

Global Configuration file and Template in AmpCon will generate a static IP for the in-band port (uplink port #49).  Please note static IP assigned for the in-band does not overlap with the IP address assigned by the DHCP server. Following configuration is an example.

set vlans vlan-id 10 vlan-name "Vlan10"
set l3-interface vlan-interface Vlan10 address 192.168.42.170 prefix-length 24
set interface gigabit-ethernet ge-1/1/49 family ethernet-switching native-vlan-id 10
set interface gigabit-ethernet ge-1/1/49 family ethernet-switching port-mode "trunk"

Once the switch is successfully deployed by AmpCon using out-of-band port, remove the network cable from eth0 and connect it to in-band port (in this example to port 49) and power cycle the switch. After the switch reboots, it will only use in-band and not out-of-band.

Copyright © 2024 Pica8 Inc. All Rights Reserved.