ovs-vsctl: Set timeout to a default value of five seconds
[sliver-openvswitch.git] / utilities / ovs-vsctl.8.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .TH ovs\-vsctl 8 "November 2009" "Open vSwitch" "Open vSwitch Manual"
8 .ds PN ovs\-vsctl
9 .
10 .SH NAME
11 ovs\-vsctl \- utility for querying and configuring \fBovs\-vswitchd\fR
12 .
13 .SH SYNOPSIS
14 \fBovs\-vsctl\fR [\fIoptions\fR] [\fB\-\-\fR] \fIcommand \fR[\fIargs\fR\&...]
15 [\fB\-\-\fR \fIcommand \fR[\fIargs\fR\&...]]
16 .
17 .SH DESCRIPTION
18 The \fBovs\-vsctl\fR program configures \fBovs\-vswitchd\fR(8) by
19 providing a high\-level interface to editing its configuration
20 database.  This program is mainly intended for use when
21 \fBovs\-vswitchd\fR is running.  If it is used when
22 \fBovs\-vswitchd\fR is not running, then \fB\-\-no\-wait\fR should be
23 specified and configuration changes will only take effect when
24 \fBovs\-vswitchd\fR is started.
25 .PP
26 By default, each time \fBovs\-vsctl\fR runs, it connects to an
27 \fBovsdb\-server\fR process that maintains an Open vSwitch
28 configuration database.  Using this connection, it queries and
29 possibly applies changes to the database, depending on the supplied
30 commands.  Then, if it applied any changes, it waits until
31 \fBovs\-vswitchd\fR has finished reconfiguring itself before it exits.
32 .PP
33 \fBovs\-vsctl\fR can perform any number of commands in a single run,
34 implemented as a single atomic transaction against the database.
35 Commands are separated on the command line by \fB\-\-\fR arguments.
36 .
37 .SS "Linux VLAN Bridging Compatibility"
38 The \fBovs\-vsctl\fR program supports the model of a bridge
39 implemented by Open vSwitch, in which a single bridge supports ports
40 on multiple VLANs.  In this model, each port on a bridge is either a
41 trunk port that potentially passes packets tagged with 802.1Q headers
42 that designate VLANs or it is assigned a single implicit VLAN that is
43 never tagged with an 802.1Q header.
44 .PP
45 For compatibility with software designed for the Linux bridge,
46 \fBovs\-vsctl\fR also supports a model in which traffic associated
47 with a given 802.1Q VLAN is segregated into a separate bridge.  A
48 special form of the \fBadd\-br\fR command (see below) creates a ``fake
49 bridge'' within an Open vSwitch bridge to simulate this behavior.
50 When such a ``fake bridge'' is active, \fBovs\-vsctl\fR will treat it
51 much like a bridge separate from its ``parent bridge,'' but the actual
52 implementation in Open vSwitch uses only a single bridge, with ports on
53 the fake bridge assigned the implicit VLAN of the fake bridge of which
54 they are members.
55 .
56 .SH OPTIONS
57 .
58 The following options affect the behavior \fBovs\-vsctl\fR as a whole.
59 Some individual commands also accept their own options, which are
60 given just before the command name.  If the first command on the
61 command line has options, then those options must be separated from
62 the global options by \fB\-\-\fR.
63 .
64 .IP "\fB\-\-db=\fIserver\fR"
65 Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR
66 contacts to query or modify configuration.  The default is
67 \fBunix:@RUNDIR@/ovsdb\-server\fR.  \fIserver\fR must take one of the
68 following forms:
69 .RS
70 .IP "\fBtcp:\fIip\fB:\fIport\fR"
71 Connect to the given TCP \fIport\fR on \fIip\fR.
72 .IP "\fBunix:\fIfile\fR"
73 Connect to the Unix domain server socket named \fIfile\fR.
74 .RE
75 .IP "\fB\-\-no\-wait\fR"
76 Prevents \fBovs\-vsctl\fR from waiting for \fBovs\-vswitchd\fR to
77 reconfigure itself according to the the modified database.  This
78 option should be used if \fBovs\-vswitchd\fR is not running;
79 otherwise, \fBovs-vsctl\fR will not exit until \fBovs-vswitchd\fR
80 starts.
81 .IP
82 This option has no effect if the commands specified do not change the
83 database.
84 .
85 .IP "\fB\-\-no\-syslog\fR"
86 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
87 changes that it makes to the system log.  This option disables this
88 logging.
89 .IP
90 This option is equivalent to \fB\-\-verbose=vvsctl:syslog:warn\fR.
91 .
92 .IP "\fB\-\-oneline\fR"
93 Modifies the output format so that the output for each command is printed
94 on a single line.  New-line characters that would otherwise separate
95 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
96 would otherwise appear in the output are doubled.
97 Prints a blank line for each command that has no output.
98 .
99 .IP "\fB\-\-dry\-run\fR"
100 Prevents \fBovs\-vsctl\fR from actually modifying the database.
101 .
102 .IP "\fB-t \fIsecs\fR"
103 .IQ "\fB--timeout=\fIsecs\fR"
104 Limits runtime to approximately \fIsecs\fR seconds.  A value of 
105 zero will cause \fBovs\-vsctl\fR to wait forever.  If the timeout expires, 
106 \fBovs\-vsctl\fR will exit with a \fBSIGALRM\fR signal.  If this option is
107 not used, \fBovs\-vsctl\fR uses a timeout of five seconds.
108 (A timeout would normally happen only if the database cannot be contacted.)
109 .
110 .so lib/vlog.man
111 .
112 .SH COMMANDS
113 The commands implemented by \fBovs\-vsctl\fR are described in the
114 sections below.
115 .SS "Open vSwitch Commands"
116 These commands work with an Open vSwitch as a whole.
117 .
118 .IP "\fBinit\fR"
119 Initializes the Open vSwitch database, if it is empty.  If the
120 database has already been initialized, this command has no effect.
121 .IP
122 Any successful \fBovs\-vsctl\fR command automatically initializes the
123 Open vSwitch database if it is empty.  This command is provided to
124 initialize the database without executing any other command.
125 .
126 .SS "Bridge Commands"
127 These commands examine and manipulate Open vSwitch bridges.
128 .
129 .IP "\fBadd\-br \fIbridge\fR"
130 Creates a new bridge named \fIbridge\fR.  Initially the bridge will
131 have no ports (other than \fIbridge\fR itself).
132 .
133 .IP "\fBadd\-br \fIbridge parent vlan\fR"
134 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
135 vSwitch bridge \fIparent\fR, which must already exist and must not
136 itself be a fake bridge.  The new fake bridge will be on 802.1Q VLAN
137 \fIvlan\fR, which must be an integer between 1 and 4095.  Initially
138 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
139 .
140 .IP "[\fB\-\-if\-exists\fR] \fBdel\-br \fIbridge\fR"
141 Deletes \fIbridge\fR and all of its ports.  If \fIbridge\fR is a real
142 bridge, this command also deletes any fake bridges that were created
143 with \fIbridge\fR as parent, including all of their ports.
144 .IP
145 Without \fB\-\-if\-exists\fR, attempting to delete a bridge that does
146 not exist is an error.  With \fB\-\-if\-exists\fR, attempting to
147 delete a bridge that does not exist has no effect.
148 .
149 .IP "\fBlist\-br\fR"
150 Lists all existing real and fake bridges on standard output, one per
151 line.
152 .
153 .IP "\fBbr\-exists \fIbridge\fR"
154 Tests whether \fIbridge\fR exists as a real or fake bridge.  If so,
155 \fBovs\-vsctl\fR exits successfully with exit code 0.  If not,
156 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
157 .
158 .IP "\fBbr\-to\-vlan \fIbridge\fR"
159 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
160 decimal integer.  If \fIbridge\fR is a real bridge, prints 0.
161 .
162 .IP "\fBbr\-to\-parent \fIbridge\fR"
163 If \fIbridge\fR is a fake bridge, prints the name of its parent
164 bridge.  If \fIbridge\fR is a real bridge, print \fIbridge\fR.
165 .
166 .IP "\fBbr\-set\-external\-id \fIbridge key\fR [\fIvalue\fR]"
167 Sets or clears an ``external ID'' value on \fIbridge\fR.  These values
168 are intended to identify entities external to Open vSwitch with which
169 \fIbridge\fR is associated, e.g. the bridge's identifier in a
170 virtualization management platform.  The Open vSwitch database schema
171 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
172 are otherwise arbitrary strings.
173 .IP
174 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
175 \fIbridge\fR, overwriting any previous value.  If \fIvalue\fR is
176 omitted, then \fIkey\fR is removed from \fIbridge\fR's set of external
177 IDs (if it was present).
178 .
179 .IP "\fBbr\-get\-external\-id \fIbridge\fR [\fIkey\fR]"
180 Queries the external IDs on \fIbridge\fR.  If \fIkey\fR is specified,
181 the output is the value for that \fIkey\fR or the empty string if
182 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
183 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
184 .
185 .SS "Port Commands"
186 .
187 These commands examine and manipulate Open vSwitch ports.  These
188 commands treat a bonded port as a single entity.
189 .
190 .IP "\fBlist\-ports \fIbridge\fR"
191 Lists all of the ports within \fIbridge\fR on standard output, one per
192 line.  The local port \fIbridge\fR is not included in the list.
193 .
194 .IP "\fBadd\-port \fIbridge port\fR"
195 Creates on \fIbridge\fR a new port named \fIport\fR from the network
196 device of the same name.
197 .
198 .IP "\fBadd\-bond \fIbridge port iface\fR\&..."
199 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
200 together the network devices given as each \fIiface\fR.  At least two
201 interfaces must be named.
202 .
203 .IP "[\fB\-\-if\-exists\fR] \fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
204 Deletes \fIport\fR.  If \fIbridge\fR is omitted, \fIport\fR is removed
205 from whatever bridge contains it; if \fIbridge\fR is specified, it
206 must be the real or fake bridge that contains \fIport\fR.
207 .IP
208 Without \fB\-\-if\-exists\fR, attempting to delete a port that does
209 not exist is an error.  With \fB\-\-if\-exists\fR, attempting to
210 delete a port that does not exist has no effect.
211 .
212 .IP "\fBport\-to\-br \fIport\fR"
213 Prints the name of the bridge that contains \fIport\fR on standard
214 output.
215 .
216 .IP "\fBport\-set\-external\-id \fIport key\fR [\fIvalue\fR]"
217 Sets or clears an ``external ID'' value on \fIport\fR.  These value
218 are intended to identify entities external to Open vSwitch with which
219 \fIport\fR is associated, e.g. the port's identifier in a
220 virtualization management platform.  The Open vSwitch database schema
221 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
222 are otherwise arbitrary strings.
223 .IP
224 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
225 \fIport\fR, overwriting any previous value.  If \fIvalue\fR is
226 omitted, then \fIkey\fR is removed from \fIport\fR's set of external
227 IDs (if it was present).
228 .
229 .IP "\fBbr\-get\-external\-id \fIport\fR [\fIkey\fR]"
230 Queries the external IDs on \fIport\fR.  If \fIkey\fR is specified,
231 the output is the value for that \fIkey\fR or the empty string if
232 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
233 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
234 .
235 .SS "Interface Commands"
236 .
237 These commands examine the interfaces attached to an Open vSwitch
238 bridge.  These commands treat a bonded port as a collection of two or
239 more interfaces, rather than as a single port.
240 .
241 .IP "\fBlist\-ifaces \fIbridge\fR"
242 Lists all of the interfaces within \fIbridge\fR on standard output,
243 one per line.  The local port \fIbridge\fR is not included in the
244 list.
245 .
246 .IP "\fBiface\-to\-br \fIiface\fR"
247 Prints the name of the bridge that contains \fIiface\fR on standard
248 output.
249 .
250 .IP "\fBiface\-set\-external\-id \fIiface key\fR [\fIvalue\fR]"
251 Sets or clears an ``external ID'' value on \fIiface\fR.  These value
252 are intended to identify entities external to Open vSwitch with which
253 \fIiface\fR is associated, e.g. the interface's identifier in a
254 virtualization management platform.  The Open vSwitch database schema
255 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
256 are otherwise arbitrary strings.
257 .IP
258 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
259 \fIiface\fR, overwriting any previous value.  If \fIvalue\fR is
260 omitted, then \fIkey\fR is removed from \fIiface\fR's set of external
261 IDs (if it was present).
262 .
263 .IP "\fBbr\-get\-external\-id \fIiface\fR [\fIkey\fR]"
264 Queries the external IDs on \fIiface\fR.  If \fIkey\fR is specified,
265 the output is the value for that \fIkey\fR or the empty string if
266 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
267 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
268 .
269 .SH "EXAMPLES"
270 Create a new bridge named br0 and add port eth0 to it:
271 .IP
272 .B "ovs-vsctl add\-br br0"
273 .br
274 .B "ovs-vsctl add\-port br0 eth0"
275 .PP
276 Alternatively, perform both operations in a single atomic transaction:
277 .IP 
278 .B "ovs-vsctl add\-br br0 \-\- add\-port br0 eth0"
279 .PP
280 Delete bridge \fBbr0\fR, reporting an error if it does not exist:
281 .IP
282 .B "ovs\-vsctl del\-br br0"
283 .PP
284 Delete bridge \fBbr0\fR if it exists (the \fB\-\-\fR is required to
285 separate \fBdel\-br\fR's options from the global options):
286 .IP
287 .B "ovs\-vsctl \-\- \-\-if\-exists del\-br br0"
288 .
289 .SH "EXIT STATUS"
290 .IP "0"
291 Successful program execution.
292 .IP "1"
293 Usage, syntax, or configuration file error.
294 .IP "2"
295 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
296 bridge that does not exist.
297 .SH "SEE ALSO"
298 .
299 .BR ovsdb\-server (1),
300 .BR ovs\-vswitchd (8).