basic operations guide luis gomez, principal sw test engineer, brocade #odsummit
Post on 25-Dec-2015
220 Views
Preview:
TRANSCRIPT
Basic Operations GuideLuis Gomez, Principal SW Test Engineer, Brocade
#ODSummit
Agenda
• Introduction• Installation Requirements• Download and start Controller• Install Features• Graphical Interface• REST Interface and tools• Troubleshooting
#ODSummit
Introduction
#ODSummit
OpenDaylight Project
• The OpenDaylight project is a collaborative open source project that aims to accelerate adoption of Software-Defined Networking (SDN) and Network Functions Virtualization (NFV) with a transparent approach that fosters new innovation.
• Main page: http://www.opendaylight.org• Wiki page: https://wiki.opendaylight.org/
Base Network Functions
OpenFlow Enabled Devices
DLUX VTN Coordinator
OpenStack Neutron
SDNI Wrapper
Network Applications Orchestrations & Services
Open vSwitches Additional Virtual & Physical Devices
Controller Platform Services/Applications
L2 Switch
OVSDB NETCONF PCMM/COPS
SNBILISP BGP PCEP SNMPSXP Southbound Interfaces & Protocol Plugins
OpenFlow
Topology Processing
USCCAPWAP OPFLEX CoAPHTTP
Stats Manager
Switch Manager
Forwarding Rules Mgr
Host Tracker
AAA AuthN Filter
OpenDaylight APIs REST/RESTCONF/NETCONF
Service Abstraction Layer/CoreData Store (Config & Operational) Messaging (Notifications / RPCs)
LACP
Network ServicesService Function Chaining
Reservation
Virtual Private Network
Virtual Tenant Network Mgr.
Unified Secure Channel Mgr
Network Services (cont)OVSDB Neutron
Device Discovery, Identification & Driver Management
LISP Service
DOCSIS Abstraction
SNMP4SDN
Network Abstractions (Policy/Intent)
ALTO Protocol Manager
Network Intent Composition
Group Based Policy Service
Platform ServicesAuthentication, Authorization &
Accounting
Neutron Northbound
Persistence
SDN Integration Aggregator
Time Series Data RepositoryLink Aggregation Ctl Protocol
OpenDaylight Controller (Lithium)
Installation Requirements
#ODSummit
Installation Requirements
#ODSummit
Requirement Minimum Personal Use Recommended
CPU 2 Cores 4 Cores 8 Cores
RAM 2 GB 4 GB 8 GB
Storage 16 GB 32 GB 64 GB
• System:
• Software:• OS installation: Linux, Mac, Windows• Java Virtual Machine 1.7 or 1.8
Lab 1: Install tools-vm
#ODSummit
Lab 1 – Install tools-vm
• Plug USB stick in your laptop• Install VirtualBox-5.0.0• Import VM image: tools-vm-ubuntu.ova• Check VM specs (2 Cores/4 GB RAM) fit in your system• Start VM (user:vagrant/pwd:vagrant)
#ODSummit
Download and Start Controller
#ODSummit
Download Controller
• Released versions and official documentation available in main web:• http://www.opendaylight.org/software/downloads
• Latest versions available in Nexus:• https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/
integration/distribution-karaf/• Helium (stable): 0.2.X-SNAPSHOT• Lithium (stable): 0.3.X-SNAPSHOT• Beryllium (master): 0.4.X-SNAPSHOT
• Latest documentation available in wiki:• https://wiki.opendaylight.org/view/Main_Page
#ODSummit
Start Controller
• Controller distribution comes as a pre-built zip or tar.gz file:• Use unzip <file> to extract the zip file.• Use tar –zxf <file> to extract the tar.gz file.
• Controller uses Karaf (http://karaf.apache.org ) runtime:• cd <distribution-folder>• bin/karaf -> starts controller with karaf console• bin/start -> starts controller in the background• bin/stop -> stops controller• bin/client -u karaf -> enter karaf console when controller is running
#ODSummit
Lab 2: Start Controller
#ODSummit
Lab 2 – Start Controller
• Open a terminal window:• Click on the black terminal icon on the left quick launch menu
• Copy the karaf distribution to user folder:• cp controller-lithium/distribution-karaf-0.3.0-Lithium.zip ~
• Extract the distribution:• unzip distribution-karaf-0.3.0-Lithium.zip
• Start the controller:• cd distribution-karaf-0.3.0-Lithium• bin/karaf
#ODSummit
Install Features
#ODSummit
Install Features
• Controller comes with NO features installed.• Features can be installed from karaf console:
• feature:list (-i) -> lists all (only installed) features in the controller• feature:info <feature> -> gets feature information• feature:install <feature> -> installs a feature• bundle:list –s -> lists loaded software bundles
• You can also specify startup features in a cfg file before starting the controller:• Open the file: <distribution-folder>/etc/org.apache.karaf.features.cfg• Add you features to this line: featuresBoot=config,standard,region,package,kar,ssh,management
• You only need to install a feature once, after it will be automatically installed every time controller starts.
#ODSummit
Feature Install FAQs
• How do I know which features to install?• Read project user-guide documentation to know about features to install.
• Can I install features from different projects?• Yes, but before doing that read every individual project documentation.• Some features may not be compatible with others.
• Features can be added at any time but can I uninstall a feature?• Feature uninstall is NOT supported.• In case you want to clear all features in the controller:
• Stop controller
• Delete following folders in <distribution-folder>: data, journal, snapshots
• Start controller
#ODSummit
Feature startup configuration
• A feature may include one or more startup configuration files:• The files are stored in: <distribution-folder>/etc/opendaylight/karaf• The files are created the first time a feature is installed. • The configuration is applied at controller startup.
• In case you want to change the startup configuration:• Stop controller.• Edit config file in <distribution-folder>/etc/opendaylight/karaf• Start controller.
#ODSummit
Lab 3: Install l2swith feature
#ODSummit
Lab 3 – Install l2switch feature
• Check available and installed features in karaf console:• feature:list (-i)
• Search for l2switch features:• feature:list | grep l2switch
• Get information for an l2switch feature:• feature:info odl-l2switch-switch-ui
• Install l2switch main feature:• feature:install odl-l2switch-switch-ui
• Check the loaded software bundles:• bundle:list -s
#ODSummit
Graphical User Interface
#ODSummit
Graphical User Interface
• GUI opens at: http://localhost:8181/index.html (note it changed in Lithium!)• Features related to GUI:
• odl-dlux-core -> basic GUI including topology application• odl-dlux-node -> node inventory application• odl-dlux-yangui -> YangUI application to browse Yang RESTCONF interface• odl-dlux-yangvisualizer -> YangVisualizer application to browse yang models
• Most applications in OpenDaylight bring odl-dlux-core if started with -ui :• Example: feature:install odl-l2switch-switch-ui
• For more information about dlux applications check Lithium User Guides
#ODSummit
Lab 4: Graphical User Interface
#ODSummit
Lab 4 – GUI
• Open the controller GUI at http://localhost:8181/index.html • Default user/pasw is admin/admin.
• Install all dlux features from controller Karaf console:• feature:install odl-dlux-all
• Check new apps in the GUI.• Open a terminal window:
• Click on the terminal icon on the left menu or open a new tab on existing terminal window.
• Start mininet simulation and ping all hosts:• sudo mn --controller=remote,ip=127.0.0.1 --topo tree,2• mininet> pingall
• Check topology and nodes in GUI.
#ODSummit
#ODSummit
Lab 4 – GUI
REST Interface and Tools
#ODSummit
REST Interface
• The REST interface has direct access to the controller datastore:• URL: http://localhost:8181/restconf/*
• OpenDaylight applications expose configuration and state in the datastore:• /restconf/config/* -> this is where users create/read/update/delete (POST, GET, PUT, DELETE)
application configuration. NEW in Lithium: config area is persistent (i.e. survives after restart).• /restconf/operational/* -> this is where applications write state and users read it (GET).
• Most popular databases are topology and inventory:• GET http://localhost:8181/restconf/operational/network-topology:network-topology/• GET http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/
• Projects user-guide documentation includes information and examples of REST calls.
#ODSummit
REST Example: Flow programming
• Flows are normally programmed in the config datastore:• Use PUT http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/
table/0/flow/1 (flow configuration is in the REST request body) to add a flow.• Use GET http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/
table/0/ to check configured flows (switch 1, table 0).• Use DELETE http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/
openflow:1/table/0/flow/1 to delete flow 1.
• Flows are verified through OpenFlow statistics: Controller sends stats requests to the switches and updates operational datastore with received information.
• Use GET http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/ to check switch flows (switch 1, table 0).
• Flows can be also programmed via RPC, overpassing the config datastore.
#ODSummit
REST Tools
• YangUI application in controller GUI.• Allows to browse controller URLs and methods.
• Chrome POSTMAN extension.• Easy create and share REST collections.
• cURL command in Linux systems.• Easy write shell script.
• REST libraries are available for most programming languages.• IMPORTANT: In all tools set the following headers:
• Authorization (basic): admin/admin• Accept (answer body): application/xml or application/json• Content-Type (request body): application/xml or application/json
#ODSummit
Lab 5: REST Interface
#ODSummit
Lab 5 – YangUI
• Open the controller GUI at http://localhost:8181/index.html • Click on the YangUI application.• Select opendaylight-inventory>operational>nodes in the Yang tree.• At the bottom where it says Path select GET method.• Click on Send button and browse the answer.
#ODSummit
#ODSummit
Lab 5 – YangUI
Lab 5 – POSTMAN
• Open Chrome POSTMAN extension.• Click on the orange icon on the left quick launch menu.
• On the left select Collections and click on OpenFlow.• Select Get Topology and press Send button on the right.• Select Get Inventory and press Send button on the right.• Add/Get/Modify/Delete a Flow using POSTMAN• Check OpenFlow examples in POSTMAN
#ODSummit
#ODSummit
Lab 5 – POSTMAN
Lab 5 – cURL
• Open a terminal window:• Click on the terminal icon on the left menu or open a new tab on existing terminal window.
• cURL format:• curl --user <user>:<password> -H <header 1> -H <header-2> -X <requesttype> <url> -d '<request-
body>'
• Get the topology with cURL:• curl --user "admin":"admin" -H "Accept: application/xml" –H "Content-type: application/xml" -X
GET http://localhost:8181/restconf/operational/network-topology:network-topology/
#ODSummit
Troubleshooting
#ODSummit
Controller Log
• Controller log is in: <distribution-folder>/data/log/karaf.log• It can be also displayed on karaf console:
• log:display
• All applications in OpenDaylight write in the log, so it is normally very “chatty”.• For troubleshooting (e.g. l2switch):
• log:set ERROR -> sets default log level to ERROR.• log:set TRACE org.opendaylight.l2switch -> sets l2switch log level to TRACE.• bundle:list –s -> to check all modules that can be traced.
#ODSummit
Troubleshooting Tools
• Linux commands:• ps -ef | grep java -> to check if controller is running• netstat -pa | grep java -> to check which tcp ports controller is listening• top -> CPU and memory usage
• Karaf commands:• bundle:list -s | grep -v Active -> to list inactive bundles• web:list -> web state
• Packet capture:• wirehark/tshark• tcpdump
#ODSummit
Lab 6: Troubleshooting
#ODSummit
Lab 6 – Troubleshooting
• Open a terminal window and check controller process and open ports:• ps -ef | grep java• netstat -pa | grep java• top
• Go to karaf console and pull bundles, web status and log:• bundle:list -s | grep -v Active• web:list• log:display
• Open a terminal window and start wireshark:• wireshark &
#ODSummit
Thank You
#ODSummit
top related