blob: 2edeecb572c589dbe2d7ac53d80a3e563271dd17 [file] [log] [blame]
Charles Chandd26eeb2019-08-29 17:59:21 -07001.. |onos_version| replace:: 1.12.2
2
Zack Williams553a3632019-08-09 17:14:43 -07003Installation
4************
5
Charles Chandd26eeb2019-08-29 17:59:21 -07006Topology
7========
8Trellis supports various topology, from a single switch to a full multi-stage leaf-spine fabric.
Zack Williams553a3632019-08-09 17:14:43 -07009
Charles Chandd26eeb2019-08-29 17:59:21 -070010- **Single switch**: This is the minimum Trellis setup. In this setup, all servers are connected to a single switch.
11- **Paired switches**: Compared to single switch, it provides more redundancy in terms of server NIC failure and link failure.
12- **Single-stage leaf-spine**: Compared to single switch, it offers more redundancy in terms of switch failure and provides better scalability.
13- **Single-stage leaf-spine with paired switches**: It supports all the redundancy and scalability features mentioned above.
14- **Multi-stage leaf-spine**: Multi-stage is specifically designed for telco service providers.
15 The first stage can be installed in the central office, while the second stage can be installed in a field office that is closer to the subscribers.
16 Two stages are typically connected via long distance optical transport.
Zack Williams553a3632019-08-09 17:14:43 -070017
Zack Williams553a3632019-08-09 17:14:43 -070018
19Trellis in a Box (TiaB)
20=======================
Charles Chandd26eeb2019-08-29 17:59:21 -070021Trellis in a Box (TiaB) is a software emulated environment that allows people to run Trellis without hardware switches.
22It is the most convenient and **recommended option for beginners who would like to quickly get some hands on experience** of Trellis.
23It is also useful for developers who would like to easily verify their code in early development stages.
24
25TiaB is currently hosted in a GitHub repository separated from ONOS.
26The source code and user guide of TiaB can be found `here <https://github.com/opennetworkinglab/routing/tree/master/trellis>`_.
27
28
29Hardware Requirements
30=====================
31Following is a list of hardware that people from the ONF community have tested over time in lab trials.
32
33Switches
34--------
35
361G/10G models (with 40G uplinks)
37^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 - OCP Accepted™ EdgeCore AS5712-54X
39 - OCP Accepted™ EdgeCore AS5812-54X
40 - QCT QuantaMesh T3048-LY8
41 - Delta AG7648
42 - Inventec D6254 (verified by Inventec)
43
4425G models (with 100G uplinks)
45^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 - QuantaMesh BMS T7032-IX1/IX1B (with 25G breakout cable)
47 - Inventec D7054Q28B (verified by Inventec)
48
4940G models
50^^^^^^^^^^
51 - OCP Accepted™ EdgeCore AS6712-32X
52
53100G models
54^^^^^^^^^^^
55 - OCP Accepted™ EdgeCore AS7712-32X
56 - QCT QuantaMesh BMS T7032-IX1/IX1B
57 - OCP Accepted™ Inventec D7032Q28B (verified by Inventec)
58
59Commercially supported models
60^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61Models listed here are not supported by ONF community. You should contact switch vendor for commercial support.
62 - OCP Accepted™ EdgeCore AS5912-54X
63
64
65Servers
66-------
67ONOS can be run on any x86 servers, with the following notes on memory and CPU allocation:
68
69 - Memory
70 The memory requirement highly depends on the deployment scale.
71 In general, we suggest that each ONOS instance should get **at least 16G RAM**.
72 For production deployment at scale, we will definitely need not only more memory but also some fine tuning on JVM garbage collection mechanism.
73 - CPU
74 There are not much requirement on CPU.
75 In practice, we avoid running other CPU intensive processes/containers/VMs on the same physical machine where ONOS runs.
76
77
78Install Controller - ONOS
79=========================
80You could run Trellis with a `single instance of ONOS <https://wiki.onosproject.org/display/ONOS/Local+workflow>`_. But it is recommended to run ONOS as a cluster.
81
82The idea is to have a "build machine", where you host and build ONOS source code. But to launch it in operation you use other "target machines" (VMs, containers or servers).
83Typically we use `STC <https://wiki.onosproject.org/pages/viewpage.action?pageId=12421025>`_ to launch ONOS ins 3 target machines which form a ONOS cluster.
84
85
86Download ONOS |onos_version|
87---------------------------------
88Trellis currently is released as part of ONOS and therefore it follows ONOS version number.
89This document is written based on ONOS |onos_version|.
90
91You can find more information about how to setup build environment and fetch ONOS source code from `Development Environment Setup <https://wiki.onosproject.org/display/ONOS/Development+Environment+Setup>`_.
92
93
94Prepare Your Target Machine
95---------------------------
96Please refer to `target machines requirements <https://wiki.onosproject.org/display/ONOS/Cells+and+ONOS+test+scripts#CellsandONOStestscripts-Targetmachinesrequirements>`_ for details (you only have to do this once).
97
98You do not need to follow the directions for the "Mininet Target Machine" if you are using hardware switches.
99
100
101Create a Cell File
102--------------------
103We need to compose a cell file in order to give the information about target machines to the build machine. Please refer to `test cells <https://wiki.onosproject.org/display/ONOS/Cells+and+ONOS+test+scripts#CellsandONOStestscripts-TestCells>`_ for details. For example:
104
105.. code-block:: bash
106
107 export ONOS_CELL=menlo
108 export OC1=10.128.0.216
109 export OC2=10.128.0.217
110 export OC3=10.128.0.218
111 export ONOS_APPS=drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,hostprobingprovider,t3
112 export ONOS_USER=admin
113 export ONOS_GROUP=admin
114 export ONOS_USE_SSH=true
115 export ONOS_WEB_USER=onos
116 export ONOS_WEB_PASS=rocks
117
118- ``OC1, OC2, OC3`` are the IP addresses of the 3 target machines where the ONOS cluster will be deployed.
119- ``ONOS_APPS`` are the apps you want to automatically deploy at launch.
120
121 - ``drivers`` includes drivers for various devices and pipelines. Always required.
122 - ``gui`` enables graphic user interface. Highly recommended.
123 - ``openflow`` is a meta app that loads ``openflow-base``, ``lldpprovider`` and ``hostprovider``. Always required.
124 - ``segmentrouting`` controls forwarding in the fabric. Always required.
125 - ``fpm`` (Forwarding Plane Manager) exchanges forwarding information with Quagga. Required if connecting to external router.
126 - ``dhcprelay`` relays DHCP packets between clients and servers. Required if using DHCP to configure IP addresses for hosts
127 - ``routeradvertisement`` periodically sends IPv6 router advertisement packets on configured interfaces. Required if using IPv6
128 - ``hostprobingprovider`` probes and verifies locations of dual-homed hosts. Required if using dual-homing feature with paired switches
129 - ``t3`` (Trellis Troubleshooting Tool) is very useful for debugging. Highly recommended.
130
131- ``ONOS_USER`` is used to login to the target machines,
132 and the password is not required as you have setup the target machines for password-less access over ssh.
133
134Once that's done, you can use the ``cell`` command to load the cell file.
135
136.. code-block:: console
137
138 $ source onos/tools/dev/bash_profile
139 $ cell menlo
140
141
142Check Your Target Environment
143-----------------------------
144Check if your environment is OK with ``stc prerequisites`` (you only have to do this once).
145
146.. code-block:: console
147
148 $ stc prerequisites
149 2017-02-07 12:10:23 Prerequisites started
150 2017-02-07 12:10:23 Check-Passwordless-Login-1 started -- ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no admin@10.128.0.216 date
151 2017-02-07 12:10:23 Check-ONOS-Bits started -- onos-check-bits
152 2017-02-07 12:10:23 Check-Passwordless-Login-3 started -- ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no admin@10.128.0.218 date
153 2017-02-07 12:10:23 Check-Passwordless-Login-2 started -- ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no admin@10.128.0.217 date
154 2017-02-07 12:10:23 Check-Environment started -- test -n /Users/sauravdas/onos -a -n 10.128.0.* -a -n 10.128.0.216
155 2017-02-07 12:10:23 Check-Environment completed
156 2017-02-07 12:10:23 Check-Passwordless-Login-1 completed
157 2017-02-07 12:10:23 Check-Passwordless-Login-2 completed
158 2017-02-07 12:10:23 Check-Passwordless-Login-3 completed
159 2017-02-07 12:10:25 Check-ONOS-Bits completed
160 2017-02-07 12:10:25 Prerequisites completed
161 0:01 Passed! 6 steps succeeded
162
163
164Launch STC Command
165------------------
166Finally launch with ``stc setup`` once you have built ONOS. Here is what it looks like when I launch
167
168.. code-block:: console
169
170 $ stc setup
171 2016-12-23 12:26:44 Setup started
172 2016-12-23 12:26:44 Uninstall-3 started -- onos-uninstall 10.128.0.218
173 2016-12-23 12:26:44 Uninstall-2 started -- onos-uninstall 10.128.0.217
174 2016-12-23 12:26:44 Uninstall-1 started -- onos-uninstall 10.128.0.216
175 2016-12-23 12:26:44 Push-Bits-2 started -- onos-push-bits 10.128.0.217
176 2016-12-23 12:26:44 Push-Bits-3 started -- onos-push-bits 10.128.0.218
177 2016-12-23 12:26:44 Push-Bits-1 started -- onos-push-bits 10.128.0.216
178 2016-12-23 12:26:45 Push-Bits-1 completed
179 2016-12-23 12:26:46 Push-Bits-2 completed
180 2016-12-23 12:26:46 Push-Bits-3 completed
181 2016-12-23 12:26:46 Uninstall-3 completed
182 2016-12-23 12:26:46 Kill-3 started -- onos-kill 10.128.0.218
183 2016-12-23 12:26:46 Uninstall-2 completed
184 2016-12-23 12:26:46 Kill-2 started -- onos-kill 10.128.0.217
185 2016-12-23 12:26:46 Uninstall-1 completed
186 2016-12-23 12:26:46 Kill-1 started -- onos-kill 10.128.0.216
187 2016-12-23 12:26:46 Kill-3 completed
188 2016-12-23 12:26:46 Install-3 started -- onos-install 10.128.0.218
189 2016-12-23 12:26:46 Kill-1 completed
190 2016-12-23 12:26:46 Install-1 started -- onos-install 10.128.0.216
191 2016-12-23 12:26:46 Kill-2 completed
192 2016-12-23 12:26:46 Install-2 started -- onos-install 10.128.0.217
193 2016-12-23 12:26:52 Install-2 completed
194 2016-12-23 12:26:52 Secure-SSH-2 started -- onos-secure-ssh -u onos -p rocks 10.128.0.217
195 2016-12-23 12:26:52 Install-1 completed
196 2016-12-23 12:26:52 Secure-SSH-1 started -- onos-secure-ssh -u onos -p rocks 10.128.0.216
197 2016-12-23 12:26:52 Install-3 completed
198 2016-12-23 12:26:52 Secure-SSH-3 started -- onos-secure-ssh -u onos -p rocks 10.128.0.218
199 2016-12-23 12:27:07 Secure-SSH-1 completed
200 2016-12-23 12:27:07 Wait-for-Start-1 started -- onos-wait-for-start 10.128.0.216
201 2016-12-23 12:27:09 Secure-SSH-3 completed
202 2016-12-23 12:27:09 Wait-for-Start-3 started -- onos-wait-for-start 10.128.0.218
203 2016-12-23 12:27:13 Secure-SSH-2 completed
204 2016-12-23 12:27:13 Wait-for-Start-2 started -- onos-wait-for-start 10.128.0.217
205 2016-12-23 12:27:14 Wait-for-Start-1 completed
206 2016-12-23 12:27:14 Check-Components-1 started -- onos-check-components 10.128.0.216
207 2016-12-23 12:27:14 Check-Nodes-1 started -- onos-check-nodes 10.128.0.216
208 2016-12-23 12:27:14 Wait-for-Start-3 completed
209 2016-12-23 12:27:14 Check-Nodes-3 started -- onos-check-nodes 10.128.0.218
210 2016-12-23 12:27:14 Check-Components-3 started -- onos-check-components 10.128.0.218
211 2016-12-23 12:27:16 Wait-for-Start-2 completed
212 2016-12-23 12:27:16 Check-Nodes-2 started -- onos-check-nodes 10.128.0.217
213 2016-12-23 12:27:16 Check-Components-2 started -- onos-check-components 10.128.0.217
214 2016-12-23 12:27:18 Check-Nodes-1 completed
215 2016-12-23 12:27:18 Check-Nodes-3 completed
216 2016-12-23 12:27:19 Check-Nodes-2 completed
217 2016-12-23 12:27:20 Check-Components-1 completed
218 2016-12-23 12:27:20 Check-Apps-1 started -- onos-check-apps 10.128.0.216 drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,t3,hostprobingprovider includes
219 2016-12-23 12:27:20 Check-Logs-1 started -- onos-check-logs 10.128.0.216
220 2016-12-23 12:27:20 Check-Components-3 completed
221 2016-12-23 12:27:20 Check-Apps-3 started -- onos-check-apps 10.128.0.218 drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,t3,hostprobingprovider includes
222 2016-12-23 12:27:20 Check-Logs-3 started -- onos-check-logs 10.128.0.218
223 2016-12-23 12:27:20 Check-Apps-1 completed
224 2016-12-23 12:27:20 Check-Apps-3 completed
225 2016-12-23 12:27:20 Check-Logs-1 completed
226 2016-12-23 12:27:20 Check-Logs-3 completed
227 2016-12-23 12:27:21 Check-Components-2 completed
228 2016-12-23 12:27:21 Check-Logs-2 started -- onos-check-logs 10.128.0.217
229 2016-12-23 12:27:21 Check-Apps-2 started -- onos-check-apps 10.128.0.217 drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,t3,hostprobingprovider includes
230 2016-12-23 12:27:21 Check-Apps-2 completed
231 2016-12-23 12:27:21 Check-Logs-2 completed
232 2016-12-23 12:27:21 Setup completed
233 0:36 Passed! 31 steps succeeded
234
235
236Useful Utilities
237----------------
238- Push network configuration to one particular instance of ONOS (all instances will automatically get the same configuration)
239
240 .. code-block:: console
241
242 $ onos-netcfg $OC1 network-cfg.json
243
244- Remotely log in to CLI of one particular ONOS instance
245
246 .. code-block:: console
247
248 $ onos $OC1
249
250- Remotely access the log of one particular ONOS instance
251
252 .. code-block:: console
253
254 $ onos-log $OC1
255
256
257Install Switch OS - ONL
258=======================
259The switches listed in the `Hardware Requirements`_ section are shipped with Open Networking Install Environment (ONIE) boot loader.
260After booting up, we should see the ONIE prompt from console.
261Here we assume that the management port on the switch already has Internet access. (via DHCP)
262
263
264Enter ONIE
265----------
266
267
268Has no ONL or Has ONL 1.x previously installed
269^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270The way to install ONL 2.x is the same as ONL 1.x.
271However, if you have no ONL installed or have older version of ONL, you might find it tricky to (re)install a newer version.
272Here's the instruction:
273
274 1. Plug in the console cable and reboot the switch
275 2. (If your boot loader is grub) When you see the boot menu, select **ONIE -> ONIE: Rescue**
276 3. (If your boot loader is uboot) When you see **Hit any key to stop autoboot** instead of the boot menu,
277 press any key and then enter ``run onie_rescue`` to enter ONIE rescue mode.
278
279Has ONL 2.x previously installed
280^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
281It would be much more easier to reboot into ONIE if you have a previously installed ONL 2. Simply run:
282
283
284.. code-block:: console
285
286 # onl-onie-boot-mode rescue
287 # reboot
288
289Available ONIE modes are: *install, rescue, uninstall, update, embed, diag, none*.
290This can be helpful when you are in a normal ONL and want to upgrade your system.
291
292
293Install ONL
294-----------
295At the ONIE prompt, we need to download and install ONL. To fetch and install the latest compatible ONL, run:
296
297.. code-block:: console
298
299 ONIE:/ # wget https://github.com/opencord/OpenNetworkLinux/releases/download/2017-10-19.2200-1211610/ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER
300 ONIE:/ # sh ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER
301
302**Checksum**: *sha256:2db316ea83f5dc761b9b11cc8542f153f092f3b49d82ffc0a36a2c41290f5421*
303
304The switch will automatically reboot into ONL after installation. Default login credential of ONL is: ``root/onl``
305
306We might want to configure a fixed IP address for the management interface.
307First edit ``/etc/network/interfaces`` and configure ``ma1``, which is the management interface.
308
309.. code-block:: text
310
311 auto ma1
312 iface ma1 inet static
313 address 10.128.10.128
314 netmask 255.255.0.0
315 gateway 10.128.0.1
316 dns-nameservers 192.168.1.1 8.8.8.8
317
318
319Install Switch Agent - OF-DPA
320=============================
321
322
323Community vs. Premium Version
324-----------------------------
325The OF-DPA image we distribute for free with Trellis is a community version.
326This documentation is also written based on the community version.
327The community version has most of the features available and therefore it is good for small scale deployments such as lab trials.
328However, we highly recommend you to get the premium version from Broadcom if you are aiming for production deployments at scale.
329
330
331Install OF-DPA
332--------------
333We need to use different OF-DPA images depending on the switch model you are using.
334Please find the installer URL corresponding to each switch model in the `Vendor Specific Information`_ section.
335
336Copy the image to the switch and start the installation process by running:
337
338.. code-block:: console
339
340 $ scp ${OFDPA_DEB} ${SWITCH_IP}:/root
341 $ dpkg -i --force-overwrite /root/${OFDPA_DEB}
342
343For example, assuming the OF-DPA image is ``ofdpa_3.0.5.5+accton1.7-1_amd64.deb`` and the switch management IP is ``10.128.0.201``, you should run:
344
345.. code-block:: console
346
347 $ scp ofdpa_3.0.5.5+accton1.7-1_amd64.deb 10.128.0.201:/root
348 $ dpkg -i --force-overwrite /root/ofdpa_3.0.5.5+accton1.7-1_amd64.deb
349
350
351Connect Switch to Controller
352============================
353
354
355Start OF-DPA and OpenFlow Agent
356-------------------------------
357The OFDPA software and the Indigo agent are now a single process launched by Linux service. First of all, we need to configure **/etc/ofagent/ofagent.conf**.
358Uncomment and edit the following line. Make sure all other lines stay commented.
359
360.. code-block:: bash
361
362 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
363
364We can choose to run OF-DPA in **debug mode**
365
366.. code-block:: bash
367
368 OPT_ARGS="-d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
369
370- To start the ofagent, run ``service ofagentd start``
371- To stop the agent, run ``service ofagentd stop``
372- More ``ofagentapp`` options can be found by running ``ofagentapp --help``
373
374
375Start OF-DPA and OpenFlow Agent with listen option
376--------------------------------------------------
377An optional ``-l`` parameter can be added for switch to listen on specific **IP:port**.
378This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and control the switch.
379
380.. code-block:: bash
381
382 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>"
383
384To connect to the switch using **ovs-ofctl**, you can use commands such as
385
386.. code-block:: console
387
388 $ ovs-ofctl -O OpenFlow13 show tcp:<ip>:<port>
389 $ ovs-ofctl -O OpenFlow13 dump-flows tcp:<ip>:<port>
390 $ ovs-ofctl -O OpenFlow13 dump-groups tcp:<ip>:<port>
391 $ ovs-ofctl -O OpenFlow13 add-flow tcp:<ip>:<port> table=60,priority=40000,eth_type=0x0800,ip_dst=55.55.55.55,actions=controller
392
393For more command, please see ``ovs-ofctl --help`` or the post `OpenvSwitch ovs-ofctl and OF-DPA <https://blog.pichuang.com.tw/20170106-ovs-ofctl-and-ofdpa/>`_.
394
395
396Vendor Specific Information
397===========================
398
399
400Edgecore
401--------
402
403- OF-DPA Image
404 - `EdgeCore 5712-54X / 5812-54X / 6712-32X / 7712-32X <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa_3.0.5.5%2Baccton1.7-1_amd64.deb>`_ - **Checksum**: *sha256:db228b6e79fb15f77497b59689235606b60abc157e72fc3356071bcc8dc4c01f*
405
406- Configure Port Speed and Breakout
407 - By default all the switch ports are running at maximum speed. The port speed can be modified in **/etc/accton/ofdpa.conf**
408
409 .. code-block:: text
410
411 port_speed_1=1000 # configure front port 1 to run at 1G
412
413 - We can also configure the same file to use break out cables on certain ports.
414
415 .. code-block:: text
416
417 port_mode_1=4x10g # configure front port 1 to break out from 40G to 4x10G
418
419 OF-DPA service needs to be restarted after modifying this configuration.
420
421
422QCT
423---
424
425- OF-DPA Image
426 - `QuantaMesh T3048-LY8 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ag7648_0.3.0.5.6_amd64.deb>`_ - **Checksum**: *sha256:f8201530b1452145c1a0956ea1d3c0402c3568d090553d0d7b3c91a79137da9e*
427 - `QuantaMesh T7032-IX1 / IX1B <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ix1_0.3.0.5.0-EA5-qct-01.00_amd64.deb>`_ **Checksum**: *sha256:278b8ffed8a8fc705a1b60d16f8e70377e78342a27a11568a1d80b1efd706a46*
428
429
430Delta
431-----
432
433- OF-DPA Image
434 - `Delta AG7648 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ly8_0.3.0.5.0-EA5-qct-01.01_amd64.deb>`_ - **Checksum**: *sha256:ddfc13cb98ca47291dce5e6938b1d65f0b99bbe77f0585e36ac0007017397f23*
435
436- Special instructions to install ONL
437 Make sure ``/etc/machine.conf`` looks like the following in ONIE before running ONL installation script:
438
439 .. code-block:: text
440
441 onie_platform=x86_64-delta_<platform name>-r0
442 onie_machine=delta_<platform name>
443
444 After the installation of ONL, if you don't see '/usr/bin' in your PATH variable, please run the following command:
445
446 .. code-block:: console
447
448 # export PATH=$PATH:/usr/bin
449
450- Special instructions to use optical SFP cables
451 If optical SFP cables are not coming up, please use the following command to launch OF-DPA:
452
453 .. code-block:: console
454
455 # ./launcher ofagentapp -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>
456
457Useful Information
458==================
459
460
461OF-DPA Commands
462---------------
463There are some useful OF-DPA commands under ``/usr/bin/``
464
465.. code-block:: text
466
467 client_cfg_purge
468 client_debugcomp
469 client_drivshell
470 client_flowtable_dump
471 client_meter_dump
472 client_port_table_dump
473 client_tunnel_dump
474 client_classcolortable_dump
475 client_debuglvl
476 client_event
477 client_grouptable_dump
478 client_oam_dump
479 client_queue_config
480
481
482ONL Boot Mode
483-------------
484OFDPA offers two boot mode: **INSTALLED** and **SWI**.
485
486- In **INSTALLED** mode, ONL mounts the root filesystem from /dev/sdb7 which is a flash drive that persists everything even during a power cycle.
487- In **SWI** mode, ONL will load the root filesystem from a read-only image (\*.swi) and put the modified files in an copy-on-write overlay filesystem.
488 The change will not be persisted during a power cycle.
489 The pros and cons are obvious. INSTALLED mode is more convenient while SWI mode is more error-safe.
490
491The boot mode will be determined by which image we used install ONL. We use the **INSTALLED** mode in this instruction for simplicity.
492But we can still change it after the installation. Here's the instruction:
493
494.. code-block:: console
495
496 # mount /mnt/onl/boot -o remount,rw
497 # sed -i 's/BOOTMODE=INSTALLED/BOOTMODE=SWI/g' /mnt/onl/boot/boot-config
498 # reboot
499
500
501Persistence Mechanism
502---------------------
503INSTALLED mode already persists everything for you. This section is mainly for SWI mode.
504
505The mechanism to persist files on the switch is different from ONL 1.x to ONL 2.x.
506Following are the steps required to persist a file (e.g. OFDPA package) in ONL 2.x.
507
508- Files put in **/mnt/onl/data** will be persisted automatically.
509- To install a deb package during start-up, put the deb file under **/mnt/onl/data/install-debs** folder and
510 create a plain text file **/mnt/onl/data/install-debs/list** with all the filename of the deb (e.g. ofdpa_3.0.5.5+accton1.7-1_amd64.deb)
511- To execute some command during start-up, put the command in **/mnt/onl/data/rc.boot**
512
513 .. code-block:: bash
514
515 # set static ip and route (dhcp by default)
516 echo 'ip addr add 10.128.0.203/16 dev ma1' >> /mnt/onl/data/rc.boot
517 echo 'ip route add default via 10.128.0.1' >> /mnt/onl/data/rc.boot
518 # grant executable permission
519 chmod a+x /mnt/onl/data/rc.boot
520
521See `PersistWorkflow.md <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/PersistWorkflow.md>`_ for more detail.
522
523
524Build a Customized ONL Image
525----------------------------
526Sometimes we need to build our own ONL image from source to include some extra files. (The most common case is a modified /etc/network/interfaces).
527The instruction of build process has already been well-documented in ONL repo `Building.md <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/Building.md>`_.
528But you might find it a little bit tricky to inject some extra files.
529To do that, you need to put the files under **$ONL_ROOT/builds/any/rootfs/jessie/common/overlay/** and then run the make command again.
530
531
532Recovery from a Faulty ONL Install
533----------------------------------
534If, for some reason, the ONL install process fails, you may be brought to the grub rescue prompt upon reboot.
535You may or may not find system files, or even basic grub rescue commands (i.e. 'help').
536There are two options for returning to a (known working) ONIE prompt.
537
5381. **Reinstaller** - You should be able to acquire an ISO image for resetting the firmware to factory default from your switch vendor.
539 Once you have the ISO, you can either use PXE or a live USB to boot the switch into the image.
5402. **Manually boot to ONIE** - If the files are there, you can manually configure GRUB to load the necessary modules to boot back into ONIE.
541
542 .. code-block:: console
543
544 # This should be the partition on the ONIE partition on the AS6712.
545 # It might be hd1 or hd0. Change appropriately.
546 grub rescue> ls (hd0,gpt2)/
547 ./ ../ lost+found/ onie/ grub/ grubenv
548
549 # These instructions will load the kernel and ONIE initrd.
550 grub rescue> set prefix=(hd0,gpt2)/grub
551 grub rescue> set root=(hd0,gpt2)
552 grub rescue> insmod normal
553 grub rescue> insmod linux
554 grub rescue> ls /onie
555 ./ ../ vmlinuz-3.2.35-onie initrd.img-3.2.35-onie tools/ grub/ grub.d/ config/
556
557 # if the ",115200n8" is omitted, baud rate defaults to 9600.
558 grub rescue> linux /onie/vmlinuz-3.2.35-onie console=tty0 console=ttyS1,115200n8
559 grub rescue> initrd /onie/initrd.img-3.2.35-onie
560
561 # The system will not boot into ONIE and you can recover or re-install from there.
562 grub rescue> boot
563
564Once back at the ONIE prompt, you can try to install ONL by following the same steps again.
565
566
567Reference
568---------
569- `ONL/OF-DPA installation guide by Edgecore Networks <https://www.youtube.com/watch?v=mCUtkIc_hVI>`_
570- `ONL/OF-DPA cheat sheet by Phil Huang <https://blog.pichuang.com.tw/20170104-ofdpa-with-onl-cheat-sheet/>`_