blob: 2bfe5ceea46e76df1f697266eb18fbe5f66df8f1 [file] [log] [blame]
Charles Chandd26eeb2019-08-29 17:59:21 -07001.. |onos_version| replace:: 1.12.2
2
Charles Chan78a737f2019-09-12 13:55:22 -07003Installation Guide
4******************
Zack Williams553a3632019-08-09 17:14:43 -07005
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 Chan6025e9a2019-09-07 19:25:43 -070021TiaB is a software emulated environment that allows people to run Trellis without hardware switches.
22TiaB comes with a few Mininet scripts that emulate network topology from a simple 2x2 leaf-spine to a full multi-stage fabric.
23The configurations corresponding to each topology are also packaged together such that you can start the environment right away.
Charles Chandd26eeb2019-08-29 17:59:21 -070024
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
Charles Chan6025e9a2019-09-07 19:25:43 -070028.. tip::
29 TiaB is the most convenient and **recommended option for beginners who would like to quickly get some hands on experience** of Trellis.
30
Charles Chandd26eeb2019-08-29 17:59:21 -070031
Charles Chan4d5ee192019-09-09 23:08:36 -070032Building a Hardware Pod
33=======================
34See :doc:`Supported Hardware <supported-hardware>` for details.
Charles Chandd26eeb2019-08-29 17:59:21 -070035
36
37Install Controller - ONOS
38=========================
39You 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.
40
41The 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).
42Typically we use `STC <https://wiki.onosproject.org/pages/viewpage.action?pageId=12421025>`_ to launch ONOS ins 3 target machines which form a ONOS cluster.
43
44
45Download ONOS |onos_version|
46---------------------------------
47Trellis currently is released as part of ONOS and therefore it follows ONOS version number.
48This document is written based on ONOS |onos_version|.
49
50You 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>`_.
51
52
53Prepare Your Target Machine
54---------------------------
55Please 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).
56
57You do not need to follow the directions for the "Mininet Target Machine" if you are using hardware switches.
58
59
60Create a Cell File
61--------------------
62We 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:
63
64.. code-block:: bash
65
66 export ONOS_CELL=menlo
67 export OC1=10.128.0.216
68 export OC2=10.128.0.217
69 export OC3=10.128.0.218
70 export ONOS_APPS=drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,hostprobingprovider,t3
71 export ONOS_USER=admin
72 export ONOS_GROUP=admin
73 export ONOS_USE_SSH=true
74 export ONOS_WEB_USER=onos
75 export ONOS_WEB_PASS=rocks
76
77- ``OC1, OC2, OC3`` are the IP addresses of the 3 target machines where the ONOS cluster will be deployed.
78- ``ONOS_APPS`` are the apps you want to automatically deploy at launch.
79
80 - ``drivers`` includes drivers for various devices and pipelines. Always required.
81 - ``gui`` enables graphic user interface. Highly recommended.
82 - ``openflow`` is a meta app that loads ``openflow-base``, ``lldpprovider`` and ``hostprovider``. Always required.
83 - ``segmentrouting`` controls forwarding in the fabric. Always required.
84 - ``fpm`` (Forwarding Plane Manager) exchanges forwarding information with Quagga. Required if connecting to external router.
85 - ``dhcprelay`` relays DHCP packets between clients and servers. Required if using DHCP to configure IP addresses for hosts
86 - ``routeradvertisement`` periodically sends IPv6 router advertisement packets on configured interfaces. Required if using IPv6
87 - ``hostprobingprovider`` probes and verifies locations of dual-homed hosts. Required if using dual-homing feature with paired switches
88 - ``t3`` (Trellis Troubleshooting Tool) is very useful for debugging. Highly recommended.
89
90- ``ONOS_USER`` is used to login to the target machines,
91 and the password is not required as you have setup the target machines for password-less access over ssh.
92
93Once that's done, you can use the ``cell`` command to load the cell file.
94
95.. code-block:: console
96
97 $ source onos/tools/dev/bash_profile
98 $ cell menlo
99
100
101Check Your Target Environment
102-----------------------------
103Check if your environment is OK with ``stc prerequisites`` (you only have to do this once).
104
105.. code-block:: console
106
107 $ stc prerequisites
108 2017-02-07 12:10:23 Prerequisites started
109 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
110 2017-02-07 12:10:23 Check-ONOS-Bits started -- onos-check-bits
111 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
112 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
113 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
114 2017-02-07 12:10:23 Check-Environment completed
115 2017-02-07 12:10:23 Check-Passwordless-Login-1 completed
116 2017-02-07 12:10:23 Check-Passwordless-Login-2 completed
117 2017-02-07 12:10:23 Check-Passwordless-Login-3 completed
118 2017-02-07 12:10:25 Check-ONOS-Bits completed
119 2017-02-07 12:10:25 Prerequisites completed
120 0:01 Passed! 6 steps succeeded
121
122
123Launch STC Command
124------------------
125Finally launch with ``stc setup`` once you have built ONOS. Here is what it looks like when I launch
126
127.. code-block:: console
128
129 $ stc setup
130 2016-12-23 12:26:44 Setup started
131 2016-12-23 12:26:44 Uninstall-3 started -- onos-uninstall 10.128.0.218
132 2016-12-23 12:26:44 Uninstall-2 started -- onos-uninstall 10.128.0.217
133 2016-12-23 12:26:44 Uninstall-1 started -- onos-uninstall 10.128.0.216
134 2016-12-23 12:26:44 Push-Bits-2 started -- onos-push-bits 10.128.0.217
135 2016-12-23 12:26:44 Push-Bits-3 started -- onos-push-bits 10.128.0.218
136 2016-12-23 12:26:44 Push-Bits-1 started -- onos-push-bits 10.128.0.216
137 2016-12-23 12:26:45 Push-Bits-1 completed
138 2016-12-23 12:26:46 Push-Bits-2 completed
139 2016-12-23 12:26:46 Push-Bits-3 completed
140 2016-12-23 12:26:46 Uninstall-3 completed
141 2016-12-23 12:26:46 Kill-3 started -- onos-kill 10.128.0.218
142 2016-12-23 12:26:46 Uninstall-2 completed
143 2016-12-23 12:26:46 Kill-2 started -- onos-kill 10.128.0.217
144 2016-12-23 12:26:46 Uninstall-1 completed
145 2016-12-23 12:26:46 Kill-1 started -- onos-kill 10.128.0.216
146 2016-12-23 12:26:46 Kill-3 completed
147 2016-12-23 12:26:46 Install-3 started -- onos-install 10.128.0.218
148 2016-12-23 12:26:46 Kill-1 completed
149 2016-12-23 12:26:46 Install-1 started -- onos-install 10.128.0.216
150 2016-12-23 12:26:46 Kill-2 completed
151 2016-12-23 12:26:46 Install-2 started -- onos-install 10.128.0.217
152 2016-12-23 12:26:52 Install-2 completed
153 2016-12-23 12:26:52 Secure-SSH-2 started -- onos-secure-ssh -u onos -p rocks 10.128.0.217
154 2016-12-23 12:26:52 Install-1 completed
155 2016-12-23 12:26:52 Secure-SSH-1 started -- onos-secure-ssh -u onos -p rocks 10.128.0.216
156 2016-12-23 12:26:52 Install-3 completed
157 2016-12-23 12:26:52 Secure-SSH-3 started -- onos-secure-ssh -u onos -p rocks 10.128.0.218
158 2016-12-23 12:27:07 Secure-SSH-1 completed
159 2016-12-23 12:27:07 Wait-for-Start-1 started -- onos-wait-for-start 10.128.0.216
160 2016-12-23 12:27:09 Secure-SSH-3 completed
161 2016-12-23 12:27:09 Wait-for-Start-3 started -- onos-wait-for-start 10.128.0.218
162 2016-12-23 12:27:13 Secure-SSH-2 completed
163 2016-12-23 12:27:13 Wait-for-Start-2 started -- onos-wait-for-start 10.128.0.217
164 2016-12-23 12:27:14 Wait-for-Start-1 completed
165 2016-12-23 12:27:14 Check-Components-1 started -- onos-check-components 10.128.0.216
166 2016-12-23 12:27:14 Check-Nodes-1 started -- onos-check-nodes 10.128.0.216
167 2016-12-23 12:27:14 Wait-for-Start-3 completed
168 2016-12-23 12:27:14 Check-Nodes-3 started -- onos-check-nodes 10.128.0.218
169 2016-12-23 12:27:14 Check-Components-3 started -- onos-check-components 10.128.0.218
170 2016-12-23 12:27:16 Wait-for-Start-2 completed
171 2016-12-23 12:27:16 Check-Nodes-2 started -- onos-check-nodes 10.128.0.217
172 2016-12-23 12:27:16 Check-Components-2 started -- onos-check-components 10.128.0.217
173 2016-12-23 12:27:18 Check-Nodes-1 completed
174 2016-12-23 12:27:18 Check-Nodes-3 completed
175 2016-12-23 12:27:19 Check-Nodes-2 completed
176 2016-12-23 12:27:20 Check-Components-1 completed
177 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
178 2016-12-23 12:27:20 Check-Logs-1 started -- onos-check-logs 10.128.0.216
179 2016-12-23 12:27:20 Check-Components-3 completed
180 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
181 2016-12-23 12:27:20 Check-Logs-3 started -- onos-check-logs 10.128.0.218
182 2016-12-23 12:27:20 Check-Apps-1 completed
183 2016-12-23 12:27:20 Check-Apps-3 completed
184 2016-12-23 12:27:20 Check-Logs-1 completed
185 2016-12-23 12:27:20 Check-Logs-3 completed
186 2016-12-23 12:27:21 Check-Components-2 completed
187 2016-12-23 12:27:21 Check-Logs-2 started -- onos-check-logs 10.128.0.217
188 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
189 2016-12-23 12:27:21 Check-Apps-2 completed
190 2016-12-23 12:27:21 Check-Logs-2 completed
191 2016-12-23 12:27:21 Setup completed
192 0:36 Passed! 31 steps succeeded
193
194
195Useful Utilities
196----------------
197- Push network configuration to one particular instance of ONOS (all instances will automatically get the same configuration)
198
199 .. code-block:: console
200
201 $ onos-netcfg $OC1 network-cfg.json
202
203- Remotely log in to CLI of one particular ONOS instance
204
205 .. code-block:: console
206
207 $ onos $OC1
208
209- Remotely access the log of one particular ONOS instance
210
211 .. code-block:: console
212
213 $ onos-log $OC1
214
215
216Install Switch OS - ONL
217=======================
Charles Chan4d5ee192019-09-09 23:08:36 -0700218The switches listed in the :doc:`Supported Hardware <supported-hardware>` are shipped with Open Networking Install Environment (ONIE) boot loader.
Charles Chandd26eeb2019-08-29 17:59:21 -0700219After booting up, we should see the ONIE prompt from console.
220Here we assume that the management port on the switch already has Internet access. (via DHCP)
221
222
223Enter ONIE
224----------
225
226
227Has no ONL or Has ONL 1.x previously installed
228^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
229The way to install ONL 2.x is the same as ONL 1.x.
230However, if you have no ONL installed or have older version of ONL, you might find it tricky to (re)install a newer version.
231Here's the instruction:
232
233 1. Plug in the console cable and reboot the switch
234 2. (If your boot loader is grub) When you see the boot menu, select **ONIE -> ONIE: Rescue**
235 3. (If your boot loader is uboot) When you see **Hit any key to stop autoboot** instead of the boot menu,
236 press any key and then enter ``run onie_rescue`` to enter ONIE rescue mode.
237
238Has ONL 2.x previously installed
239^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
240It would be much more easier to reboot into ONIE if you have a previously installed ONL 2. Simply run:
241
242
243.. code-block:: console
244
245 # onl-onie-boot-mode rescue
246 # reboot
247
248Available ONIE modes are: *install, rescue, uninstall, update, embed, diag, none*.
249This can be helpful when you are in a normal ONL and want to upgrade your system.
250
251
252Install ONL
253-----------
254At the ONIE prompt, we need to download and install ONL. To fetch and install the latest compatible ONL, run:
255
256.. code-block:: console
257
258 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
259 ONIE:/ # sh ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER
260
261**Checksum**: *sha256:2db316ea83f5dc761b9b11cc8542f153f092f3b49d82ffc0a36a2c41290f5421*
262
263The switch will automatically reboot into ONL after installation. Default login credential of ONL is: ``root/onl``
264
265We might want to configure a fixed IP address for the management interface.
266First edit ``/etc/network/interfaces`` and configure ``ma1``, which is the management interface.
267
268.. code-block:: text
269
270 auto ma1
271 iface ma1 inet static
272 address 10.128.10.128
273 netmask 255.255.0.0
274 gateway 10.128.0.1
275 dns-nameservers 192.168.1.1 8.8.8.8
276
277
278Install Switch Agent - OF-DPA
279=============================
280
Charles Chan64adc382019-09-09 18:15:02 -0700281.. note::
282 **Community vs. Premium Version**
Charles Chandd26eeb2019-08-29 17:59:21 -0700283
Charles Chan64adc382019-09-09 18:15:02 -0700284 The OF-DPA image we distribute for free with Trellis is a community version.
285 This documentation is also written based on the community version.
286 The **community version** has most of the features available and therefore it is **good for small scale deployments** such as lab trials.
287 However, we highly recommend you to get the **premium version** from Broadcom if you are aiming for **production deployments at scale**.
Charles Chandd26eeb2019-08-29 17:59:21 -0700288
289
290Install OF-DPA
291--------------
292We need to use different OF-DPA images depending on the switch model you are using.
293Please find the installer URL corresponding to each switch model in the `Vendor Specific Information`_ section.
294
295Copy the image to the switch and start the installation process by running:
296
297.. code-block:: console
298
299 $ scp ${OFDPA_DEB} ${SWITCH_IP}:/root
300 $ dpkg -i --force-overwrite /root/${OFDPA_DEB}
301
302For 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:
303
304.. code-block:: console
305
306 $ scp ofdpa_3.0.5.5+accton1.7-1_amd64.deb 10.128.0.201:/root
307 $ dpkg -i --force-overwrite /root/ofdpa_3.0.5.5+accton1.7-1_amd64.deb
308
309
310Connect Switch to Controller
311============================
312
Charles Chan19833d82019-09-07 20:49:14 -0700313.. caution::
314 We are going to describe two different ways to start OF-DPA and OpenFlow agent in this section.
315 Some vendors use ``ofagentd`` service while others use old ``launcher`` app to start the agent.
316 Please check the `Vendor Specific Information`_ to understand which method you should use before continuing this section.
Charles Chandd26eeb2019-08-29 17:59:21 -0700317
Charles Chan19833d82019-09-07 20:49:14 -0700318Use ofagentd service
319--------------------
320
321Launch with ofagentd
322^^^^^^^^^^^^^^^^^^^^
Charles Chandd26eeb2019-08-29 17:59:21 -0700323The 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**.
324Uncomment and edit the following line. Make sure all other lines stay commented.
325
326.. code-block:: bash
327
328 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
329
330We can choose to run OF-DPA in **debug mode**
331
332.. code-block:: bash
333
334 OPT_ARGS="-d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
335
Charles Chan19833d82019-09-07 20:49:14 -0700336- To **start** the ofagent, run ``service ofagentd start``
337- To **stop** the agent, run ``service ofagentd stop``
Charles Chandd26eeb2019-08-29 17:59:21 -0700338- More ``ofagentapp`` options can be found by running ``ofagentapp --help``
339
340
Charles Chan19833d82019-09-07 20:49:14 -0700341Launch in listen mode with ofagentd
342^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Charles Chandd26eeb2019-08-29 17:59:21 -0700343An optional ``-l`` parameter can be added for switch to listen on specific **IP:port**.
344This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and control the switch.
345
346.. code-block:: bash
347
348 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>"
349
Charles Chan19833d82019-09-07 20:49:14 -0700350Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to access switches in listen mode.
351
352Use launcher app
353----------------
354
355Launch with launcher
356^^^^^^^^^^^^^^^^^^^^
357- To **start** OF-DPA and OpenFlow agent, run:
358
359 .. code-block:: console
360
361 # ./launcher ofagentapp -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>
362
363- We can choose to run OF-DPA in **debug mode**
364
365 .. code-block:: console
366
367 # ./launcher ofagentapp -d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>
368
369- To **stop** OF-DPA and OpenFlow agent, run:
370
371 .. code-block:: consol
372
373 # killall ofagentapp
374
375Launch in listen mode with launcher
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.
Charles Chandd26eeb2019-08-29 17:59:21 -0700379
380.. code-block:: console
381
Charles Chan19833d82019-09-07 20:49:14 -0700382 # ./launcher ofagentapp <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>
Charles Chandd26eeb2019-08-29 17:59:21 -0700383
Charles Chan19833d82019-09-07 20:49:14 -0700384Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to access switches in listen mode.
Charles Chandd26eeb2019-08-29 17:59:21 -0700385
386
387Vendor Specific Information
388===========================
389
390
391Edgecore
392--------
393
Charles Chan19833d82019-09-07 20:49:14 -0700394- **OF-DPA Image**
Charles Chandd26eeb2019-08-29 17:59:21 -0700395 - `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*
396
Charles Chan19833d82019-09-07 20:49:14 -0700397- **Start OF-DPA and OpenFlow agent**
398 - Please refer to `Use ofagentd service`_
399
400- **Configure Port Speed and Breakout**
Charles Chandd26eeb2019-08-29 17:59:21 -0700401 - By default all the switch ports are running at maximum speed. The port speed can be modified in **/etc/accton/ofdpa.conf**
402
403 .. code-block:: text
404
405 port_speed_1=1000 # configure front port 1 to run at 1G
406
407 - We can also configure the same file to use break out cables on certain ports.
408
409 .. code-block:: text
410
411 port_mode_1=4x10g # configure front port 1 to break out from 40G to 4x10G
412
413 OF-DPA service needs to be restarted after modifying this configuration.
414
415
416QCT
417---
418
419- OF-DPA Image
420 - `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*
421 - `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*
422
Charles Chan19833d82019-09-07 20:49:14 -0700423- **Start OF-DPA and OpenFlow agent**
424 - Please refer to `Use launcher app`_
425
426- Configure Port Speed and Breakout
427 The command ``client_drivshell`` can be used to configure the port speed.
428 Use the parameter ``ps`` to list all ports or ``ps <port number>`` to list one specific port.
429
430 .. code-block:: console
431
432 # client_drivshell ps 1
433 Calling ofdpaBcmCommand rpc with command = "ps 1 ".
434 ena/ speed/ link auto STP lrn inter max loop
435 port link duplex scan neg? state pause discrd ops face frame back
436 xe0( 1) down 10G FD SW No Forward Untag F SFI 9412
437
438 Returned from ofdpaBcmCommand rpc with rc = 0.
439
440 Then use the parameter ``port <port number> sp=<port speed>`` to change the port speed.
441
442 .. code-block:: console
443
444 # client_drivshell port xe0 sp=1000
445 Calling ofdpaBcmCommand rpc with command = "port xe0 sp=1000 ".
446
447 Returned from ofdpaBcmCommand rpc with rc = 0.
448
449 # client_drivshell ps 1
450 Calling ofdpaBcmCommand rpc with command = "ps 1 ".
451 ena/ speed/ link auto STP lrn inter max loop
452 port link duplex scan neg? state pause discrd ops face frame back
453 xe0( 1) down 1G FD SW No Forward Untag F GMII 9412
454
455 Returned from ofdpaBcmCommand rpc with rc = 0.
Charles Chandd26eeb2019-08-29 17:59:21 -0700456
457Delta
458-----
459
460- OF-DPA Image
461 - `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*
462
Charles Chan19833d82019-09-07 20:49:14 -0700463- **Start OF-DPA and OpenFlow agent**
464 - Please refer to `Use launcher app`_
465
Charles Chandd26eeb2019-08-29 17:59:21 -0700466- Special instructions to install ONL
467 Make sure ``/etc/machine.conf`` looks like the following in ONIE before running ONL installation script:
468
469 .. code-block:: text
470
471 onie_platform=x86_64-delta_<platform name>-r0
472 onie_machine=delta_<platform name>
473
474 After the installation of ONL, if you don't see '/usr/bin' in your PATH variable, please run the following command:
475
476 .. code-block:: console
477
478 # export PATH=$PATH:/usr/bin
479
Charles Chandd26eeb2019-08-29 17:59:21 -0700480
481Useful Information
482==================
483
Charles Chandd26eeb2019-08-29 17:59:21 -0700484OF-DPA Commands
485---------------
486There are some useful OF-DPA commands under ``/usr/bin/``
487
488.. code-block:: text
489
490 client_cfg_purge
491 client_debugcomp
492 client_drivshell
493 client_flowtable_dump
494 client_meter_dump
495 client_port_table_dump
496 client_tunnel_dump
497 client_classcolortable_dump
498 client_debuglvl
499 client_event
500 client_grouptable_dump
501 client_oam_dump
502 client_queue_config
503
504
505ONL Boot Mode
506-------------
507OFDPA offers two boot mode: **INSTALLED** and **SWI**.
508
509- In **INSTALLED** mode, ONL mounts the root filesystem from /dev/sdb7 which is a flash drive that persists everything even during a power cycle.
510- 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.
511 The change will not be persisted during a power cycle.
512 The pros and cons are obvious. INSTALLED mode is more convenient while SWI mode is more error-safe.
513
514The boot mode will be determined by which image we used install ONL. We use the **INSTALLED** mode in this instruction for simplicity.
515But we can still change it after the installation. Here's the instruction:
516
517.. code-block:: console
518
519 # mount /mnt/onl/boot -o remount,rw
520 # sed -i 's/BOOTMODE=INSTALLED/BOOTMODE=SWI/g' /mnt/onl/boot/boot-config
521 # reboot
522
523
524Persistence Mechanism
525---------------------
526INSTALLED mode already persists everything for you. This section is mainly for SWI mode.
527
528The mechanism to persist files on the switch is different from ONL 1.x to ONL 2.x.
529Following are the steps required to persist a file (e.g. OFDPA package) in ONL 2.x.
530
531- Files put in **/mnt/onl/data** will be persisted automatically.
532- To install a deb package during start-up, put the deb file under **/mnt/onl/data/install-debs** folder and
533 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)
534- To execute some command during start-up, put the command in **/mnt/onl/data/rc.boot**
535
536 .. code-block:: bash
537
538 # set static ip and route (dhcp by default)
539 echo 'ip addr add 10.128.0.203/16 dev ma1' >> /mnt/onl/data/rc.boot
540 echo 'ip route add default via 10.128.0.1' >> /mnt/onl/data/rc.boot
541 # grant executable permission
542 chmod a+x /mnt/onl/data/rc.boot
543
544See `PersistWorkflow.md <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/PersistWorkflow.md>`_ for more detail.
545
546
547Build a Customized ONL Image
548----------------------------
549Sometimes 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).
550The instruction of build process has already been well-documented in ONL repo `Building.md <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/Building.md>`_.
551But you might find it a little bit tricky to inject some extra files.
552To do that, you need to put the files under **$ONL_ROOT/builds/any/rootfs/jessie/common/overlay/** and then run the make command again.
553
554
555Recovery from a Faulty ONL Install
556----------------------------------
557If, for some reason, the ONL install process fails, you may be brought to the grub rescue prompt upon reboot.
558You may or may not find system files, or even basic grub rescue commands (i.e. 'help').
559There are two options for returning to a (known working) ONIE prompt.
560
5611. **Reinstaller** - You should be able to acquire an ISO image for resetting the firmware to factory default from your switch vendor.
562 Once you have the ISO, you can either use PXE or a live USB to boot the switch into the image.
5632. **Manually boot to ONIE** - If the files are there, you can manually configure GRUB to load the necessary modules to boot back into ONIE.
564
565 .. code-block:: console
566
567 # This should be the partition on the ONIE partition on the AS6712.
568 # It might be hd1 or hd0. Change appropriately.
569 grub rescue> ls (hd0,gpt2)/
570 ./ ../ lost+found/ onie/ grub/ grubenv
571
572 # These instructions will load the kernel and ONIE initrd.
573 grub rescue> set prefix=(hd0,gpt2)/grub
574 grub rescue> set root=(hd0,gpt2)
575 grub rescue> insmod normal
576 grub rescue> insmod linux
577 grub rescue> ls /onie
578 ./ ../ vmlinuz-3.2.35-onie initrd.img-3.2.35-onie tools/ grub/ grub.d/ config/
579
580 # if the ",115200n8" is omitted, baud rate defaults to 9600.
581 grub rescue> linux /onie/vmlinuz-3.2.35-onie console=tty0 console=ttyS1,115200n8
582 grub rescue> initrd /onie/initrd.img-3.2.35-onie
583
584 # The system will not boot into ONIE and you can recover or re-install from there.
585 grub rescue> boot
586
587Once back at the ONIE prompt, you can try to install ONL by following the same steps again.
588
589
Charles Chan19833d82019-09-07 20:49:14 -0700590Connect to Switch in Listen Mode
591--------------------------------
592To connect to the switch in Listen Mode using **ovs-ofctl**, you can use commands such as
593
594.. code-block:: console
595
596 $ ovs-ofctl -O OpenFlow13 show tcp:<ip>:<port>
597 $ ovs-ofctl -O OpenFlow13 dump-flows tcp:<ip>:<port>
598 $ ovs-ofctl -O OpenFlow13 dump-groups tcp:<ip>:<port>
599 $ ovs-ofctl -O OpenFlow13 add-flow tcp:<ip>:<port> table=60,priority=40000,eth_type=0x0800,ip_dst=55.55.55.55,actions=controller
600
601For 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/>`_.
602
603
Charles Chandd26eeb2019-08-29 17:59:21 -0700604Reference
605---------
606- `ONL/OF-DPA installation guide by Edgecore Networks <https://www.youtube.com/watch?v=mCUtkIc_hVI>`_
607- `ONL/OF-DPA cheat sheet by Phil Huang <https://blog.pichuang.com.tw/20170104-ofdpa-with-onl-cheat-sheet/>`_