datapath-windows: Rename switch context's portHashArray and vport's portLink
[cascardo/ovs.git] / INSTALL.RHEL
1        How to Install Open vSwitch on Red Hat Enterprise Linux
2        =======================================================
3
4 This document describes how to build and install Open vSwitch on a Red
5 Hat Enterprise Linux (RHEL) host.  If you want to install Open vSwitch
6 on a generic Linux host, see INSTALL instead.
7
8 We have tested these instructions with RHEL 5.6 and RHEL 6.0.
9
10 Building Open vSwitch for RHEL
11 ------------------------------
12
13 You may build from an Open vSwitch distribution tarball or from an
14 Open vSwitch Git tree.
15
16 The default RPM build directory (_topdir) has five directories in
17 the top-level:
18 1. BUILD/ Where the software is unpacked and built.
19 2. RPMS/ Where the newly created binary package files are written.
20 3. SOURCES/ Contains the original sources, patches, and icon files.
21 4. SPECS/ Contains the spec files for each package to be built.
22 5. SRPMS/ Where the newly created source package files are written.
23
24 Before you begin, note the RPM sources directory on your version of
25 RHEL.  The command "rpmbuild --showrc" will show the configuration
26 for each of those directories. Alternatively, the command "rpm --eval
27  '%{_topdir}'" shows the current configuration for the top level
28 directory and the command "rpm --eval '%{_sourcedir}'" does the same
29 for the sources directory. On RHEL 5, the default RPM _topdir is
30 /usr/src/redhat and the default RPM sources directory is
31 /usr/src/redhat/SOURCES. On RHEL 6, the default _topdir is
32 $HOME/rpmbuild and the default RPM sources directory is
33 $HOME/rpmbuild/SOURCES.
34
35 1. Install build prerequisites:
36
37    yum install gcc make python-devel openssl-devel kernel-devel graphviz \
38        kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
39        libtool
40
41 2. If you are building from a distribution tarball, skip to step 3.
42    Otherwise, you must be building from an Open vSwitch Git tree.
43    Determine what version of Autoconf is installed (e.g. run "autoconf
44    --version").  If it is not at least version 2.63, then you have two
45    choices:
46
47      a. Install Autoconf 2.63 or later, one way or another.
48
49      b. Create a distribution tarball on some other machine, by
50         running "./boot.sh; ./configure; make dist" in the Git tree.
51         You must run this on a machine that has the tools listed in
52         INSTALL as prerequisites for building from a Git tree.
53         Afterward, proceed with the rest of the instructions using the
54         distribution tarball.
55
56 3. Some versions of the RHEL 6 kernel-devel package contain a broken
57    "build" symlink.  If you are using such a version, you must fix
58    the problem before continuing.
59
60    To find out whether you are affected, run:
61
62        cd /lib/modules/<version>
63        ls -l build/
64
65    where <version> is the version number of the RHEL 6 kernel.  (The
66    trailing slash in the final command is important.  Be sure to include
67    it.)  If the "ls" command produces a directory listing, your
68    kernel-devel package is OK.  If it produces a "No such file or
69    directory" error, your kernel-devel package is buggy.
70
71    If your kernel-devel package is buggy, then you can fix it with:
72
73        cd /lib/modules/<version>
74        rm build
75        ln -s /usr/src/kernels/<target> build
76
77    where <target> is the name of an existing directory under
78    /usr/src/kernels, whose name should be similar to <version> but may
79    contain some extra parts.  Once you have done this, verify the fix with
80    the same procedure you used above to check for the problem.
81
82 4. If you are building from a distribution tarball, skip to step 5.
83    Otherwise, create a distribution tarball from the root of the Git
84    tree by running:
85
86        ./boot.sh
87        ./configure
88        make dist
89
90 5. Now you have a distribution tarball, named something like
91    openvswitch-x.y.z.tar.gz.  Copy this file into the RPM sources
92    directory, e.g.:
93
94        cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES
95
96 6. Make another copy of the distribution tarball in a temporary
97    directory.  Then unpack the tarball and "cd" into its root, e.g.:
98
99        tar xzf openvswitch-x.y.z.tar.gz
100        cd openvswitch-x.y.z
101
102 7. To build Open vSwitch userspace, run:
103
104        rpmbuild -bb rhel/openvswitch.spec
105
106    This produces two RPMs: "openvswitch" and "openvswitch-debuginfo".
107
108    The above command automatically runs the Open vSwitch unit tests.
109    To disable the unit tests, run:
110
111        rpmbuild -bb --without check rhel/openvswitch.spec
112
113    If the build fails with "configure: error: source dir
114    /lib/modules/2.6.32-279.el6.x86_64/build doesn't exist" or similar,
115    then the kernel-devel package is missing or buggy.  Go back to step
116    1 or 2 and fix the problem.
117
118 8. On RHEL 6, to build the Open vSwitch kernel module, copy
119    rhel/openvswitch-kmod.files into the RPM sources directory and run:
120
121         rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec
122
123    You might have to specify a kernel version and/or variants, e.g.:
124
125         rpmbuild -bb \
126                 -D "kversion 2.6.32-131.6.1.el6.x86_64" \
127                 -D "kflavors default debug kdump" \
128                 rhel/openvswitch-kmod-rhel6.spec
129
130    This produces an "kmod-openvswitch" RPM for each kernel variant, in
131    this example: "kmod-openvswitch", "kmod-openvswitch-debug", and
132    "kmod-openvswitch-kdump".
133
134 A RHEL host has default firewall rules that prevent any Open vSwitch tunnel
135 traffic from passing through. If a user configures Open vSwitch tunnels like
136 Geneve, GRE, VXLAN, LISP etc., they will either have to manually add iptables
137 firewall rules to allow the tunnel traffic or add it through a startup script
138 (Please refer to the "enable-protocol" command in the ovs-ctl(8) manpage).
139
140 Red Hat Network Scripts Integration
141 -----------------------------------
142
143 Simple integration with Red Hat network scripts has been implemented.
144 Please read rhel/README.RHEL in the source tree or
145 /usr/share/doc/openvswitch/README.RHEL in the installed openvswitch
146 package for details.
147
148 Reporting Bugs
149 --------------
150
151 Please report problems to bugs@openvswitch.org.