Auto-Provisioning NOS on a Bare Metal Switch
Using DHCP to install Cumulus Linux on the bare metal switch
In this post we will go over a simple installation of NOS on a bare metal switch using DHCP, and without touching the CLI or any interaction with the switch.
We have :
1- A Edge-Core (Accton AS5712) bare metal switch.
2- A Linux DHCP Server
3- A Windows Web Server
Our scenario
How it works
After bare metal switch powered on, it starts its bootloader to load the ONIE. (Open Networking Install Environment). If ONIE detects that there is no NOS currently installed on the switch it starts the NOS installer process.
The switch starts the ONIE install environment, and enables DHCP on its management interface. (you cannot assign a static IP). switch looks for a DHCP option (default-url , Option 114) which shows the location of the NOS image file.
switch will start downloading the file, using http or ftp protocols, and completes the installation.
Steps
Step 1 : Prepare the DHCP Server
We use a basic ISC DHCP server on a CentOS.
The highlighted line is the DHCP Option which tells the switch where to look for NOS
DHCP Server
[root@CentOS-7 dhcp]# cat dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 192.168.1.0 netmask 255.255.255.0 {
option default-url "http://10.1.1.1/NOS/CumulusLinux/CumulusLinux-2.5.7-amd64.bin";
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-search "domain.local";
option domain-name-servers 192.168.211.3,4.2.2.4,8.8.8.8;
option time-offset -18000; # Eastern Standard Time
range 192.168.1.101 192.168.1.250;
}
Step 2 : Prepare the File Server (WEB/ FTP)
We used a windows IIS server as our file server. there is not special configuration required, you need to point the IIS to the folder where your NOS install files resides.
Only thing you need to consider is that Windows IIS is very specific about the file extensions. to serve the .bin files you need to create a MIME Type
Download the installer files from Cumulus networks Website.
Step 3 : Installation
In this step , you just need to connect the Management interface of the switch to the same Layer 2 network where the DHCP server resides.
Serial Logs
Info: Mounting kernel filesystems... done.
scsi 6:0:0:0: Direct-Access ATP ATP IG eUSB 1100 PQ: 0 ANSI: 6
sd 6:0:0:0: [sda] 15720448 512-byte logical blocks: (8.04 GB/7.49 GiB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 6:0:0:0: [sda] Attached SCSI disk
Info: Mounting LABEL=ONIE-BOOT on /mnt/onie-boot ...
Info: Using eth0 MAC address: cc:37:ab:3c:d2:48
Info: eth0: Checking link... up.
Info: Trying DHCPv4 on interface: eth0
ONIE: Using DHCPv4 addr: eth0: 192.168.1.102 / 255.255.255.0
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.1.102 / 255.255.255.0
ONIE: Starting ONIE Service Discovery
EXT3-fs (sda3): error: couldn't mount because of unsupported optional features (240)
EXT2-fs (sda3): error: couldn't mount because of unsupported optional features (240)
Info: Fetching http://192.168.1.101/NOS/CumulusLinux/CumulusLinux-2.5.7-amd64.bin ...
ONIE: Executing installer: http://10.1.1.101/NOS/CumulusLinux/CumulusLinux-2.5.7-amd64.bin
Verifying image checksum ... OK.
Preparing image archive ... OK.
Dumping image info...
Control File Contents
=====================
Description: Cumulus Linux
OS-Release: 2.5.7-753304d-201603071654-build
Architecture: amd64
Date: Mon, 07 Mar 2016 18:45:27 -0800
Installer-Version: 1.2
Homepage: http://www.cumulusnetworks.com/
Data Archive Contents
=====================
-rw-r--r-- build/Development 101 2016-03-08 02:45:26 file.list
-rw-r--r-- build/Development 44 2016-03-08 02:45:26 file.list.sha1
-rw-r--r-- build/Development 149070569 2016-03-08 02:45:26 sysroot-release.tar.gz
-rw-r--r-- build/Development 44 2016-03-08 02:45:27 sysroot-release.tar.gz.sha1
-rw-r--r-- build/Development 8161112 2016-03-08 02:45:26 vmlinuz-initrd.tar.xz
-rw-r--r-- build/Development 44 2016-03-08 02:45:27 vmlinuz-initrd.tar.xz.sha1
Creating CLBOOT partition on /dev/sda3... done.
Creating CUMULUS partition on /dev/sda4... done.
Creating logical volume PERSIST on volume group CUMULUS... done.
Validating sha1 for vmlinuz-initrd.tar.xz... done.
Validating sha1 for sysroot-release.tar.gz... done.
Installing OS-Release 2.5.7-753304d-201603071654-build into image slot 1 ...
Info: Copying sysroot into slot 1
Creating logical volume SYSROOT1 on volume group CUMULUS... done.
done.
Verifying sysroot copy... OK.
Copying kernel into CLBOOT partition... done.
Verifying kernel copy... OK.
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Installation finished. No error reported.
Generating grub.cfg ...
Found Cumulus Linux image: /boot/cl-vmlinuz-3.2.68-6-slot-1
done
Installing OS-Release 2.5.7-753304d-201603071654-build into image slot 2 ...
Info: Copying sysroot into slot 2
Creating logical volume SYSROOT2 on volume group CUMULUS... done.
done.
Verifying sysroot copy... OK.
Copying kernel into CLBOOT partition... done.
Verifying kernel copy... OK.
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Generating grub.cfg ...
Found Cumulus Linux image: /boot/cl-vmlinuz-3.2.68-6-slot-1
Found Cumulus Linux image: /boot/cl-vmlinuz-3.2.68-6-slot-2
done
Success: Support tarball created: /tmp/tmp.6isGiM/onie/onie-support.tar.bz2
Success: System provisioning complete. Rebooting...
umount: can't umount /tmp.pS3zaP: Invalid argument
umount: can't remount rootfs read-only
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system reboot
Restarting system.
Cumulus Boots Up and Ready
As we expected without doing any configuration on the switch, it provisioned with NOS. Cumulus Linux boots up.
login as cumulus / CumulusLinux!