blob: f96483d013ba26d6b088958a698866ba57a746ec [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 Chan4d5ee192019-09-09 23:08:36 -07006Building a Hardware Pod
7=======================
8See :doc:`Supported Hardware <supported-hardware>` for details.
Charles Chandd26eeb2019-08-29 17:59:21 -07009
10
11Install Controller - ONOS
12=========================
Charles Chandd26eeb2019-08-29 17:59:21 -070013
Zack Williams40dfc972020-06-23 14:12:46 -070014You could run Trellis with a `single instance of ONOS
15<https://wiki.onosproject.org/display/ONOS/Local+workflow>`_. But it is
16recommended to run ONOS as a cluster.
17
18The idea is to have a "build machine", where you host and build ONOS source
19code. But to launch it in operation you use other "target machines" (VMs,
20containers or servers).
21
22Typically we use `STC
23<https://wiki.onosproject.org/pages/viewpage.action?pageId=12421025>`_ to
24launch ONOS ins 3 target machines which form a ONOS cluster.
Charles Chandd26eeb2019-08-29 17:59:21 -070025
26
27Download ONOS |onos_version|
28---------------------------------
Charles Chandd26eeb2019-08-29 17:59:21 -070029
Zack Williams40dfc972020-06-23 14:12:46 -070030Trellis currently is released as part of ONOS and therefore it follows ONOS
31version number. This document is written based on ONOS |onos_version|.
32
33You can find more information about how to setup build environment and fetch
34ONOS source code from `Development Environment Setup
35<https://wiki.onosproject.org/display/ONOS/Development+Environment+Setup>`_.
Charles Chandd26eeb2019-08-29 17:59:21 -070036
37
38Prepare Your Target Machine
39---------------------------
Charles Chandd26eeb2019-08-29 17:59:21 -070040
Zack Williams40dfc972020-06-23 14:12:46 -070041Please refer to `target machines requirements
42<https://wiki.onosproject.org/x/twAQ>`_ for details (you only have to do this
43once).
44
45You do not need to follow the directions for the "Mininet Target Machine" if
46you are using hardware switches.
Charles Chandd26eeb2019-08-29 17:59:21 -070047
48
49Create a Cell File
50--------------------
Zack Williams40dfc972020-06-23 14:12:46 -070051
52We need to compose a cell file in order to give the information about target
53machines to the build machine. Please refer to `test cells
54<https://wiki.onosproject.org/x/twAQ>`_ for details. For example:
Charles Chandd26eeb2019-08-29 17:59:21 -070055
56.. code-block:: bash
57
58 export ONOS_CELL=menlo
59 export OC1=10.128.0.216
60 export OC2=10.128.0.217
61 export OC3=10.128.0.218
62 export ONOS_APPS=drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,hostprobingprovider,t3
63 export ONOS_USER=admin
64 export ONOS_GROUP=admin
65 export ONOS_USE_SSH=true
66 export ONOS_WEB_USER=onos
67 export ONOS_WEB_PASS=rocks
68
Zack Williams40dfc972020-06-23 14:12:46 -070069- ``OC1, OC2, OC3`` are the IP addresses of the 3 target machines where the
70 ONOS cluster will be deployed.
71
Charles Chandd26eeb2019-08-29 17:59:21 -070072- ``ONOS_APPS`` are the apps you want to automatically deploy at launch.
73
Zack Williams40dfc972020-06-23 14:12:46 -070074 - ``drivers`` includes drivers for various devices and pipelines. Always
75 required.
Charles Chandd26eeb2019-08-29 17:59:21 -070076
Zack Williams40dfc972020-06-23 14:12:46 -070077 - ``gui`` enables graphic user interface. Highly recommended.
78
79 - ``openflow`` is a meta app that loads ``openflow-base``, ``lldpprovider``
80 and ``hostprovider``. Always required.
81
82 - ``segmentrouting`` controls forwarding in the fabric. Always required.
83
84 - ``fpm`` (Forwarding Plane Manager) exchanges forwarding information with
85 Quagga. Required if connecting to external router.
86
87 - ``dhcprelay`` relays DHCP packets between clients and servers. Required
88 if using DHCP to configure IP addresses for hosts
89
90 - ``routeradvertisement`` periodically sends IPv6 router advertisement
91 packets on configured interfaces. Required if using IPv6
92
93 - ``hostprobingprovider`` probes and verifies locations of dual-homed
94 hosts. Required if using dual-homing feature with paired switches
95
96 - ``t3`` (Trellis Troubleshooting Tool) is very useful for debugging.
97 Highly recommended.
98
99- ``ONOS_USER`` is used to login to the target machines, and the password is
100 not required as you have setup the target machines for password-less access
101 over ssh.
Charles Chandd26eeb2019-08-29 17:59:21 -0700102
103Once that's done, you can use the ``cell`` command to load the cell file.
104
105.. code-block:: console
106
107 $ source onos/tools/dev/bash_profile
108 $ cell menlo
109
110
111Check Your Target Environment
112-----------------------------
Zack Williams40dfc972020-06-23 14:12:46 -0700113
Charles Chandd26eeb2019-08-29 17:59:21 -0700114Check if your environment is OK with ``stc prerequisites`` (you only have to do this once).
115
116.. code-block:: console
117
118 $ stc prerequisites
119 2017-02-07 12:10:23 Prerequisites started
120 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
121 2017-02-07 12:10:23 Check-ONOS-Bits started -- onos-check-bits
122 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
123 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
124 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
125 2017-02-07 12:10:23 Check-Environment completed
126 2017-02-07 12:10:23 Check-Passwordless-Login-1 completed
127 2017-02-07 12:10:23 Check-Passwordless-Login-2 completed
128 2017-02-07 12:10:23 Check-Passwordless-Login-3 completed
129 2017-02-07 12:10:25 Check-ONOS-Bits completed
130 2017-02-07 12:10:25 Prerequisites completed
131 0:01 Passed! 6 steps succeeded
132
133
134Launch STC Command
135------------------
136Finally launch with ``stc setup`` once you have built ONOS. Here is what it looks like when I launch
137
138.. code-block:: console
139
140 $ stc setup
141 2016-12-23 12:26:44 Setup started
142 2016-12-23 12:26:44 Uninstall-3 started -- onos-uninstall 10.128.0.218
143 2016-12-23 12:26:44 Uninstall-2 started -- onos-uninstall 10.128.0.217
144 2016-12-23 12:26:44 Uninstall-1 started -- onos-uninstall 10.128.0.216
145 2016-12-23 12:26:44 Push-Bits-2 started -- onos-push-bits 10.128.0.217
146 2016-12-23 12:26:44 Push-Bits-3 started -- onos-push-bits 10.128.0.218
147 2016-12-23 12:26:44 Push-Bits-1 started -- onos-push-bits 10.128.0.216
148 2016-12-23 12:26:45 Push-Bits-1 completed
149 2016-12-23 12:26:46 Push-Bits-2 completed
150 2016-12-23 12:26:46 Push-Bits-3 completed
151 2016-12-23 12:26:46 Uninstall-3 completed
152 2016-12-23 12:26:46 Kill-3 started -- onos-kill 10.128.0.218
153 2016-12-23 12:26:46 Uninstall-2 completed
154 2016-12-23 12:26:46 Kill-2 started -- onos-kill 10.128.0.217
155 2016-12-23 12:26:46 Uninstall-1 completed
156 2016-12-23 12:26:46 Kill-1 started -- onos-kill 10.128.0.216
157 2016-12-23 12:26:46 Kill-3 completed
158 2016-12-23 12:26:46 Install-3 started -- onos-install 10.128.0.218
159 2016-12-23 12:26:46 Kill-1 completed
160 2016-12-23 12:26:46 Install-1 started -- onos-install 10.128.0.216
161 2016-12-23 12:26:46 Kill-2 completed
162 2016-12-23 12:26:46 Install-2 started -- onos-install 10.128.0.217
163 2016-12-23 12:26:52 Install-2 completed
164 2016-12-23 12:26:52 Secure-SSH-2 started -- onos-secure-ssh -u onos -p rocks 10.128.0.217
165 2016-12-23 12:26:52 Install-1 completed
166 2016-12-23 12:26:52 Secure-SSH-1 started -- onos-secure-ssh -u onos -p rocks 10.128.0.216
167 2016-12-23 12:26:52 Install-3 completed
168 2016-12-23 12:26:52 Secure-SSH-3 started -- onos-secure-ssh -u onos -p rocks 10.128.0.218
169 2016-12-23 12:27:07 Secure-SSH-1 completed
170 2016-12-23 12:27:07 Wait-for-Start-1 started -- onos-wait-for-start 10.128.0.216
171 2016-12-23 12:27:09 Secure-SSH-3 completed
172 2016-12-23 12:27:09 Wait-for-Start-3 started -- onos-wait-for-start 10.128.0.218
173 2016-12-23 12:27:13 Secure-SSH-2 completed
174 2016-12-23 12:27:13 Wait-for-Start-2 started -- onos-wait-for-start 10.128.0.217
175 2016-12-23 12:27:14 Wait-for-Start-1 completed
176 2016-12-23 12:27:14 Check-Components-1 started -- onos-check-components 10.128.0.216
177 2016-12-23 12:27:14 Check-Nodes-1 started -- onos-check-nodes 10.128.0.216
178 2016-12-23 12:27:14 Wait-for-Start-3 completed
179 2016-12-23 12:27:14 Check-Nodes-3 started -- onos-check-nodes 10.128.0.218
180 2016-12-23 12:27:14 Check-Components-3 started -- onos-check-components 10.128.0.218
181 2016-12-23 12:27:16 Wait-for-Start-2 completed
182 2016-12-23 12:27:16 Check-Nodes-2 started -- onos-check-nodes 10.128.0.217
183 2016-12-23 12:27:16 Check-Components-2 started -- onos-check-components 10.128.0.217
184 2016-12-23 12:27:18 Check-Nodes-1 completed
185 2016-12-23 12:27:18 Check-Nodes-3 completed
186 2016-12-23 12:27:19 Check-Nodes-2 completed
187 2016-12-23 12:27:20 Check-Components-1 completed
188 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
189 2016-12-23 12:27:20 Check-Logs-1 started -- onos-check-logs 10.128.0.216
190 2016-12-23 12:27:20 Check-Components-3 completed
191 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
192 2016-12-23 12:27:20 Check-Logs-3 started -- onos-check-logs 10.128.0.218
193 2016-12-23 12:27:20 Check-Apps-1 completed
194 2016-12-23 12:27:20 Check-Apps-3 completed
195 2016-12-23 12:27:20 Check-Logs-1 completed
196 2016-12-23 12:27:20 Check-Logs-3 completed
197 2016-12-23 12:27:21 Check-Components-2 completed
198 2016-12-23 12:27:21 Check-Logs-2 started -- onos-check-logs 10.128.0.217
199 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
200 2016-12-23 12:27:21 Check-Apps-2 completed
201 2016-12-23 12:27:21 Check-Logs-2 completed
202 2016-12-23 12:27:21 Setup completed
203 0:36 Passed! 31 steps succeeded
204
205
206Useful Utilities
207----------------
Zack Williams40dfc972020-06-23 14:12:46 -0700208
209- Push network configuration to one particular instance of ONOS (all instances
210 will automatically get the same configuration)
Charles Chandd26eeb2019-08-29 17:59:21 -0700211
212 .. code-block:: console
213
214 $ onos-netcfg $OC1 network-cfg.json
215
216- Remotely log in to CLI of one particular ONOS instance
217
218 .. code-block:: console
219
220 $ onos $OC1
221
222- Remotely access the log of one particular ONOS instance
223
224 .. code-block:: console
225
226 $ onos-log $OC1
227
228
229Install Switch OS - ONL
230=======================
Charles Chandd26eeb2019-08-29 17:59:21 -0700231
Zack Williams40dfc972020-06-23 14:12:46 -0700232The switches listed in the :doc:`Supported Hardware <supported-hardware>` are
233shipped with Open Networking Install Environment (ONIE) boot loader.
234
235After booting up, we should see the ONIE prompt from console.
236
237Here we assume that the management port on the switch already has Internet
238access. (via DHCP)
Charles Chandd26eeb2019-08-29 17:59:21 -0700239
240Enter ONIE
241----------
242
243
244Has no ONL or Has ONL 1.x previously installed
245^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williams40dfc972020-06-23 14:12:46 -0700246
Charles Chandd26eeb2019-08-29 17:59:21 -0700247The way to install ONL 2.x is the same as ONL 1.x.
Zack Williams40dfc972020-06-23 14:12:46 -0700248
249However, if you have no ONL installed or have older version of ONL, you might
250find it tricky to (re)install a newer version.
251
Charles Chandd26eeb2019-08-29 17:59:21 -0700252Here's the instruction:
253
254 1. Plug in the console cable and reboot the switch
Zack Williams40dfc972020-06-23 14:12:46 -0700255
256 2. (If your boot loader is grub) When you see the boot menu, select **ONIE
257 -> ONIE: Rescue**
258
259 3. (If your boot loader is uboot) When you see **Hit any key to stop
260 autoboot** instead of the boot menu, press any key and then enter
261 ``run onie_rescue`` to enter ONIE rescue mode.
Charles Chandd26eeb2019-08-29 17:59:21 -0700262
263Has ONL 2.x previously installed
264^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williams40dfc972020-06-23 14:12:46 -0700265
266It would be much more easier to reboot into ONIE if you have a previously
267installed ONL 2. Simply run:
Charles Chandd26eeb2019-08-29 17:59:21 -0700268
269
270.. code-block:: console
271
272 # onl-onie-boot-mode rescue
273 # reboot
274
275Available ONIE modes are: *install, rescue, uninstall, update, embed, diag, none*.
276This can be helpful when you are in a normal ONL and want to upgrade your system.
277
278
279Install ONL
280-----------
Zack Williams40dfc972020-06-23 14:12:46 -0700281
282At the ONIE prompt, we need to download and install ONL. To be able to
283download ONL the management interface needs to have an IP. ONIE will try to
284obtain IP address from DHCP. In the case where DHCP service is not available,
285please configure it manually:
286
Andrea Campanella2a5d7ce2020-01-21 10:56:50 +0100287.. code-block:: console
288
289 ip addr add <IP>/<Netmask> dev <interface>
290 route add default gw <Gateway>
291 echo "nameserver 8.8.8.8" > /etc/resolv.conf
292
293To fetch and install the latest compatible ONL, run:
Charles Chandd26eeb2019-08-29 17:59:21 -0700294
295.. code-block:: console
296
297 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
298 ONIE:/ # sh ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER
299
300**Checksum**: *sha256:2db316ea83f5dc761b9b11cc8542f153f092f3b49d82ffc0a36a2c41290f5421*
301
Zack Williams40dfc972020-06-23 14:12:46 -0700302The switch will automatically reboot into ONL after installation. Default login
303credential of ONL is: ``root/onl``
Charles Chandd26eeb2019-08-29 17:59:21 -0700304
Zack Williams40dfc972020-06-23 14:12:46 -0700305We might want to configure a fixed IP address for the management interface in
306ONL.
307
308First edit ``/etc/network/interfaces`` and configure ``ma1``, which is the
309management interface.
Charles Chandd26eeb2019-08-29 17:59:21 -0700310
311.. code-block:: text
312
313 auto ma1
314 iface ma1 inet static
315 address 10.128.10.128
316 netmask 255.255.0.0
317 gateway 10.128.0.1
318 dns-nameservers 192.168.1.1 8.8.8.8
319
320
321Install Switch Agent - OF-DPA
322=============================
323
Charles Chan64adc382019-09-09 18:15:02 -0700324.. note::
325 **Community vs. Premium Version**
Charles Chandd26eeb2019-08-29 17:59:21 -0700326
Charles Chan64adc382019-09-09 18:15:02 -0700327 The OF-DPA image we distribute for free with Trellis is a community version.
Zack Williams40dfc972020-06-23 14:12:46 -0700328
Charles Chan64adc382019-09-09 18:15:02 -0700329 This documentation is also written based on the community version.
Zack Williams40dfc972020-06-23 14:12:46 -0700330
331 The **community version** has most of the features available and therefore
332 it is **good for small scale deployments** such as lab trials.
333
334 However, we highly recommend you to get the **premium version** from
335 Broadcom if you are aiming for **production deployments at scale**.
Charles Chandd26eeb2019-08-29 17:59:21 -0700336
337
338Install OF-DPA
339--------------
Zack Williams40dfc972020-06-23 14:12:46 -0700340
341We need to use different OF-DPA images depending on the switch model you are
342using.
343
344Please find the installer URL corresponding to each switch model in the `Vendor
345Specific Information`_ section.
Charles Chandd26eeb2019-08-29 17:59:21 -0700346
347Copy the image to the switch and start the installation process by running:
348
349.. code-block:: console
350
351 $ scp ${OFDPA_DEB} ${SWITCH_IP}:/root
352 $ dpkg -i --force-overwrite /root/${OFDPA_DEB}
353
Zack Williams40dfc972020-06-23 14:12:46 -0700354For example, assuming the OF-DPA image is
355``ofdpa_3.0.5.5+accton1.7-1_amd64.deb`` and the switch management IP is
356``10.128.0.201``, you should run:
Charles Chandd26eeb2019-08-29 17:59:21 -0700357
358.. code-block:: console
359
360 $ scp ofdpa_3.0.5.5+accton1.7-1_amd64.deb 10.128.0.201:/root
361 $ dpkg -i --force-overwrite /root/ofdpa_3.0.5.5+accton1.7-1_amd64.deb
362
363
364Connect Switch to Controller
365============================
366
Charles Chan19833d82019-09-07 20:49:14 -0700367.. caution::
Zack Williams40dfc972020-06-23 14:12:46 -0700368 We are going to describe two different ways to start OF-DPA and OpenFlow
369 agent in this section.
370
371 Some vendors use ``ofagentd`` service while others use old ``launcher`` app
372 to start the agent.
373
374 Please check the `Vendor Specific Information`_ to understand which method
375 you should use before continuing this section.
Charles Chandd26eeb2019-08-29 17:59:21 -0700376
Charles Chan19833d82019-09-07 20:49:14 -0700377Use ofagentd service
378--------------------
379
380Launch with ofagentd
381^^^^^^^^^^^^^^^^^^^^
Zack Williams40dfc972020-06-23 14:12:46 -0700382The OFDPA software and the Indigo agent are now a single process launched by
383Linux service. First of all, we need to configure
384**/etc/ofagent/ofagent.conf**. Uncomment and edit the following line. Make
385sure all other lines stay commented.
Charles Chandd26eeb2019-08-29 17:59:21 -0700386
387.. code-block:: bash
388
389 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
390
391We can choose to run OF-DPA in **debug mode**
392
393.. code-block:: bash
394
395 OPT_ARGS="-d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
396
Charles Chan19833d82019-09-07 20:49:14 -0700397- To **start** the ofagent, run ``service ofagentd start``
Zack Williams40dfc972020-06-23 14:12:46 -0700398
Charles Chan19833d82019-09-07 20:49:14 -0700399- To **stop** the agent, run ``service ofagentd stop``
Zack Williams40dfc972020-06-23 14:12:46 -0700400
Charles Chandd26eeb2019-08-29 17:59:21 -0700401- More ``ofagentapp`` options can be found by running ``ofagentapp --help``
402
403
Charles Chan19833d82019-09-07 20:49:14 -0700404Launch in listen mode with ofagentd
405^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williams40dfc972020-06-23 14:12:46 -0700406
407An optional ``-l`` parameter can be added for switch to listen on specific
408**IP:port**.
409
410This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and
411control the switch.
Charles Chandd26eeb2019-08-29 17:59:21 -0700412
413.. code-block:: bash
414
415 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>"
416
Zack Williams40dfc972020-06-23 14:12:46 -0700417Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to
418access switches in listen mode.
Charles Chan19833d82019-09-07 20:49:14 -0700419
420Use launcher app
421----------------
422
423Launch with launcher
424^^^^^^^^^^^^^^^^^^^^
425- To **start** OF-DPA and OpenFlow agent, run:
426
427 .. code-block:: console
428
429 # ./launcher ofagentapp -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>
430
431- We can choose to run OF-DPA in **debug mode**
432
433 .. code-block:: console
434
435 # ./launcher ofagentapp -d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>
436
437- To **stop** OF-DPA and OpenFlow agent, run:
438
Zack Williams4d900762020-01-21 11:00:35 -0700439 .. code-block:: console
Charles Chan19833d82019-09-07 20:49:14 -0700440
441 # killall ofagentapp
442
443Launch in listen mode with launcher
444^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williams40dfc972020-06-23 14:12:46 -0700445
446An optional ``-l`` parameter can be added for switch to listen on specific
447**IP:port**.
448
449This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and
450control the switch.
Charles Chandd26eeb2019-08-29 17:59:21 -0700451
452.. code-block:: console
453
Charles Chan19833d82019-09-07 20:49:14 -0700454 # ./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 -0700455
Zack Williams40dfc972020-06-23 14:12:46 -0700456Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to
457access switches in listen mode.
Charles Chandd26eeb2019-08-29 17:59:21 -0700458
459
460Vendor Specific Information
461===========================
462
463
464Edgecore
465--------
466
Charles Chan19833d82019-09-07 20:49:14 -0700467- **OF-DPA Image**
Zack Williams40dfc972020-06-23 14:12:46 -0700468
469 - `EdgeCore 5712-54X / 5812-54X / 6712-32X / 7712-32X
470 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa_3.0.5.5%2Baccton1.7-1_amd64.deb>`_
471 **Checksum**: *sha256:db228b6e79fb15f77497b59689235606b60abc157e72fc3356071bcc8dc4c01f*
Charles Chandd26eeb2019-08-29 17:59:21 -0700472
Charles Chan19833d82019-09-07 20:49:14 -0700473- **Start OF-DPA and OpenFlow agent**
Zack Williams40dfc972020-06-23 14:12:46 -0700474
Charles Chan19833d82019-09-07 20:49:14 -0700475 - Please refer to `Use ofagentd service`_
476
477- **Configure Port Speed and Breakout**
Zack Williams40dfc972020-06-23 14:12:46 -0700478
479 - By default all the switch ports are running at maximum speed. The port
480 speed can be modified in **/etc/accton/ofdpa.conf**
Charles Chandd26eeb2019-08-29 17:59:21 -0700481
482 .. code-block:: text
483
484 port_speed_1=1000 # configure front port 1 to run at 1G
485
486 - We can also configure the same file to use break out cables on certain ports.
487
488 .. code-block:: text
489
490 port_mode_1=4x10g # configure front port 1 to break out from 40G to 4x10G
491
492 OF-DPA service needs to be restarted after modifying this configuration.
493
Charles Chandd26eeb2019-08-29 17:59:21 -0700494QCT
495---
496
497- OF-DPA Image
Zack Williams40dfc972020-06-23 14:12:46 -0700498
499 - `QuantaMesh T3048-LY8
500 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ag7648_0.3.0.5.6_amd64.deb>`_
501 **Checksum**: *sha256:f8201530b1452145c1a0956ea1d3c0402c3568d090553d0d7b3c91a79137da9e*
502
503 - `QuantaMesh T7032-IX1 / IX1B
504 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ix1_0.3.0.5.0-EA5-qct-01.00_amd64.deb>`_
505 **Checksum**: *sha256:278b8ffed8a8fc705a1b60d16f8e70377e78342a27a11568a1d80b1efd706a46*
Charles Chandd26eeb2019-08-29 17:59:21 -0700506
Charles Chan19833d82019-09-07 20:49:14 -0700507- **Start OF-DPA and OpenFlow agent**
508 - Please refer to `Use launcher app`_
509
510- Configure Port Speed and Breakout
Zack Williams40dfc972020-06-23 14:12:46 -0700511
Charles Chan19833d82019-09-07 20:49:14 -0700512 The command ``client_drivshell`` can be used to configure the port speed.
Zack Williams40dfc972020-06-23 14:12:46 -0700513
514 Use the parameter ``ps`` to list all ports or ``ps <port number>`` to list
515 one specific port.
Charles Chan19833d82019-09-07 20:49:14 -0700516
517 .. code-block:: console
518
519 # client_drivshell ps 1
520 Calling ofdpaBcmCommand rpc with command = "ps 1 ".
521 ena/ speed/ link auto STP lrn inter max loop
522 port link duplex scan neg? state pause discrd ops face frame back
523 xe0( 1) down 10G FD SW No Forward Untag F SFI 9412
524
525 Returned from ofdpaBcmCommand rpc with rc = 0.
526
Zack Williams40dfc972020-06-23 14:12:46 -0700527 Then use the parameter ``port <port number> sp=<port speed>`` to change the
528 port speed.
Charles Chan19833d82019-09-07 20:49:14 -0700529
530 .. code-block:: console
531
532 # client_drivshell port xe0 sp=1000
533 Calling ofdpaBcmCommand rpc with command = "port xe0 sp=1000 ".
534
535 Returned from ofdpaBcmCommand rpc with rc = 0.
536
537 # client_drivshell ps 1
538 Calling ofdpaBcmCommand rpc with command = "ps 1 ".
539 ena/ speed/ link auto STP lrn inter max loop
540 port link duplex scan neg? state pause discrd ops face frame back
541 xe0( 1) down 1G FD SW No Forward Untag F GMII 9412
542
543 Returned from ofdpaBcmCommand rpc with rc = 0.
Charles Chandd26eeb2019-08-29 17:59:21 -0700544
545Delta
546-----
547
548- OF-DPA Image
Zack Williams40dfc972020-06-23 14:12:46 -0700549
550 - `Delta AG7648
551 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ly8_0.3.0.5.0-EA5-qct-01.01_amd64.deb>`_
552 **Checksum**: *sha256:ddfc13cb98ca47291dce5e6938b1d65f0b99bbe77f0585e36ac0007017397f23*
Charles Chandd26eeb2019-08-29 17:59:21 -0700553
Charles Chan19833d82019-09-07 20:49:14 -0700554- **Start OF-DPA and OpenFlow agent**
Zack Williams40dfc972020-06-23 14:12:46 -0700555
Charles Chan19833d82019-09-07 20:49:14 -0700556 - Please refer to `Use launcher app`_
557
Charles Chandd26eeb2019-08-29 17:59:21 -0700558- Special instructions to install ONL
Zack Williams40dfc972020-06-23 14:12:46 -0700559
560 Make sure ``/etc/machine.conf`` looks like the following in ONIE before
561 running ONL installation script:
Charles Chandd26eeb2019-08-29 17:59:21 -0700562
563 .. code-block:: text
564
565 onie_platform=x86_64-delta_<platform name>-r0
566 onie_machine=delta_<platform name>
567
Zack Williams40dfc972020-06-23 14:12:46 -0700568 After the installation of ONL, if you don't see '/usr/bin' in your PATH
569 variable, please run the following command:
Charles Chandd26eeb2019-08-29 17:59:21 -0700570
571 .. code-block:: console
572
573 # export PATH=$PATH:/usr/bin
574
Charles Chandd26eeb2019-08-29 17:59:21 -0700575
576Useful Information
577==================
578
Charles Chandd26eeb2019-08-29 17:59:21 -0700579OF-DPA Commands
580---------------
581There are some useful OF-DPA commands under ``/usr/bin/``
582
583.. code-block:: text
584
585 client_cfg_purge
586 client_debugcomp
587 client_drivshell
588 client_flowtable_dump
589 client_meter_dump
590 client_port_table_dump
591 client_tunnel_dump
592 client_classcolortable_dump
593 client_debuglvl
594 client_event
595 client_grouptable_dump
596 client_oam_dump
597 client_queue_config
598
599
600ONL Boot Mode
601-------------
602OFDPA offers two boot mode: **INSTALLED** and **SWI**.
603
Zack Williams40dfc972020-06-23 14:12:46 -0700604- In **INSTALLED** mode, ONL mounts the root filesystem from ``/dev/sdb7``
605 which is a flash drive that persists everything even during a power cycle.
Charles Chandd26eeb2019-08-29 17:59:21 -0700606
Zack Williams40dfc972020-06-23 14:12:46 -0700607- In **SWI** mode, ONL will load the root filesystem from a read-only image
608 (``*.swi``) and put the modified files in an copy-on-write overlay filesystem.
609
610 The change will not be persisted during a power cycle.
611
612 The pros and cons are obvious. INSTALLED mode is more convenient while SWI
613 mode is more error-safe.
614
615The boot mode will be determined by which image we used install ONL. We use the
616**INSTALLED** mode in this instruction for simplicity. But we can still change
617it after the installation. Here's the instruction:
Charles Chandd26eeb2019-08-29 17:59:21 -0700618
619.. code-block:: console
620
621 # mount /mnt/onl/boot -o remount,rw
622 # sed -i 's/BOOTMODE=INSTALLED/BOOTMODE=SWI/g' /mnt/onl/boot/boot-config
623 # reboot
624
625
626Persistence Mechanism
627---------------------
Charles Chandd26eeb2019-08-29 17:59:21 -0700628
Zack Williams40dfc972020-06-23 14:12:46 -0700629INSTALLED mode already persists everything for you. This section is mainly for
630SWI mode.
631
632The mechanism to persist files on the switch is different from ONL 1.x to ONL
6332.x. Following are the steps required to persist a file (e.g. OFDPA package)
634in ONL 2.x.
Charles Chandd26eeb2019-08-29 17:59:21 -0700635
636- Files put in **/mnt/onl/data** will be persisted automatically.
Zack Williams40dfc972020-06-23 14:12:46 -0700637
638- To install a deb package during start-up, put the deb file under
639 **/mnt/onl/data/install-debs** folder and create a plain text file
640 **/mnt/onl/data/install-debs/list** with all the filename of the deb (e.g.
641 ``ofdpa_3.0.5.5+accton1.7-1_amd64.deb``)
642
643- To execute some command during start-up, put the command in
644 **/mnt/onl/data/rc.boot**
Charles Chandd26eeb2019-08-29 17:59:21 -0700645
646 .. code-block:: bash
647
648 # set static ip and route (dhcp by default)
649 echo 'ip addr add 10.128.0.203/16 dev ma1' >> /mnt/onl/data/rc.boot
650 echo 'ip route add default via 10.128.0.1' >> /mnt/onl/data/rc.boot
651 # grant executable permission
652 chmod a+x /mnt/onl/data/rc.boot
653
Zack Williams40dfc972020-06-23 14:12:46 -0700654See `PersistWorkflow.md
655<https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/PersistWorkflow.md>`_
656for more detail.
Charles Chandd26eeb2019-08-29 17:59:21 -0700657
658
659Build a Customized ONL Image
660----------------------------
Zack Williams40dfc972020-06-23 14:12:46 -0700661
662Sometimes we need to build our own ONL image from source to include some extra
663files. (The most common case is a modified /etc/network/interfaces).
664
665The instruction of build process has already been well-documented in ONL repo
666`Building.md
667<https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/Building.md>`_.
668
Charles Chandd26eeb2019-08-29 17:59:21 -0700669But you might find it a little bit tricky to inject some extra files.
Zack Williams40dfc972020-06-23 14:12:46 -0700670
671To do that, you need to put the files under
672**$ONL_ROOT/builds/any/rootfs/jessie/common/overlay/** and then run the make
673command again.
Charles Chandd26eeb2019-08-29 17:59:21 -0700674
675
676Recovery from a Faulty ONL Install
677----------------------------------
Zack Williams40dfc972020-06-23 14:12:46 -0700678If, for some reason, the ONL install process fails, you may be brought to the
679grub rescue prompt upon reboot.
680
681You may or may not find system files, or even basic grub rescue commands (i.e.
682'help').
683
Charles Chandd26eeb2019-08-29 17:59:21 -0700684There are two options for returning to a (known working) ONIE prompt.
685
Zack Williams40dfc972020-06-23 14:12:46 -07006861. **Reinstaller** - You should be able to acquire an ISO image for resetting
687 the firmware to factory default from your switch vendor. Once you have the
688 ISO, you can either use PXE or a live USB to boot the switch into the image.
689
6902. **Manually boot to ONIE** - If the files are there, you can manually
691 configure GRUB to load the necessary modules to boot back into ONIE.
Charles Chandd26eeb2019-08-29 17:59:21 -0700692
693 .. code-block:: console
694
695 # This should be the partition on the ONIE partition on the AS6712.
696 # It might be hd1 or hd0. Change appropriately.
697 grub rescue> ls (hd0,gpt2)/
698 ./ ../ lost+found/ onie/ grub/ grubenv
699
700 # These instructions will load the kernel and ONIE initrd.
701 grub rescue> set prefix=(hd0,gpt2)/grub
702 grub rescue> set root=(hd0,gpt2)
703 grub rescue> insmod normal
704 grub rescue> insmod linux
705 grub rescue> ls /onie
706 ./ ../ vmlinuz-3.2.35-onie initrd.img-3.2.35-onie tools/ grub/ grub.d/ config/
707
708 # if the ",115200n8" is omitted, baud rate defaults to 9600.
709 grub rescue> linux /onie/vmlinuz-3.2.35-onie console=tty0 console=ttyS1,115200n8
710 grub rescue> initrd /onie/initrd.img-3.2.35-onie
711
712 # The system will not boot into ONIE and you can recover or re-install from there.
713 grub rescue> boot
714
Zack Williams40dfc972020-06-23 14:12:46 -0700715Once back at the ONIE prompt, you can try to install ONL by following the same
716steps again.
Charles Chandd26eeb2019-08-29 17:59:21 -0700717
718
Charles Chan19833d82019-09-07 20:49:14 -0700719Connect to Switch in Listen Mode
720--------------------------------
Zack Williams40dfc972020-06-23 14:12:46 -0700721
722To connect to the switch in Listen Mode using **ovs-ofctl**, you can use
723commands such as:
Charles Chan19833d82019-09-07 20:49:14 -0700724
725.. code-block:: console
726
727 $ ovs-ofctl -O OpenFlow13 show tcp:<ip>:<port>
728 $ ovs-ofctl -O OpenFlow13 dump-flows tcp:<ip>:<port>
729 $ ovs-ofctl -O OpenFlow13 dump-groups tcp:<ip>:<port>
730 $ ovs-ofctl -O OpenFlow13 add-flow tcp:<ip>:<port> table=60,priority=40000,eth_type=0x0800,ip_dst=55.55.55.55,actions=controller
731
Zack Williams40dfc972020-06-23 14:12:46 -0700732For more command, please see ``ovs-ofctl --help`` or the post `OpenvSwitch
733ovs-ofctl and OF-DPA
734<https://blog.pichuang.com.tw/20170106-ovs-ofctl-and-ofdpa/>`_.
Charles Chan19833d82019-09-07 20:49:14 -0700735
736
Charles Chandd26eeb2019-08-29 17:59:21 -0700737Reference
738---------
Zack Williams40dfc972020-06-23 14:12:46 -0700739
740- `ONL/OF-DPA installation guide by Edgecore Networks
741 <https://www.youtube.com/watch?v=mCUtkIc_hVI>`_
742
743- `ONL/OF-DPA cheat sheet by Phil Huang
744 <https://blog.pichuang.com.tw/20170104-ofdpa-with-onl-cheat-sheet/>`_