Merge "Add template unit test for schemas/hardwarevtep"
[netvirt.git] / README
1 DIRECTORY ORGANIZATION
2 ======================
3
4 - commons
5   +-- parent : Contains Parent pom.xml for all the ovsdb modules.
6   +-- integrationtest : Contains the parent pom.xml for all the integrationtest needs.
7
8 - distribution : Builds a working controller distribution based on the controller + ovsdb modules and other
9                  dependant modules such as openflowplugin
10   +-- opendaylight : older, OSGi-based distribution
11   +-- opendaylight-karaf : karaf-based distribution
12
13 - features : This folder contains all the Karaf related files.
14
15 - integrationtest : Contains all the PAX-Exam based integrationTests that covers IT for all the modules.
16
17 - library : Contains Schema-independent library that is a reference implementation for RFC 7047.
18             This module doesn't depend on any of the Opendaylight components.
19             This library module can also be used independently in a non-OSGi environment.
20
21 - northbound : Provides AD-SAL style Northbound REST APIs.
22                Supports the legacy v2 APIs to provide backward compatibility for Hydrogen Release
23                Also supports the newer v3 APIs to provide schema-independent access to the OVSDB protocol.
24
25 - of-extension : Adds OpenFlow Nicera extensions.
26
27 - openstack
28   +-- net-virt : Handles the Openstack Neutron ML2 and Network Service calls and performs all the logic required
29                  for Network Virtualization.
30   +-- net-virt-providers : Mostly contains data-path programming functionality via OpenFlow or potentially
31                            other protocols.
32
33 - ovs-sfc : SFC implementation using the OVSDB project. Currently it is just a shell.
34
35 - plugin : Contains Opendaylight Southbound Plugin APIs and provides a simpler API interface on top of library layer.
36            Ideally, this module should also be schema independent. But due to legacy reasons this layer contains some
37            deprecated functionality that assumes openvswitch schema.
38
39 - plugin-mdsal-adapter : Adds an MD-SAL Adapter for the OVSDB Plugin. The adapter updates the MD-SAL with nodes
40                          as they are added and removed from the inventory. The Yang model provides a reference
41                          between OVSDB nodes and the OpenFlow nodes (bridges) that they manage.
42
43 - plugin-shell : Contains a Karaf shell framework for OVSDB plugin and printCache command-line.
44
45 - resources : Contains some useful resources such as scripts, testing utilities and tools used for deployment
46               or testing the binaries generated from the OVSDB project.
47
48 - schemas :
49   +-- openvswitch : Schema wrapper that represents http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf
50   +-- hardwarevtep: Schema wrapper that represents http://openvswitch.org/docs/vtep.5.pdf
51
52 - utils : MD-SAL OpenFlow and OVSDB common utilities.
53
54 HOW TO BUILD & RUN
55 ==================
56
57 Pre-requisites : JDK 1.7+, Maven 3+
58
59 1. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
60    1. This is a new method for Opendaylight distribution wherein there is no defined editions such
61       as Base, Virtualization or SP editions. The end-customer can choose to deploy the required feature
62       based on his/her deployment needs.
63
64    2. From the root ovsdb/ directory, execute "mvn clean install"
65
66    3. Next unzip the distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip file created from step #2 in
67       the directory ovsdb/distribution/opendaylight-karaf/target like so:
68       "unzip distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip"
69
70    4. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
71       is to start the OVSDB plugin framework with the following command in the karaf console:
72       "feature:install odl-ovsdb-openstack odl-ovsdb-northbound" (without quotation marks).
73
74    Sample output from Karaf console :
75
76    opendaylight-user@root>feature:list | grep -i ovsdb
77    odl-ovsdb-all                    | 1.0.0-SNAPSHOT      |           | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: all
78    odl-ovsdb-library                | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Library
79    odl-ovsdb-schema-openvswitch     | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: Open_vSwitch
80    odl-ovsdb-schema-hardwarevtep    | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: hardware_vtep
81    odl-ovsdb-plugin                 | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: Plugin
82    odl-ovsdb-northbound             | 0.6.0-SNAPSHOT      |           | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: Northbound
83    odl-ovsdb-openstack              | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: OpenStack Network Virtual
84    odl-ovsdb-ovssfc                 | 0.0.1-SNAPSHOT      |           | ovsdb-0.0.1-SNAPSHOT                  | OpenDaylight :: OVSDB :: OVS Service Function Chai
85    odl-openflow-nxm-extensions      | 0.0.3-SNAPSHOT      | x         | ovsdb-0.0.3-SNAPSHOT                  | OpenDaylight :: Openflow :: Nicira Extensions
86
87
88 2. Building a bundle and deploying it in an Opendaylight Karaf distribution :
89    This method can be used to update and test new code in a bundle. If the bundle of interest is rebuilt as a
90    snapshot with the same version as what it already defined in a feature repo then that new bundle will be used
91    when the feature is loaded in karaf. If karaf is already running with the feature loaded then follow the steps
92    below to load the new bundle:
93
94    1. Find the bundle id of the bundle you are going to rebuild:
95       - bundle:list -s | grep <bundlename>, i.e. bundle:list -s | grep odl-ovsdb-plugin
96
97    2. Instruct karaf to watch the new bundle and reload it if it changes:
98       - bundle:watch <id>
99       - The id is the value returned in 1 above.
100       - You can also watch the bundle URL itself:
101         - bundle:watch mvn:org.opendaylight.ovsdb/plugin/1.0.2-SNAPSHOT
102
103    3. Rebuild bundle.
104       - cd bundle dir, i.e. cd ovsdb/plugin
105       - mvn clean install. This will install the new bundle into the local mvn repo.
106
107    4. karaf will see the changed bundle and reload it.
108
109
110 3. Building an OVSDB based Opendaylight Virtualization edition:
111    1. This is the legacy way to build and distribute Opendaylight archives. This method was
112       followed in Hydrogen. It might still work in Helium but it is best effort for support.
113       The preferred method for Helium and later is to use karaf.
114
115    2. From the root folder(that hosts this README), execute "mvn clean install"
116       That should build a full distribution archive and distribution directory that will contain
117       Opendaylight Controller + OVSDB bundles + Openflow Plugins under
118       distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage
119
120    3. Upon successful completion of a build, the Controller with OVSDB can be executed by :
121       cd distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage/opendaylight/
122       ./run.sh -virt ovsdb
123
124 4. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
125 *** This method is deprecated.
126    1. This is a new method for Opendaylight distribution wherein there is no defined editions such
127       as Base, Virtualization or SP editions. Rather each of the projects will generate features in
128       form of .kar files. The end-customer can choose to deploy the required feature based on his/her
129       deployment needs.
130
131    2. From the features/ directory, execute "mvn clean install"
132       This will generate a kar file such as "features/target/ovsdb-features-1.2.0-SNAPSHOT.kar"
133
134    3. Download (or build from controller project) the Karaf distribution :
135       http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/
136       Sample zip file :
137       http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/1.4.2-SNAPSHOT/distribution.opendaylight-karaf-1.4.2-20140718.075612-407.zip
138
139    4. unzip the downloaded (or built) distribution and copy the ovsdb-features-x.x.x.kar file (from step 2) into
140       the unzipped distribution.opendaylight-karaf-X.X.X/deploy/ directory.
141
142    5. run Karaf from within the distribution.opendaylight-karaf-X.X.X/ directory using "bin/karaf"
143
144    Sample output from Karaf console :
145
146    opendaylight-user@root>kar:list
147    KAR Name
148    -----------------------------
149    ovsdb-features-1.2.0-SNAPSHOT
150
151    opendaylight-user@root>feature:list | grep ovsdb
152    odl-ovsdb-all | 1.2.0-SNAPSHOT | x | ovsdb-1.2.0-SNAPSHOT | OpenDaylight :: OVSDB :: all
153    odl-ovsdb-library | 1.0.0-SNAPSHOT | x | ovsdb-1.2.0-SNAPSHOT | OVSDB :: Library
154    odl-ovsdb-schema-openvswitch | 1.0.0-SNAPSHOT | x | ovsdb-1.2.0-SNAPSHOT | OVSDB :: Schema :: Open_vSwitch
155    odl-ovsdb-schema-hardwarevtep | 1.0.0-SNAPSHOT | x | ovsdb-1.2.0-SNAPSHOT | OVSDB :: Schema :: hardware_vtep
156    odl-ovsdb-plugin | 1.0.0-SNAPSHOT | x | ovsdb-1.2.0-SNAPSHOT | OpenDaylight :: OVSDB :: Plugin
157
158    opendaylight-user@root>bundle:list | grep OVSDB
159    186 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Library
160    199 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Open_vSwitch Schema
161    200 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB hardware_vtep Schema
162    201 | Active | 80 | 1.0.0.SNAPSHOT | OpenDaylight OVSDB Plugin
163
164 Running The Integration Tests
165 =============================
166
167 To run the integration tests locally the following components are required:
168
169  - Docker
170  - Fig
171
172 To install docker, follow the installation guide for your platform:
173    http://docs.docker.com/installation/
174
175 To install fig:
176    http://www.fig.sh/install.html
177
178 To run the integration tests:
179
180     mvn clean install
181     fig start
182     # OSX
183     mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=$(boot2docker ip 2>/dev/null) -Dovsdbserver.port=6640
184     # Linux
185     mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=127.0.0.1 -Dovsdbserver.port=6640
186     fig stop
187
188 Skipping unit tests and karaf tests
189 ====================
190
191 mvn clean install -Dmaven.test.skip=true -Dskip.karaf=true