Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 1 | .. |onos_version| replace:: 2.2.3 |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 2 | |
Charles Chan | 78a737f | 2019-09-12 13:55:22 -0700 | [diff] [blame] | 3 | Installation Guide |
| 4 | ****************** |
Zack Williams | 553a363 | 2019-08-09 17:14:43 -0700 | [diff] [blame] | 5 | |
Charles Chan | 4d5ee19 | 2019-09-09 23:08:36 -0700 | [diff] [blame] | 6 | Building a Hardware Pod |
| 7 | ======================= |
| 8 | See :doc:`Supported Hardware <supported-hardware>` for details. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 9 | |
| 10 | |
| 11 | Install Controller - ONOS |
| 12 | ========================= |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 13 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 14 | You could run Trellis with a `single instance of ONOS |
| 15 | <https://wiki.onosproject.org/display/ONOS/Local+workflow>`_. But it is |
| 16 | recommended to run ONOS as a cluster. |
| 17 | |
| 18 | The idea is to have a "build machine", where you host and build ONOS source |
| 19 | code. But to launch it in operation you use other "target machines" (VMs, |
| 20 | containers or servers). |
| 21 | |
| 22 | Typically we use `STC |
| 23 | <https://wiki.onosproject.org/pages/viewpage.action?pageId=12421025>`_ to |
| 24 | launch ONOS ins 3 target machines which form a ONOS cluster. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 25 | |
| 26 | |
| 27 | Download ONOS |onos_version| |
Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 28 | ---------------------------- |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 29 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 30 | Trellis currently is released as part of ONOS and therefore it follows ONOS |
| 31 | version number. This document is written based on ONOS |onos_version|. |
| 32 | |
| 33 | You can find more information about how to setup build environment and fetch |
| 34 | ONOS source code from `Development Environment Setup |
| 35 | <https://wiki.onosproject.org/display/ONOS/Development+Environment+Setup>`_. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 36 | |
| 37 | |
| 38 | Prepare Your Target Machine |
| 39 | --------------------------- |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 40 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 41 | Please refer to `target machines requirements |
| 42 | <https://wiki.onosproject.org/x/twAQ>`_ for details (you only have to do this |
| 43 | once). |
| 44 | |
| 45 | You do not need to follow the directions for the "Mininet Target Machine" if |
| 46 | you are using hardware switches. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 47 | |
| 48 | |
| 49 | Create a Cell File |
| 50 | -------------------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 51 | |
| 52 | We need to compose a cell file in order to give the information about target |
| 53 | machines to the build machine. Please refer to `test cells |
| 54 | <https://wiki.onosproject.org/x/twAQ>`_ for details. For example: |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 55 | |
| 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 |
Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 62 | export ONOS_APPS=drivers,gui,hostprovider,lldpprovider,fpm,dhcprelay,routeradvertisement,hostprobingprovider,netcfghostprovider |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 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 Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 69 | - ``OC1, OC2, OC3`` are the IP addresses of the 3 target machines where the |
| 70 | ONOS cluster will be deployed. |
| 71 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 72 | - ``ONOS_APPS`` are the apps you want to automatically deploy at launch. |
| 73 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 74 | - ``drivers`` includes drivers for various devices and pipelines. Always |
| 75 | required. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 76 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 77 | - ``gui`` enables graphic user interface. Highly recommended. |
| 78 | |
Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 79 | - ``hostprovider`` discovers hosts via ARP and NDP |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 80 | |
Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 81 | - ``lldpprovider`` discovers links via LLDP |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 82 | |
| 83 | - ``fpm`` (Forwarding Plane Manager) exchanges forwarding information with |
| 84 | Quagga. Required if connecting to external router. |
| 85 | |
| 86 | - ``dhcprelay`` relays DHCP packets between clients and servers. Required |
| 87 | if using DHCP to configure IP addresses for hosts |
| 88 | |
| 89 | - ``routeradvertisement`` periodically sends IPv6 router advertisement |
| 90 | packets on configured interfaces. Required if using IPv6 |
| 91 | |
| 92 | - ``hostprobingprovider`` probes and verifies locations of dual-homed |
| 93 | hosts. Required if using dual-homing feature with paired switches |
| 94 | |
Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 95 | - ``netcfghostprovider`` reads hosts information from network config and add them to the host service. |
| 96 | Required if we want to statically configure some hosts. |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 97 | |
| 98 | - ``ONOS_USER`` is used to login to the target machines, and the password is |
| 99 | not required as you have setup the target machines for password-less access |
| 100 | over ssh. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 101 | |
| 102 | Once that's done, you can use the ``cell`` command to load the cell file. |
| 103 | |
| 104 | .. code-block:: console |
| 105 | |
| 106 | $ source onos/tools/dev/bash_profile |
| 107 | $ cell menlo |
| 108 | |
| 109 | |
| 110 | Check Your Target Environment |
| 111 | ----------------------------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 112 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 113 | Check if your environment is OK with ``stc prerequisites`` (you only have to do this once). |
| 114 | |
| 115 | .. code-block:: console |
| 116 | |
| 117 | $ stc prerequisites |
| 118 | 2017-02-07 12:10:23 Prerequisites started |
| 119 | 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 |
| 120 | 2017-02-07 12:10:23 Check-ONOS-Bits started -- onos-check-bits |
| 121 | 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 |
| 122 | 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 |
| 123 | 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 |
| 124 | 2017-02-07 12:10:23 Check-Environment completed |
| 125 | 2017-02-07 12:10:23 Check-Passwordless-Login-1 completed |
| 126 | 2017-02-07 12:10:23 Check-Passwordless-Login-2 completed |
| 127 | 2017-02-07 12:10:23 Check-Passwordless-Login-3 completed |
| 128 | 2017-02-07 12:10:25 Check-ONOS-Bits completed |
| 129 | 2017-02-07 12:10:25 Prerequisites completed |
| 130 | 0:01 Passed! 6 steps succeeded |
| 131 | |
| 132 | |
| 133 | Launch STC Command |
| 134 | ------------------ |
| 135 | Finally launch with ``stc setup`` once you have built ONOS. Here is what it looks like when I launch |
| 136 | |
| 137 | .. code-block:: console |
| 138 | |
| 139 | $ stc setup |
| 140 | 2016-12-23 12:26:44 Setup started |
| 141 | 2016-12-23 12:26:44 Uninstall-3 started -- onos-uninstall 10.128.0.218 |
| 142 | 2016-12-23 12:26:44 Uninstall-2 started -- onos-uninstall 10.128.0.217 |
| 143 | 2016-12-23 12:26:44 Uninstall-1 started -- onos-uninstall 10.128.0.216 |
| 144 | 2016-12-23 12:26:44 Push-Bits-2 started -- onos-push-bits 10.128.0.217 |
| 145 | 2016-12-23 12:26:44 Push-Bits-3 started -- onos-push-bits 10.128.0.218 |
| 146 | 2016-12-23 12:26:44 Push-Bits-1 started -- onos-push-bits 10.128.0.216 |
| 147 | 2016-12-23 12:26:45 Push-Bits-1 completed |
| 148 | 2016-12-23 12:26:46 Push-Bits-2 completed |
| 149 | 2016-12-23 12:26:46 Push-Bits-3 completed |
| 150 | 2016-12-23 12:26:46 Uninstall-3 completed |
| 151 | 2016-12-23 12:26:46 Kill-3 started -- onos-kill 10.128.0.218 |
| 152 | 2016-12-23 12:26:46 Uninstall-2 completed |
| 153 | 2016-12-23 12:26:46 Kill-2 started -- onos-kill 10.128.0.217 |
| 154 | 2016-12-23 12:26:46 Uninstall-1 completed |
| 155 | 2016-12-23 12:26:46 Kill-1 started -- onos-kill 10.128.0.216 |
| 156 | 2016-12-23 12:26:46 Kill-3 completed |
| 157 | 2016-12-23 12:26:46 Install-3 started -- onos-install 10.128.0.218 |
| 158 | 2016-12-23 12:26:46 Kill-1 completed |
| 159 | 2016-12-23 12:26:46 Install-1 started -- onos-install 10.128.0.216 |
| 160 | 2016-12-23 12:26:46 Kill-2 completed |
| 161 | 2016-12-23 12:26:46 Install-2 started -- onos-install 10.128.0.217 |
| 162 | 2016-12-23 12:26:52 Install-2 completed |
| 163 | 2016-12-23 12:26:52 Secure-SSH-2 started -- onos-secure-ssh -u onos -p rocks 10.128.0.217 |
| 164 | 2016-12-23 12:26:52 Install-1 completed |
| 165 | 2016-12-23 12:26:52 Secure-SSH-1 started -- onos-secure-ssh -u onos -p rocks 10.128.0.216 |
| 166 | 2016-12-23 12:26:52 Install-3 completed |
| 167 | 2016-12-23 12:26:52 Secure-SSH-3 started -- onos-secure-ssh -u onos -p rocks 10.128.0.218 |
| 168 | 2016-12-23 12:27:07 Secure-SSH-1 completed |
| 169 | 2016-12-23 12:27:07 Wait-for-Start-1 started -- onos-wait-for-start 10.128.0.216 |
| 170 | 2016-12-23 12:27:09 Secure-SSH-3 completed |
| 171 | 2016-12-23 12:27:09 Wait-for-Start-3 started -- onos-wait-for-start 10.128.0.218 |
| 172 | 2016-12-23 12:27:13 Secure-SSH-2 completed |
| 173 | 2016-12-23 12:27:13 Wait-for-Start-2 started -- onos-wait-for-start 10.128.0.217 |
| 174 | 2016-12-23 12:27:14 Wait-for-Start-1 completed |
| 175 | 2016-12-23 12:27:14 Check-Components-1 started -- onos-check-components 10.128.0.216 |
| 176 | 2016-12-23 12:27:14 Check-Nodes-1 started -- onos-check-nodes 10.128.0.216 |
| 177 | 2016-12-23 12:27:14 Wait-for-Start-3 completed |
| 178 | 2016-12-23 12:27:14 Check-Nodes-3 started -- onos-check-nodes 10.128.0.218 |
| 179 | 2016-12-23 12:27:14 Check-Components-3 started -- onos-check-components 10.128.0.218 |
| 180 | 2016-12-23 12:27:16 Wait-for-Start-2 completed |
| 181 | 2016-12-23 12:27:16 Check-Nodes-2 started -- onos-check-nodes 10.128.0.217 |
| 182 | 2016-12-23 12:27:16 Check-Components-2 started -- onos-check-components 10.128.0.217 |
| 183 | 2016-12-23 12:27:18 Check-Nodes-1 completed |
| 184 | 2016-12-23 12:27:18 Check-Nodes-3 completed |
| 185 | 2016-12-23 12:27:19 Check-Nodes-2 completed |
| 186 | 2016-12-23 12:27:20 Check-Components-1 completed |
| 187 | 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 |
| 188 | 2016-12-23 12:27:20 Check-Logs-1 started -- onos-check-logs 10.128.0.216 |
| 189 | 2016-12-23 12:27:20 Check-Components-3 completed |
| 190 | 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 |
| 191 | 2016-12-23 12:27:20 Check-Logs-3 started -- onos-check-logs 10.128.0.218 |
| 192 | 2016-12-23 12:27:20 Check-Apps-1 completed |
| 193 | 2016-12-23 12:27:20 Check-Apps-3 completed |
| 194 | 2016-12-23 12:27:20 Check-Logs-1 completed |
| 195 | 2016-12-23 12:27:20 Check-Logs-3 completed |
| 196 | 2016-12-23 12:27:21 Check-Components-2 completed |
| 197 | 2016-12-23 12:27:21 Check-Logs-2 started -- onos-check-logs 10.128.0.217 |
| 198 | 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 |
| 199 | 2016-12-23 12:27:21 Check-Apps-2 completed |
| 200 | 2016-12-23 12:27:21 Check-Logs-2 completed |
| 201 | 2016-12-23 12:27:21 Setup completed |
| 202 | 0:36 Passed! 31 steps succeeded |
| 203 | |
| 204 | |
| 205 | Useful Utilities |
| 206 | ---------------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 207 | |
| 208 | - Push network configuration to one particular instance of ONOS (all instances |
| 209 | will automatically get the same configuration) |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 210 | |
| 211 | .. code-block:: console |
| 212 | |
| 213 | $ onos-netcfg $OC1 network-cfg.json |
| 214 | |
| 215 | - Remotely log in to CLI of one particular ONOS instance |
| 216 | |
| 217 | .. code-block:: console |
| 218 | |
| 219 | $ onos $OC1 |
| 220 | |
| 221 | - Remotely access the log of one particular ONOS instance |
| 222 | |
| 223 | .. code-block:: console |
| 224 | |
| 225 | $ onos-log $OC1 |
| 226 | |
| 227 | |
Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 228 | Install Trellis apps |
| 229 | ==================== |
| 230 | |
| 231 | Starting from ONOS 2.5, Trellis apps have been extracted from ONOS repo. |
| 232 | Therefore, those apps needs to be installed and activated additionally. |
| 233 | |
| 234 | trellis-control |
| 235 | --------------- |
| 236 | |
| 237 | ``segmentrouting`` forwards the traffic in the fabric. **Mandatory**. |
| 238 | |
| 239 | For details, check the README at `trellis-control repo |
| 240 | <https://github.com/opennetworkinglab/trellis-control>`_. |
| 241 | |
| 242 | |
| 243 | trellis-t3 |
| 244 | ---------- |
| 245 | |
| 246 | ``t3`` (Trellis Troubleshooting Tool) is very useful for debugging. **Optional** but highly recommended. |
| 247 | |
| 248 | For details, check the README at `trellis-t3 repo |
| 249 | <https://github.com/opennetworkinglab/trellis-t3>`_. |
| 250 | |
| 251 | |
Zack Williams | 879046f | 2020-07-17 17:30:14 -0700 | [diff] [blame] | 252 | Install switch-specific apps |
Charles Chan | 756db00 | 2020-06-27 18:57:06 -0700 | [diff] [blame] | 253 | ============================ |
| 254 | |
| 255 | There are a few switch-specific apps that need to be installed and activated additionally |
| 256 | based on the type of switch you are using. |
| 257 | It is possible to support a hybrid deployment in which you have different switch types. |
| 258 | In that case, simply enable the apps required by each type of switches. |
| 259 | |
| 260 | OF-DPA and OVS |
| 261 | -------------- |
| 262 | |
| 263 | .. code-block:: console |
| 264 | |
| 265 | app activate org.onosproject.openflow |
| 266 | |
| 267 | |
| 268 | BMV2 with Stratum |
| 269 | ----------------- |
| 270 | |
| 271 | .. code-block:: console |
| 272 | |
| 273 | app activate org.onosproject.drivers.bmv2 |
| 274 | app activate org.onosproject.pipelines.fabric |
| 275 | |
| 276 | Tofino with Stratum |
| 277 | ------------------- |
| 278 | |
| 279 | .. code-block:: console |
| 280 | |
| 281 | app activate org.onosproject.drivers.barefoot |
| 282 | |
| 283 | In addition, we need to build, install and activate ``fabric-tofino`` app, which is hosted in a separate repo. |
| 284 | |
| 285 | For details, check the README at `fabric-tofino repo |
| 286 | <https://github.com/opencord/fabric-tofino>`_. |
| 287 | |
| 288 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 289 | Install Switch OS - ONL |
| 290 | ======================= |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 291 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 292 | The switches listed in the :doc:`Supported Hardware <supported-hardware>` are |
| 293 | shipped with Open Networking Install Environment (ONIE) boot loader. |
| 294 | |
| 295 | After booting up, we should see the ONIE prompt from console. |
| 296 | |
| 297 | Here we assume that the management port on the switch already has Internet |
| 298 | access. (via DHCP) |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 299 | |
| 300 | Enter ONIE |
| 301 | ---------- |
| 302 | |
| 303 | |
| 304 | Has no ONL or Has ONL 1.x previously installed |
| 305 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 306 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 307 | The way to install ONL 2.x is the same as ONL 1.x. |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 308 | |
| 309 | However, if you have no ONL installed or have older version of ONL, you might |
| 310 | find it tricky to (re)install a newer version. |
| 311 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 312 | Here's the instruction: |
| 313 | |
| 314 | 1. Plug in the console cable and reboot the switch |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 315 | |
| 316 | 2. (If your boot loader is grub) When you see the boot menu, select **ONIE |
| 317 | -> ONIE: Rescue** |
| 318 | |
| 319 | 3. (If your boot loader is uboot) When you see **Hit any key to stop |
| 320 | autoboot** instead of the boot menu, press any key and then enter |
| 321 | ``run onie_rescue`` to enter ONIE rescue mode. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 322 | |
| 323 | Has ONL 2.x previously installed |
| 324 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 325 | |
| 326 | It would be much more easier to reboot into ONIE if you have a previously |
| 327 | installed ONL 2. Simply run: |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 328 | |
| 329 | |
| 330 | .. code-block:: console |
| 331 | |
| 332 | # onl-onie-boot-mode rescue |
| 333 | # reboot |
| 334 | |
| 335 | Available ONIE modes are: *install, rescue, uninstall, update, embed, diag, none*. |
| 336 | This can be helpful when you are in a normal ONL and want to upgrade your system. |
| 337 | |
| 338 | |
| 339 | Install ONL |
| 340 | ----------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 341 | |
| 342 | At the ONIE prompt, we need to download and install ONL. To be able to |
| 343 | download ONL the management interface needs to have an IP. ONIE will try to |
| 344 | obtain IP address from DHCP. In the case where DHCP service is not available, |
| 345 | please configure it manually: |
| 346 | |
Andrea Campanella | 2a5d7ce | 2020-01-21 10:56:50 +0100 | [diff] [blame] | 347 | .. code-block:: console |
| 348 | |
| 349 | ip addr add <IP>/<Netmask> dev <interface> |
| 350 | route add default gw <Gateway> |
| 351 | echo "nameserver 8.8.8.8" > /etc/resolv.conf |
| 352 | |
| 353 | To fetch and install the latest compatible ONL, run: |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 354 | |
| 355 | .. code-block:: console |
| 356 | |
| 357 | 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 |
| 358 | ONIE:/ # sh ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER |
| 359 | |
| 360 | **Checksum**: *sha256:2db316ea83f5dc761b9b11cc8542f153f092f3b49d82ffc0a36a2c41290f5421* |
| 361 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 362 | The switch will automatically reboot into ONL after installation. Default login |
| 363 | credential of ONL is: ``root/onl`` |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 364 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 365 | We might want to configure a fixed IP address for the management interface in |
| 366 | ONL. |
| 367 | |
| 368 | First edit ``/etc/network/interfaces`` and configure ``ma1``, which is the |
| 369 | management interface. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 370 | |
| 371 | .. code-block:: text |
| 372 | |
| 373 | auto ma1 |
| 374 | iface ma1 inet static |
| 375 | address 10.128.10.128 |
| 376 | netmask 255.255.0.0 |
| 377 | gateway 10.128.0.1 |
| 378 | dns-nameservers 192.168.1.1 8.8.8.8 |
| 379 | |
| 380 | |
| 381 | Install Switch Agent - OF-DPA |
| 382 | ============================= |
| 383 | |
Charles Chan | 64adc38 | 2019-09-09 18:15:02 -0700 | [diff] [blame] | 384 | .. note:: |
| 385 | **Community vs. Premium Version** |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 386 | |
Charles Chan | 64adc38 | 2019-09-09 18:15:02 -0700 | [diff] [blame] | 387 | The OF-DPA image we distribute for free with Trellis is a community version. |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 388 | |
Charles Chan | 64adc38 | 2019-09-09 18:15:02 -0700 | [diff] [blame] | 389 | This documentation is also written based on the community version. |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 390 | |
| 391 | The **community version** has most of the features available and therefore |
| 392 | it is **good for small scale deployments** such as lab trials. |
| 393 | |
| 394 | However, we highly recommend you to get the **premium version** from |
| 395 | Broadcom if you are aiming for **production deployments at scale**. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 396 | |
| 397 | |
| 398 | Install OF-DPA |
| 399 | -------------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 400 | |
| 401 | We need to use different OF-DPA images depending on the switch model you are |
| 402 | using. |
| 403 | |
| 404 | Please find the installer URL corresponding to each switch model in the `Vendor |
| 405 | Specific Information`_ section. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 406 | |
| 407 | Copy the image to the switch and start the installation process by running: |
| 408 | |
| 409 | .. code-block:: console |
| 410 | |
| 411 | $ scp ${OFDPA_DEB} ${SWITCH_IP}:/root |
| 412 | $ dpkg -i --force-overwrite /root/${OFDPA_DEB} |
| 413 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 414 | For example, assuming the OF-DPA image is |
| 415 | ``ofdpa_3.0.5.5+accton1.7-1_amd64.deb`` and the switch management IP is |
| 416 | ``10.128.0.201``, you should run: |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 417 | |
| 418 | .. code-block:: console |
| 419 | |
| 420 | $ scp ofdpa_3.0.5.5+accton1.7-1_amd64.deb 10.128.0.201:/root |
| 421 | $ dpkg -i --force-overwrite /root/ofdpa_3.0.5.5+accton1.7-1_amd64.deb |
| 422 | |
| 423 | |
| 424 | Connect Switch to Controller |
| 425 | ============================ |
| 426 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 427 | .. caution:: |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 428 | We are going to describe two different ways to start OF-DPA and OpenFlow |
| 429 | agent in this section. |
| 430 | |
| 431 | Some vendors use ``ofagentd`` service while others use old ``launcher`` app |
| 432 | to start the agent. |
| 433 | |
| 434 | Please check the `Vendor Specific Information`_ to understand which method |
| 435 | you should use before continuing this section. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 436 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 437 | Use ofagentd service |
| 438 | -------------------- |
| 439 | |
| 440 | Launch with ofagentd |
| 441 | ^^^^^^^^^^^^^^^^^^^^ |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 442 | The OFDPA software and the Indigo agent are now a single process launched by |
| 443 | Linux service. First of all, we need to configure |
| 444 | **/etc/ofagent/ofagent.conf**. Uncomment and edit the following line. Make |
| 445 | sure all other lines stay commented. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 446 | |
| 447 | .. code-block:: bash |
| 448 | |
| 449 | OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>" |
| 450 | |
| 451 | We can choose to run OF-DPA in **debug mode** |
| 452 | |
| 453 | .. code-block:: bash |
| 454 | |
| 455 | OPT_ARGS="-d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>" |
| 456 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 457 | - To **start** the ofagent, run ``service ofagentd start`` |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 458 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 459 | - To **stop** the agent, run ``service ofagentd stop`` |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 460 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 461 | - More ``ofagentapp`` options can be found by running ``ofagentapp --help`` |
| 462 | |
| 463 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 464 | Launch in listen mode with ofagentd |
| 465 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 466 | |
| 467 | An optional ``-l`` parameter can be added for switch to listen on specific |
| 468 | **IP:port**. |
| 469 | |
| 470 | This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and |
| 471 | control the switch. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 472 | |
| 473 | .. code-block:: bash |
| 474 | |
| 475 | OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>" |
| 476 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 477 | Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to |
| 478 | access switches in listen mode. |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 479 | |
| 480 | Use launcher app |
| 481 | ---------------- |
| 482 | |
| 483 | Launch with launcher |
| 484 | ^^^^^^^^^^^^^^^^^^^^ |
| 485 | - To **start** OF-DPA and OpenFlow agent, run: |
| 486 | |
| 487 | .. code-block:: console |
| 488 | |
| 489 | # ./launcher ofagentapp -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> |
| 490 | |
| 491 | - We can choose to run OF-DPA in **debug mode** |
| 492 | |
| 493 | .. code-block:: console |
| 494 | |
| 495 | # ./launcher ofagentapp -d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> |
| 496 | |
| 497 | - To **stop** OF-DPA and OpenFlow agent, run: |
| 498 | |
Zack Williams | 4d90076 | 2020-01-21 11:00:35 -0700 | [diff] [blame] | 499 | .. code-block:: console |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 500 | |
| 501 | # killall ofagentapp |
| 502 | |
| 503 | Launch in listen mode with launcher |
| 504 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 505 | |
| 506 | An optional ``-l`` parameter can be added for switch to listen on specific |
| 507 | **IP:port**. |
| 508 | |
| 509 | This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and |
| 510 | control the switch. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 511 | |
| 512 | .. code-block:: console |
| 513 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 514 | # ./launcher ofagentapp <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port> |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 515 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 516 | Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to |
| 517 | access switches in listen mode. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 518 | |
| 519 | |
| 520 | Vendor Specific Information |
| 521 | =========================== |
| 522 | |
| 523 | |
| 524 | Edgecore |
| 525 | -------- |
| 526 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 527 | - **OF-DPA Image** |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 528 | |
| 529 | - `EdgeCore 5712-54X / 5812-54X / 6712-32X / 7712-32X |
| 530 | <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa_3.0.5.5%2Baccton1.7-1_amd64.deb>`_ |
| 531 | **Checksum**: *sha256:db228b6e79fb15f77497b59689235606b60abc157e72fc3356071bcc8dc4c01f* |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 532 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 533 | - **Start OF-DPA and OpenFlow agent** |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 534 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 535 | - Please refer to `Use ofagentd service`_ |
| 536 | |
| 537 | - **Configure Port Speed and Breakout** |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 538 | |
| 539 | - By default all the switch ports are running at maximum speed. The port |
| 540 | speed can be modified in **/etc/accton/ofdpa.conf** |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 541 | |
| 542 | .. code-block:: text |
| 543 | |
| 544 | port_speed_1=1000 # configure front port 1 to run at 1G |
| 545 | |
| 546 | - We can also configure the same file to use break out cables on certain ports. |
| 547 | |
| 548 | .. code-block:: text |
| 549 | |
| 550 | port_mode_1=4x10g # configure front port 1 to break out from 40G to 4x10G |
| 551 | |
| 552 | OF-DPA service needs to be restarted after modifying this configuration. |
| 553 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 554 | QCT |
| 555 | --- |
| 556 | |
| 557 | - OF-DPA Image |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 558 | |
| 559 | - `QuantaMesh T3048-LY8 |
| 560 | <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ag7648_0.3.0.5.6_amd64.deb>`_ |
| 561 | **Checksum**: *sha256:f8201530b1452145c1a0956ea1d3c0402c3568d090553d0d7b3c91a79137da9e* |
| 562 | |
| 563 | - `QuantaMesh T7032-IX1 / IX1B |
| 564 | <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ix1_0.3.0.5.0-EA5-qct-01.00_amd64.deb>`_ |
| 565 | **Checksum**: *sha256:278b8ffed8a8fc705a1b60d16f8e70377e78342a27a11568a1d80b1efd706a46* |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 566 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 567 | - **Start OF-DPA and OpenFlow agent** |
| 568 | - Please refer to `Use launcher app`_ |
| 569 | |
| 570 | - Configure Port Speed and Breakout |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 571 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 572 | The command ``client_drivshell`` can be used to configure the port speed. |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 573 | |
| 574 | Use the parameter ``ps`` to list all ports or ``ps <port number>`` to list |
| 575 | one specific port. |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 576 | |
| 577 | .. code-block:: console |
| 578 | |
| 579 | # client_drivshell ps 1 |
| 580 | Calling ofdpaBcmCommand rpc with command = "ps 1 ". |
| 581 | ena/ speed/ link auto STP lrn inter max loop |
| 582 | port link duplex scan neg? state pause discrd ops face frame back |
| 583 | xe0( 1) down 10G FD SW No Forward Untag F SFI 9412 |
| 584 | |
| 585 | Returned from ofdpaBcmCommand rpc with rc = 0. |
| 586 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 587 | Then use the parameter ``port <port number> sp=<port speed>`` to change the |
| 588 | port speed. |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 589 | |
| 590 | .. code-block:: console |
| 591 | |
| 592 | # client_drivshell port xe0 sp=1000 |
| 593 | Calling ofdpaBcmCommand rpc with command = "port xe0 sp=1000 ". |
| 594 | |
| 595 | Returned from ofdpaBcmCommand rpc with rc = 0. |
| 596 | |
| 597 | # client_drivshell ps 1 |
| 598 | Calling ofdpaBcmCommand rpc with command = "ps 1 ". |
| 599 | ena/ speed/ link auto STP lrn inter max loop |
| 600 | port link duplex scan neg? state pause discrd ops face frame back |
| 601 | xe0( 1) down 1G FD SW No Forward Untag F GMII 9412 |
| 602 | |
| 603 | Returned from ofdpaBcmCommand rpc with rc = 0. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 604 | |
| 605 | Delta |
| 606 | ----- |
| 607 | |
| 608 | - OF-DPA Image |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 609 | |
| 610 | - `Delta AG7648 |
| 611 | <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ly8_0.3.0.5.0-EA5-qct-01.01_amd64.deb>`_ |
| 612 | **Checksum**: *sha256:ddfc13cb98ca47291dce5e6938b1d65f0b99bbe77f0585e36ac0007017397f23* |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 613 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 614 | - **Start OF-DPA and OpenFlow agent** |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 615 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 616 | - Please refer to `Use launcher app`_ |
| 617 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 618 | - Special instructions to install ONL |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 619 | |
| 620 | Make sure ``/etc/machine.conf`` looks like the following in ONIE before |
| 621 | running ONL installation script: |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 622 | |
| 623 | .. code-block:: text |
| 624 | |
| 625 | onie_platform=x86_64-delta_<platform name>-r0 |
| 626 | onie_machine=delta_<platform name> |
| 627 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 628 | After the installation of ONL, if you don't see '/usr/bin' in your PATH |
| 629 | variable, please run the following command: |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 630 | |
| 631 | .. code-block:: console |
| 632 | |
| 633 | # export PATH=$PATH:/usr/bin |
| 634 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 635 | |
| 636 | Useful Information |
| 637 | ================== |
| 638 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 639 | OF-DPA Commands |
| 640 | --------------- |
| 641 | There are some useful OF-DPA commands under ``/usr/bin/`` |
| 642 | |
| 643 | .. code-block:: text |
| 644 | |
| 645 | client_cfg_purge |
| 646 | client_debugcomp |
| 647 | client_drivshell |
| 648 | client_flowtable_dump |
| 649 | client_meter_dump |
| 650 | client_port_table_dump |
| 651 | client_tunnel_dump |
| 652 | client_classcolortable_dump |
| 653 | client_debuglvl |
| 654 | client_event |
| 655 | client_grouptable_dump |
| 656 | client_oam_dump |
| 657 | client_queue_config |
| 658 | |
| 659 | |
| 660 | ONL Boot Mode |
| 661 | ------------- |
| 662 | OFDPA offers two boot mode: **INSTALLED** and **SWI**. |
| 663 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 664 | - In **INSTALLED** mode, ONL mounts the root filesystem from ``/dev/sdb7`` |
| 665 | which is a flash drive that persists everything even during a power cycle. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 666 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 667 | - In **SWI** mode, ONL will load the root filesystem from a read-only image |
| 668 | (``*.swi``) and put the modified files in an copy-on-write overlay filesystem. |
| 669 | |
| 670 | The change will not be persisted during a power cycle. |
| 671 | |
| 672 | The pros and cons are obvious. INSTALLED mode is more convenient while SWI |
| 673 | mode is more error-safe. |
| 674 | |
| 675 | The boot mode will be determined by which image we used install ONL. We use the |
| 676 | **INSTALLED** mode in this instruction for simplicity. But we can still change |
| 677 | it after the installation. Here's the instruction: |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 678 | |
| 679 | .. code-block:: console |
| 680 | |
| 681 | # mount /mnt/onl/boot -o remount,rw |
| 682 | # sed -i 's/BOOTMODE=INSTALLED/BOOTMODE=SWI/g' /mnt/onl/boot/boot-config |
| 683 | # reboot |
| 684 | |
| 685 | |
| 686 | Persistence Mechanism |
| 687 | --------------------- |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 688 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 689 | INSTALLED mode already persists everything for you. This section is mainly for |
| 690 | SWI mode. |
| 691 | |
| 692 | The mechanism to persist files on the switch is different from ONL 1.x to ONL |
| 693 | 2.x. Following are the steps required to persist a file (e.g. OFDPA package) |
| 694 | in ONL 2.x. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 695 | |
| 696 | - Files put in **/mnt/onl/data** will be persisted automatically. |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 697 | |
| 698 | - To install a deb package during start-up, put the deb file under |
| 699 | **/mnt/onl/data/install-debs** folder and create a plain text file |
| 700 | **/mnt/onl/data/install-debs/list** with all the filename of the deb (e.g. |
| 701 | ``ofdpa_3.0.5.5+accton1.7-1_amd64.deb``) |
| 702 | |
| 703 | - To execute some command during start-up, put the command in |
| 704 | **/mnt/onl/data/rc.boot** |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 705 | |
| 706 | .. code-block:: bash |
| 707 | |
| 708 | # set static ip and route (dhcp by default) |
| 709 | echo 'ip addr add 10.128.0.203/16 dev ma1' >> /mnt/onl/data/rc.boot |
| 710 | echo 'ip route add default via 10.128.0.1' >> /mnt/onl/data/rc.boot |
| 711 | # grant executable permission |
| 712 | chmod a+x /mnt/onl/data/rc.boot |
| 713 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 714 | See `PersistWorkflow.md |
| 715 | <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/PersistWorkflow.md>`_ |
| 716 | for more detail. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 717 | |
| 718 | |
| 719 | Build a Customized ONL Image |
| 720 | ---------------------------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 721 | |
| 722 | Sometimes we need to build our own ONL image from source to include some extra |
| 723 | files. (The most common case is a modified /etc/network/interfaces). |
| 724 | |
| 725 | The instruction of build process has already been well-documented in ONL repo |
| 726 | `Building.md |
| 727 | <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/Building.md>`_. |
| 728 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 729 | But you might find it a little bit tricky to inject some extra files. |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 730 | |
| 731 | To do that, you need to put the files under |
| 732 | **$ONL_ROOT/builds/any/rootfs/jessie/common/overlay/** and then run the make |
| 733 | command again. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 734 | |
| 735 | |
| 736 | Recovery from a Faulty ONL Install |
| 737 | ---------------------------------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 738 | If, for some reason, the ONL install process fails, you may be brought to the |
| 739 | grub rescue prompt upon reboot. |
| 740 | |
| 741 | You may or may not find system files, or even basic grub rescue commands (i.e. |
| 742 | 'help'). |
| 743 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 744 | There are two options for returning to a (known working) ONIE prompt. |
| 745 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 746 | 1. **Reinstaller** - You should be able to acquire an ISO image for resetting |
| 747 | the firmware to factory default from your switch vendor. Once you have the |
| 748 | ISO, you can either use PXE or a live USB to boot the switch into the image. |
| 749 | |
| 750 | 2. **Manually boot to ONIE** - If the files are there, you can manually |
| 751 | configure GRUB to load the necessary modules to boot back into ONIE. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 752 | |
| 753 | .. code-block:: console |
| 754 | |
| 755 | # This should be the partition on the ONIE partition on the AS6712. |
| 756 | # It might be hd1 or hd0. Change appropriately. |
| 757 | grub rescue> ls (hd0,gpt2)/ |
| 758 | ./ ../ lost+found/ onie/ grub/ grubenv |
| 759 | |
| 760 | # These instructions will load the kernel and ONIE initrd. |
| 761 | grub rescue> set prefix=(hd0,gpt2)/grub |
| 762 | grub rescue> set root=(hd0,gpt2) |
| 763 | grub rescue> insmod normal |
| 764 | grub rescue> insmod linux |
| 765 | grub rescue> ls /onie |
| 766 | ./ ../ vmlinuz-3.2.35-onie initrd.img-3.2.35-onie tools/ grub/ grub.d/ config/ |
| 767 | |
| 768 | # if the ",115200n8" is omitted, baud rate defaults to 9600. |
| 769 | grub rescue> linux /onie/vmlinuz-3.2.35-onie console=tty0 console=ttyS1,115200n8 |
| 770 | grub rescue> initrd /onie/initrd.img-3.2.35-onie |
| 771 | |
| 772 | # The system will not boot into ONIE and you can recover or re-install from there. |
| 773 | grub rescue> boot |
| 774 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 775 | Once back at the ONIE prompt, you can try to install ONL by following the same |
| 776 | steps again. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 777 | |
| 778 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 779 | Connect to Switch in Listen Mode |
| 780 | -------------------------------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 781 | |
| 782 | To connect to the switch in Listen Mode using **ovs-ofctl**, you can use |
| 783 | commands such as: |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 784 | |
| 785 | .. code-block:: console |
| 786 | |
| 787 | $ ovs-ofctl -O OpenFlow13 show tcp:<ip>:<port> |
| 788 | $ ovs-ofctl -O OpenFlow13 dump-flows tcp:<ip>:<port> |
| 789 | $ ovs-ofctl -O OpenFlow13 dump-groups tcp:<ip>:<port> |
| 790 | $ ovs-ofctl -O OpenFlow13 add-flow tcp:<ip>:<port> table=60,priority=40000,eth_type=0x0800,ip_dst=55.55.55.55,actions=controller |
| 791 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 792 | For more command, please see ``ovs-ofctl --help`` or the post `OpenvSwitch |
| 793 | ovs-ofctl and OF-DPA |
| 794 | <https://blog.pichuang.com.tw/20170106-ovs-ofctl-and-ofdpa/>`_. |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 795 | |
| 796 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 797 | Reference |
| 798 | --------- |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 799 | |
| 800 | - `ONL/OF-DPA installation guide by Edgecore Networks |
| 801 | <https://www.youtube.com/watch?v=mCUtkIc_hVI>`_ |
| 802 | |
| 803 | - `ONL/OF-DPA cheat sheet by Phil Huang |
| 804 | <https://blog.pichuang.com.tw/20170104-ofdpa-with-onl-cheat-sheet/>`_ |