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