13 .TH ovs\-ctl 8 "June 2011" "Open vSwitch" "Open vSwitch Manual"
17 ovs\-ctl \- OVS startup helper script
20 \fBovs\-ctl\fR \fB\-\-system\-id=random\fR|\fIuuid\fR
21 [\fIoptions\fR] \fBstart
34 \fB\-\-system\-id=random\fR|\fIuuid\fR
36 \fBforce\-reload\-kmod\fR
39 \fR[\fB\-\-protocol=\fIprotocol\fR]
40 [\fB\-\-sport=\fIsport\fR]
41 [\fB\-\-dport=\fIdport\fR]
42 \fBenable\-protocol\fR
44 \fBovs\-ctl help \fR| \fB\-h \fR| \fB\-\-help
46 \fBovs\-ctl \-\-version
51 The \fBovs\-ctl\fR program starts, stops, and checks the status of
52 Open vSwitch daemons. It is not meant to be invoked directly by
53 system administrators but to be called internally by system startup
57 Each of \fBovs\-ctl\fR's commands is described separately below.
59 .SH "The ``start'' command"
62 The \fBstart\fR command starts Open vSwitch. It performs the
66 Loads the Open vSwitch kernel module. If this fails, and the Linux
67 bridge module is loaded but no bridges exist, it tries to unload the
68 bridge module and tries loading the Open vSwitch kernel module again.
69 (This is because the Open vSwitch kernel module cannot coexist with
70 the Linux bridge module before 2.6.37.)
73 If \fB\-\-brcompat\fR was specified, loads the Open vSwitch bridge
77 The \fBstart\fR command skips the following steps if
78 \fBovsdb\-server\fR is already running:
80 If the Open vSwitch database file does not exist, it creates it.
81 If the database does exist, but it has an obsolete version, it
82 upgrades it to the latest schema.
85 Starts \fBovsdb-server\fR.
88 Initializes a few values inside the database.
91 If the \fB\-\-delete\-bridges\fR option was used, deletes all of the
92 bridges from the database.
95 The \fBstart\fR command skips the following step if
96 \fBovs\-vswitchd\fR is already running:
98 Starts \fBovs\-vswitchd\fR.
101 The \fBstart\fR command skips the following step if
102 \fBovs\-brcompatd\fR is already running or if \fB\-\-brcompat\fR is
105 Starts \fBovs\-brcompatd\fR.
109 Several command-line options influence the \fBstart\fR command's
110 behavior. Some form of the following option should ordinarily be
113 .IP "\fB\-\-system\-id=\fIuuid\fR"
114 .IQ "\fB\-\-system\-id=random\fR"
115 This specifies a unique system identifier to store into
116 \fBexternal-ids:system-id\fR in the database's \fBOpen_vSwitch\fR
117 table. Remote managers that talk to the Open vSwitch database server
118 over network protocols use this value to identify and distinguish Open
119 vSwitch instances, so it should be unique (at least) within OVS
120 instances that will connect to a single controller.
122 When \fBrandom\fR is specified, \fBovs\-ctl\fR will generate a random
123 ID that persists from one run to another (stored in a file). When
124 another string is specified \fBovs\-ctl\fR uses it literally.
127 The following options should be specified if the defaults are not
130 .IP "\fB\-\-system\-type=\fItype\fR"
131 .IQ "\fB\-\-system\-version=\fIversion\fR"
132 Sets the value to store in the \fBsystem-type\fR and
133 \fBsystem-version\fR columns, respectively, in the database's
134 \fBOpen_vSwitch\fR table. Remote managers may use these values to
135 determine the kind of system to which they are connected (primarily
136 for display to human administrators).
138 When not specified, \fBovs\-ctl\fR uses values from the optional
139 \fBsystem\-type.conf\fR and \fBsystem\-version.conf\fR files(see section
140 \fBFILES\fR) or it uses the \fBlsb_release\fR program, if present, to
141 provide reasonable defaults.
144 The following options are also likely to be useful:
146 .IP "\fB\-\-external\-id=\(dq\fIname\fB=\fIvalue\fB\(dq"
147 Sets \fBexternal-ids:\fIname\fR to \fIvalue\fR in the database's
148 \fBOpen_vSwitch\fR table. Specifying this option multiple times adds
149 multiple key-value pairs.
151 .IP "\fB\-\-delete\-bridges\fR"
152 Ordinarily Open vSwitch bridges persist from one system boot to the
153 next, as long as the database is preserved. Some environments instead
154 expect to re-create all of the bridges and other configuration state
155 on every boot. This option supports that, by deleting all Open
156 vSwitch bridges after starting \fBovsdb\-server\fR but before starting
160 The following options are less important:
162 .IP "\fB\-\-daemon-cwd=\fIdirectory\fR"
163 Specifies the current working directory that the OVS daemons should
164 run from. The default is \fB/\fR (the root directory) if this option
165 is not specified. (This option is useful because most systems create
166 core files in a process's current working directory and because a file
167 system that is in use as a process's current working directory cannot
170 .IP "\fB\-\-no\-force\-corefiles\fR"
171 By default, \fBovs\-ctl\fR enables core dumps for the OVS daemons.
172 This option disables that behavior.
174 .IP "\fB\-\-no\-mlockall\fR"
175 By default \fBovs\-ctl\fR passes \fB\-\-mlockall\fR to
176 \fBovs\-vswitchd\fR, requesting that it lock all of its virtual
177 memory, preventing it from being paged to disk. This option
178 suppresses that behavior.
180 .IP "\fB\-\-ovsdb\-server\-priority=\fIniceness\fR"
181 .IQ "\fB\-\-ovs\-vswitchd\-priority=\fIniceness\fR"
182 Sets the \fBnice\fR(1) level used for \fBovsdb\-server\fR and
183 \fBovs\-vswitchd\fR, respectively. Both default to \fB\-10\fR.
186 The following options control file locations. They should only be
187 used if the default locations cannot be used. See \fBFILES\fR, below,
188 for more information.
190 .IP "\fB\-\-db\-file=\fIfile\fR"
191 Overrides the file name for the OVS database.
193 .IP "\fB\-\-db\-sock=\fIsocket\fR"
194 Overrides the file name for the Unix domain socket used to connect to
197 .IP "\fB\-\-db\-schema=\fIschema\fR"
198 Overrides the file name for the OVS database schema.
200 .SH "The ``stop'' command"
203 The \fBstop\fR command shuts down Open vSwitch. It kills any running
204 \fBovs\-brcompatd\fR, \fBovs\-vswitchd\fR, or \fBovsdb\-server\fR
205 daemons and waits for them to terminate.
208 The \fBstop\fR command does not unload the Open vSwitch kernel
212 This command does nothing and finishes successfully if the OVS daemons
215 .SH "The ``status'' command"
218 The \fBstatus\fR command checks whether the OVS daemons
219 \fBovs-vswitchd\fR and \fBovsdb\-server\fR are running and prints
220 messages with that information. If \fB\-\-brcompat\fR is specified,
221 it also checks for \fBovs\-brcompatd\fR. It exits with status 0 if
222 the daemons are running, 1 otherwise.
224 .SH "The ``version'' command"
227 The \fBversion\fR command runs \fBovsdb\-server \-\-version\fR and
228 \fBovs\-vswitchd \-\-version\fR. If \fB\-\-brcompat\fR is specified,
229 it also runs \fBovs\-brcompatd \-\-version\fR.
231 .SH "The ``force\-reload\-kmod'' command"
234 The \fBforce\-reload\-kmod\fR command allows upgrading the Open
235 vSwitch kernel module without rebooting. It performs the following
239 Gets a list of OVS ``internal'' interfaces, that is, network devices
240 implemented by Open vSwitch. The most common examples of these are
241 bridge ``local ports''.
244 Stops the Open vSwitch daemons, as if by a call to \fBovs\-ctl
248 Saves the kernel configuration state of the OVS internal interfaces
249 listed in step 1, including IP and IPv6 addresses and routing table
253 Unloads the Open vSwitch kernel module (including the bridge
254 compatibility module if it is loaded).
257 Starts OVS back up, as if by a call to \fBovs\-ctl start\fR. This
258 reloads the kernel module and restarts the OVS daemons (including
259 \fBovs\-brcompatd\fR, if \fB\-\-brcompat\fR is specified).
262 Restores the kernel configuration state that was saved in step 3.
265 The steps above are often enough to hot-upgrade a new kernel module
266 with only a few seconds of downtime. DHCP is a common problem: if the
267 ISC DHCP client is running on an OVS internal interface, then it will
268 have to be restarted after completing the above procedure.
271 \fBforce\-kmod\-reload\fR internally stops and starts OVS, so it
272 accepts all of the options accepted by the \fBstart\fR command.
274 .SH "The ``load\-kmod'' command"
277 The \fBload\-kmod\fR command loads the openvswitch kernel modules if
278 they are not already loaded. This operation also occurs as part of
279 the \fBstart\fR command. The motivation for providing the \fBload\-kmod\fR
280 command is to allow errors when loading modules to be handled separatetly
281 from other errors that may occur when running the \fBstart\fR command.
284 By default the \fBload\-kmod\fR command attempts to load the
285 openvswitch kernel module. If the \fB\-\-brcompat\fR option is
286 specified then the brcompat kernel module is also loaded.
288 .SH "The ``enable\-protocol'' command"
291 The \fBenable\-protocol\fR command checks for rules related to a
292 specified protocol in the system's \fBiptables\fR(8) configuration. If there
293 are no rules specifically related to that protocol, then it inserts a
294 rule to accept the specified protocol.
300 If \fBiptables\fR is not installed or not enabled, this command does
301 nothing, assuming that lack of filtering means that the protocol is
305 If the \fBINPUT\fR chain has a rule that matches the specified
306 protocol, then this command does nothing, assuming that whatever rule
307 is installed reflects the system administrator's decisions.
310 Otherwise, this command installs a rule that accepts traffic of the
314 This command normally completes successfully, even if it does
315 nothing. Only the failure of an attempt to insert a rule normally
316 causes it to return an exit code other than 0.
318 The following options control the protocol to be enabled:
320 .IP "\fB\-\-protocol=\fIprotocol\fR"
321 The name of the IP protocol to be enabled, such as \fBgre\fR or
322 \fBtcp\fR. The default is \fBgre\fR.
324 .IP "\fB\-\-sport=\fIsport\fR"
325 .IQ "\fB\-\-dport=\fIdport\fR"
326 TCP or UDP source or destination port to match. These are optional
327 and allowed only with \fB\-\-protocol=tcp\fR or
328 \fB\-\-protocol=udp\fR.
330 .SH "The ``help'' command"
332 Prints a usage message and exits successfully.
336 In addition to the options listed for each command above, this option
337 controls the behavior of several of \fBovs\-ctl\fR's commands.
339 .IP "\fB\-\-brcompat\fR"
340 By default, \fBovs\-ctl\fR does not load the Open vSwitch bridge
341 compatibility module and does not start or check the status or report
342 the version of the \fBovs\-brcompatd\fR daemon. This option enables
343 all of those behaviors.
346 The \fBstop\fR command always stops \fBovs\-brcompatd\fR, if it is
347 running, regardless of this option.
351 \fBovs\-ctl\fR exits with status 0 on success and nonzero on failure.
352 The \fBstart\fR command is considered to succeed if OVS is already
353 started; the \fBstop\fR command is considered to succeed if OVS is
358 The following environment variables affect \fBovs\-ctl\fR:
361 \fBovs\-ctl\fR does not hardcode the location of any of the programs
362 that it runs. \fBovs\-ctl\fR will add the \fIsbindir\fR and
363 \fIbindir\fR that were specified at \fBconfigure\fR time to
364 \fBPATH\fR, if they are not already present.
366 .IP "\fBOVS_LOGDIR\fR"
367 .IQ "\fBOVS_RUNDIR\fR"
368 .IQ "\fBOVS_SYSCONFDIR\fR"
369 .IQ "\fBOVS_PKGDATADIR\fR"
370 .IQ "\fBOVS_BINDIR\fR"
371 .IQ "\fBOVS_SBINDIR\fR"
372 Setting one of these variables in the environment overrides the
373 respective \fBconfigure\fR option, both for \fBovs\-ctl\fR itself and
374 for the other Open vSwitch programs that it runs.
378 \fBovs\-ctl\fR uses the following files:
381 Shell function library used internally by \fBovs\-ctl\fR. It must be
382 installed in the same directory as \fBovs\-ctl\fR.
384 .IP "\fIlogdir\fB/\fIdaemon\fB.log\fR"
387 .IP "\fIrundir\fB/\fIdaemon\fB.pid\fR"
388 Per-daemon pidfiles to track whether a daemon is running and with what
391 .IP "\fIpkgdatadir\fB/vswitch.ovsschema\fR"
392 The OVS database schema used to initialize the database (use
393 \fB\-\-db\-schema to override this location).
395 .IP "\fIsysconfdir\fB/openvswitch/conf.db\fR"
396 The OVS database (use \fB\-\-db\-file\fR to override this location).
398 .IP "\fIrundir\fB/openvswitch/db.sock\fR"
399 The Unix domain socket used for local communication with
400 \fBovsdb\-server\fR (use \fB\-\-db\-sock\fR to override this
403 .IP "\fIsysconfdir\fB/openvswitch/system-id.conf\fR"
404 The persistent system UUID created and read by
405 \fB\-\-system\-id=random\fR.
407 .IP "\fIsysconfdir\fB/openvswitch/system\-type.conf\fR"
408 .IQ "\fIsysconfdir\fB/openvswitch/system\-version.conf\fR"
409 The \fBsystem\-type\fR and \fBsystem\-version\fR values stored in the database's
410 \fBOpen_vSwitch\fR table when not specified as a command-line option.
415 The files \fBdebian/openvswitch\-switch.init\fR and
416 \fBxenserver/etc_init.d_openvswitch\fR in the Open vSwitch source
417 distribution are good examples of how to use \fBovs\-ctl\fR.
421 \fBREADME\fR, \fBINSTALL.Linux\fR, \fBovsdb\-server\fR(8),
422 \fBovs\-vswitchd\fR(8).