ovs-vsctl: Remove default timeout.
[sliver-openvswitch.git] / utilities / ovs-vsctl.8.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .de ST
8 .  PP
9 .  RS -0.15in
10 .  I "\\$1"
11 .  RE
12 ..
13 .TH ovs\-vsctl 8 "November 2009" "Open vSwitch" "Open vSwitch Manual"
14 .\" This program's name:
15 .ds PN ovs\-vsctl
16 .\" SSL peer program's name:
17 .ds SN ovsdb\-server
18 .
19 .SH NAME
20 ovs\-vsctl \- utility for querying and configuring \fBovs\-vswitchd\fR
21 .
22 .SH SYNOPSIS
23 \fBovs\-vsctl\fR [\fIoptions\fR] \fB\-\-\fR [\fIoptions\fR] \fIcommand
24 \fR[\fIargs\fR] [\fB\-\-\fR [\fIoptions\fR] \fIcommand \fR[\fIargs\fR]]...
25 .
26 .SH DESCRIPTION
27 The \fBovs\-vsctl\fR program configures \fBovs\-vswitchd\fR(8) by
28 providing a high\-level interface to its configuration
29 database.  This program is mainly intended for use when
30 \fBovs\-vswitchd\fR is running.  If it is used when
31 \fBovs\-vswitchd\fR is not running, then \fB\-\-no\-wait\fR should be
32 specified and configuration changes will only take effect when
33 \fBovs\-vswitchd\fR is started.
34 .PP
35 By default, each time \fBovs\-vsctl\fR runs, it connects to an
36 \fBovsdb\-server\fR process that maintains an Open vSwitch
37 configuration database.  Using this connection, it queries and
38 possibly applies changes to the database, depending on the supplied
39 commands.  Then, if it applied any changes, it waits until
40 \fBovs\-vswitchd\fR has finished reconfiguring itself before it exits.
41 .PP
42 \fBovs\-vsctl\fR can perform any number of commands in a single run,
43 implemented as a single atomic transaction against the database.
44 .PP
45 The \fBovs\-vsctl\fR command line begins with global options (see
46 \fBOPTIONS\fR below for details).  The global options are followed by
47 one or more commands.  Each command should begin with \fB\-\-\fR by
48 itself as a command-line argument, to separate it from the global
49 options and following commands.  (If the first command does not have
50 any options, then the first \fB\-\-\fR may be omitted.)  The command
51 itself starts with command-specific options, if any, followed by the
52 command name and any arguments.  See \fBEXAMPLES\fR below for syntax
53 examples.
54 .
55 .SS "Linux VLAN Bridging Compatibility"
56 The \fBovs\-vsctl\fR program supports the model of a bridge
57 implemented by Open vSwitch, in which a single bridge supports ports
58 on multiple VLANs.  In this model, each port on a bridge is either a
59 trunk port that potentially passes packets tagged with 802.1Q headers
60 that designate VLANs or it is assigned a single implicit VLAN that is
61 never tagged with an 802.1Q header.
62 .PP
63 For compatibility with software designed for the Linux bridge,
64 \fBovs\-vsctl\fR also supports a model in which traffic associated
65 with a given 802.1Q VLAN is segregated into a separate bridge.  A
66 special form of the \fBadd\-br\fR command (see below) creates a ``fake
67 bridge'' within an Open vSwitch bridge to simulate this behavior.
68 When such a ``fake bridge'' is active, \fBovs\-vsctl\fR will treat it
69 much like a bridge separate from its ``parent bridge,'' but the actual
70 implementation in Open vSwitch uses only a single bridge, with ports on
71 the fake bridge assigned the implicit VLAN of the fake bridge of which
72 they are members.
73 .
74 .SH OPTIONS
75 .
76 The following options affect the behavior \fBovs\-vsctl\fR as a whole.
77 Some individual commands also accept their own options, which are
78 given just before the command name.  If the first command on the
79 command line has options, then those options must be separated from
80 the global options by \fB\-\-\fR.
81 .
82 .IP "\fB\-\-db=\fIserver\fR"
83 Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR
84 contacts to query or modify configuration.  The default is
85 \fBunix:@RUNDIR@/db.sock\fR.  \fIserver\fR must take one of the
86 following forms:
87 .RS
88 .so ovsdb/remote-active.man
89 .so ovsdb/remote-passive.man
90 .RE
91 .
92 .IP "\fB\-\-no\-wait\fR"
93 Prevents \fBovs\-vsctl\fR from waiting for \fBovs\-vswitchd\fR to
94 reconfigure itself according to the the modified database.  This
95 option should be used if \fBovs\-vswitchd\fR is not running;
96 otherwise, \fBovs\-vsctl\fR will not exit until \fBovs\-vswitchd\fR
97 starts.
98 .IP
99 This option has no effect if the commands specified do not change the
100 database.
101 .
102 .IP "\fB\-\-no\-syslog\fR"
103 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
104 changes that it makes to the system log.  This option disables this
105 logging.
106 .IP
107 This option is equivalent to \fB\-\-verbose=vvsctl:syslog:warn\fR.
108 .
109 .IP "\fB\-\-oneline\fR"
110 Modifies the output format so that the output for each command is printed
111 on a single line.  New-line characters that would otherwise separate
112 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
113 would otherwise appear in the output are doubled.
114 Prints a blank line for each command that has no output.
115 .
116 .IP "\fB\-\-dry\-run\fR"
117 Prevents \fBovs\-vsctl\fR from actually modifying the database.
118 .
119 .IP "\fB\-t \fIsecs\fR"
120 .IQ "\fB\-\-timeout=\fIsecs\fR"
121 By default, or with a \fIsecs\fR of \fB0\fR, \fBovs\-vsctl\fR waits
122 forever for a response from the database.  This option limits runtime
123 to approximately \fIsecs\fR seconds.  If the timeout expires,
124 \fBovs\-vsctl\fR will exit with a \fBSIGALRM\fR signal.  (A timeout
125 would normally happen only if the database cannot be contacted, or if
126 the system is overloaded.)
127 .
128 .SS "Public Key Infrastructure Options"
129 .so lib/ssl.man
130 .so lib/ssl-bootstrap.man
131 .so lib/ssl-peer-ca-cert.man
132 .so lib/vlog.man
133 .
134 .SH COMMANDS
135 The commands implemented by \fBovs\-vsctl\fR are described in the
136 sections below.
137 .SS "Open vSwitch Commands"
138 These commands work with an Open vSwitch as a whole.
139 .
140 .IP "\fBinit\fR"
141 Initializes the Open vSwitch database, if it is empty.  If the
142 database has already been initialized, this command has no effect.
143 .IP
144 Any successful \fBovs\-vsctl\fR command automatically initializes the
145 Open vSwitch database if it is empty.  This command is provided to
146 initialize the database without executing any other command.
147 .
148 .IP "\fBemer\-reset\fR"
149 Reset the configuration into a clean state.  It deconfigures OpenFlow
150 controllers, OVSDB servers, and SSL, and deletes port mirroring,
151 NetFlow, and sFlow configuration.  This command also removes all
152 \fBother\-config\fR keys from all database records, except that
153 \fBother\-config:hwaddr\fR is preserved if it is present in a Bridge
154 record.  Other networking configuration is left as-is.
155 .
156 .SS "Bridge Commands"
157 These commands examine and manipulate Open vSwitch bridges.
158 .
159 .IP "[\fB\-\-may\-exist\fR] \fBadd\-br \fIbridge\fR"
160 Creates a new bridge named \fIbridge\fR.  Initially the bridge will
161 have no ports (other than \fIbridge\fR itself).
162 .IP
163 Without \fB\-\-may\-exist\fR, attempting to create a bridge that
164 exists is an error.  With \fB\-\-may\-exist\fR, \fIbridge\fR may
165 already exist (but it must be a real bridge, not a VLAN bridge).
166 .
167 .IP "[\fB\-\-may\-exist\fR] \fBadd\-br \fIbridge parent vlan\fR"
168 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
169 vSwitch bridge \fIparent\fR, which must already exist and must not
170 itself be a fake bridge.  The new fake bridge will be on 802.1Q VLAN
171 \fIvlan\fR, which must be an integer between 1 and 4095.  Initially
172 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
173 .IP
174 Without \fB\-\-may\-exist\fR, attempting to create a bridge that
175 exists is an error.  With \fB\-\-may\-exist\fR, \fIbridge\fR may
176 already exist (but it must have the specified \fIvlan\fR and
177 \fIparent\fR).
178 .
179 .IP "[\fB\-\-if\-exists\fR] \fBdel\-br \fIbridge\fR"
180 Deletes \fIbridge\fR and all of its ports.  If \fIbridge\fR is a real
181 bridge, this command also deletes any fake bridges that were created
182 with \fIbridge\fR as parent, including all of their ports.
183 .IP
184 Without \fB\-\-if\-exists\fR, attempting to delete a bridge that does
185 not exist is an error.  With \fB\-\-if\-exists\fR, attempting to
186 delete a bridge that does not exist has no effect.
187 .
188 .IP "\fBlist\-br\fR"
189 Lists all existing real and fake bridges on standard output, one per
190 line.
191 .
192 .IP "\fBbr\-exists \fIbridge\fR"
193 Tests whether \fIbridge\fR exists as a real or fake bridge.  If so,
194 \fBovs\-vsctl\fR exits successfully with exit code 0.  If not,
195 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
196 .
197 .IP "\fBbr\-to\-vlan \fIbridge\fR"
198 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
199 decimal integer.  If \fIbridge\fR is a real bridge, prints 0.
200 .
201 .IP "\fBbr\-to\-parent \fIbridge\fR"
202 If \fIbridge\fR is a fake bridge, prints the name of its parent
203 bridge.  If \fIbridge\fR is a real bridge, print \fIbridge\fR.
204 .
205 .IP "\fBbr\-set\-external\-id \fIbridge key\fR [\fIvalue\fR]"
206 Sets or clears an ``external ID'' value on \fIbridge\fR.  These values
207 are intended to identify entities external to Open vSwitch with which
208 \fIbridge\fR is associated, e.g. the bridge's identifier in a
209 virtualization management platform.  The Open vSwitch database schema
210 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
211 are otherwise arbitrary strings.
212 .IP
213 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
214 \fIbridge\fR, overwriting any previous value.  If \fIvalue\fR is
215 omitted, then \fIkey\fR is removed from \fIbridge\fR's set of external
216 IDs (if it was present).
217 .IP
218 For real bridges, the effect of this command is similar to that of a
219 \fBset\fR or \fBremove\fR command in the \fBexternal\-ids\fR column of
220 the \fBBridge\fR table.  For fake bridges, it actually modifies keys
221 with names prefixed by \fBfake\-bridge\-\fR in the \fBPort\fR table.
222 .
223 .IP "\fBbr\-get\-external\-id \fIbridge\fR [\fIkey\fR]"
224 Queries the external IDs on \fIbridge\fR.  If \fIkey\fR is specified,
225 the output is the value for that \fIkey\fR or the empty string if
226 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
227 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
228 .IP
229 For real bridges, the effect of this command is similar to that of a
230 \fBget\fR command in the \fBexternal\-ids\fR column of the
231 \fBBridge\fR table.  For fake bridges, it queries keys with names
232 prefixed by \fBfake\-bridge\-\fR in the \fBPort\fR table.
233 .
234 .SS "Port Commands"
235 .
236 These commands examine and manipulate Open vSwitch ports.  These
237 commands treat a bonded port as a single entity.
238 .
239 .IP "\fBlist\-ports \fIbridge\fR"
240 Lists all of the ports within \fIbridge\fR on standard output, one per
241 line.  The local port \fIbridge\fR is not included in the list.
242 .
243 .IP "[\fB\-\-may\-exist\fR] \fBadd\-port \fIbridge port \fR[\fIcolumn\fR[\fB:\fIkey\fR]\fR=\fIvalue\fR]\&...\fR"
244 Creates on \fIbridge\fR a new port named \fIport\fR from the network
245 device of the same name.
246 .IP
247 Optional arguments set values of column in the Port record created by
248 the command.  For example, \fBtag=9\fR would make the port an access
249 port for VLAN 9.  The syntax is the same as that for the \fBset\fR
250 command (see \fBDatabase Commands\fR below).
251 .IP
252 Without \fB\-\-may\-exist\fR, attempting to create a port that exists
253 is an error.  With \fB\-\-may\-exist\fR, \fIport\fR may already exist
254 (but it must be on \fIbridge\fR and not be a bonded port).
255 .
256 .IP "[\fB\-\-fake\-iface\fR] \fBadd\-bond \fIbridge port iface\fR\&... [\fIcolumn\fR[\fB:\fIkey\fR]\fR=\fIvalue\fR]\&...\fR"
257 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
258 together the network devices given as each \fIiface\fR.  At least two
259 interfaces must be named.
260 .IP
261 Optional arguments set values of column in the Port record created by
262 the command.  The syntax is the same as that for the \fBset\fR command
263 (see \fBDatabase Commands\fR below).
264 .IP
265 With \fB\-\-fake\-iface\fR, a fake interface with the name \fIport\fR is
266 created.  This should only be used for compatibility with legacy
267 software that requires it.
268 .IP
269 Without \fB\-\-may\-exist\fR, attempting to create a port that exists
270 is an error.  With \fB\-\-may\-exist\fR, \fIport\fR may already exist
271 (but it must be on \fIbridge\fR and bond together exactly the
272 specified interface).
273 .
274 .IP "[\fB\-\-if\-exists\fR] \fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
275 Deletes \fIport\fR.  If \fIbridge\fR is omitted, \fIport\fR is removed
276 from whatever bridge contains it; if \fIbridge\fR is specified, it
277 must be the real or fake bridge that contains \fIport\fR.
278 .IP
279 Without \fB\-\-if\-exists\fR, attempting to delete a port that does
280 not exist is an error.  With \fB\-\-if\-exists\fR, attempting to
281 delete a port that does not exist has no effect.
282 .
283 .IP "[\fB\-\-if\-exists\fR] \fB\-\-with\-iface del\-port \fR[\fIbridge\fR] \fIiface\fR"
284 Deletes the port named \fIiface\fR or that has an interface named
285 \fIiface\fR.  If \fIbridge\fR is omitted, the port is removed from
286 whatever bridge contains it; if \fIbridge\fR is specified, it must be
287 the real or fake bridge that contains the port.
288 .IP
289 Without \fB\-\-if\-exists\fR, attempting to delete the port for an
290 interface that does not exist is an error.  With \fB\-\-if\-exists\fR,
291 attempting to delete the port for an interface that does not exist has
292 no effect.
293 .
294 .IP "\fBport\-to\-br \fIport\fR"
295 Prints the name of the bridge that contains \fIport\fR on standard
296 output.
297 .
298 .SS "Interface Commands"
299 .
300 These commands examine the interfaces attached to an Open vSwitch
301 bridge.  These commands treat a bonded port as a collection of two or
302 more interfaces, rather than as a single port.
303 .
304 .IP "\fBlist\-ifaces \fIbridge\fR"
305 Lists all of the interfaces within \fIbridge\fR on standard output,
306 one per line.  The local port \fIbridge\fR is not included in the
307 list.
308 .
309 .IP "\fBiface\-to\-br \fIiface\fR"
310 Prints the name of the bridge that contains \fIiface\fR on standard
311 output.
312 .
313 .SS "OpenFlow Controller Connectivity"
314 .
315 \fBovs\-vswitchd\fR can perform all configured bridging and switching
316 locally, or it can be configured to connect a given bridge to one or
317 more external OpenFlow controllers, such as NOX.
318 .
319 .IP "\fBget\-controller\fR \fIbridge\fR"
320 Prints the configured controller target.
321 .
322 .IP "\fBdel\-controller\fR \fIbridge\fR"
323 Deletes the configured controller target.
324 .
325 .IP "\fBset\-controller\fR \fIbridge\fR \fItarget\fR\&..."
326 Sets the configured controller target or targets.  Each \fItarget\fR may
327 use any of the following forms:
328 .
329 .RS
330 .so lib/vconn-active.man
331 .RE
332 .
333 .ST "Controller Failure Settings"
334 .PP
335 When a controller is configured, it is, ordinarily, responsible for
336 setting up all flows on the switch.  Thus, if the connection to
337 the controller fails, no new network connections can be set up.  If
338 the connection to the controller stays down long enough, no packets
339 can pass through the switch at all.
340 .PP
341 If the value is \fBstandalone\fR, or if neither of these settings
342 is set, \fBovs\-vswitchd\fR will take over
343 responsibility for setting up
344 flows when no message has been received from the controller for three
345 times the inactivity probe interval (xxx needs to be exposed).  In this mode,
346 \fBovs\-vswitchd\fR causes the datapath to act like an ordinary
347 MAC-learning switch.  \fBovs\-vswitchd\fR will continue to retry connecting
348 to the controller in the background and, when the connection succeeds,
349 it discontinues its standalone behavior.
350 .PP
351 If this option is set to \fBsecure\fR, \fBovs\-vswitchd\fR will not
352 set up flows on its own when the controller connection fails.
353 .
354 .IP "\fBget\-fail\-mode\fR \fIbridge\fR"
355 Prints the configured failure mode.
356 .
357 .IP "\fBdel\-fail\-mode\fR \fIbridge\fR"
358 Deletes the configured failure mode.
359 .
360 .IP "\fBset\-fail\-mode\fR \fIbridge\fR \fBstandalone\fR|\fBsecure\fR"
361 Sets the configured failure mode.
362 .
363 .SS "SSL Configuration"
364 When \fBovs\-vswitchd\fR is configured to connect over SSL for management or
365 controller connectivity, the following parameters are required:
366 .TP
367 \fBprivate\-key\fR
368 Specifies a PEM file containing the private key used as the virtual
369 switch's identity for SSL connections to the controller.
370 .TP
371 \fBcertificate\fR
372 Specifies a PEM file containing a certificate, signed by the
373 certificate authority (CA) used by the controller and manager, that
374 certifies the virtual switch's private key, identifying a trustworthy
375 switch.
376 .TP
377 \fBca\-cert\fR
378 Specifies a PEM file containing the CA certificate used to verify that
379 the virtual switch is connected to a trustworthy controller.
380 .PP
381 These files are read only once, at \fBovs\-vswitchd\fR startup time.  If
382 their contents change, \fBovs\-vswitchd\fR must be killed and restarted.
383 .PP
384 These SSL settings apply to all SSL connections made by the virtual
385 switch.
386 .
387 .IP "\fBget\-ssl\fR"
388 Prints the SSL configuration.
389 .
390 .IP "\fBdel\-ssl\fR"
391 Deletes the current SSL configuration.
392 .
393 .IP "[\fB\-\-bootstrap\fR] \fBset\-ssl\fR \fIprivate-key\fR \fIcertificate\fR \fIca-cert\fR"
394 Sets the SSL configuration.  The \fB\-\-bootstrap\fR option is described 
395 below.
396 .
397 .ST "CA Certificate Bootstrap"
398 .PP
399 Ordinarily, all of the files named in the SSL configuration must exist
400 when \fBovs\-vswitchd\fR starts.  However, if the \fB\-\-bootstrap\fR 
401 option is given, then \fBovs\-vswitchd\fR will attempt to obtain the
402 CA certificate from the controller on its first SSL connection and
403 save it to the named PEM file.  If it is successful, it will
404 immediately drop the connection and reconnect, and from then on all
405 SSL connections must be authenticated by a certificate signed by the
406 CA certificate thus obtained.
407 .PP
408 \fBThis option exposes the SSL connection to a man-in-the-middle
409 attack obtaining the initial CA certificate\fR, but it may be useful
410 for bootstrapping.
411 .PP
412 This option is only useful if the controller sends its CA certificate
413 as part of the SSL certificate chain.  The SSL protocol does not
414 require the controller to send the CA certificate, but
415 \fBovs\-controller\fR(8) can be configured to do so with the
416 \fB\-\-peer\-ca\-cert\fR option.
417 .
418 .SS "Database Commands"
419 .
420 These commands query and modify the contents of \fBovsdb\fR tables.
421 They are a slight abstraction of the \fBovsdb\fR interface and as such
422 they operate at a lower level than other \fBovs\-vsctl\fR commands.
423 .PP
424 .ST "Identifying Tables, Records, and Columns"
425 .PP
426 Each of these commands has a \fItable\fR parameter to identify a table
427 within the database.  Many of them also take a \fIrecord\fR parameter
428 that identifies a particular record within a table.  The \fIrecord\fR
429 parameter may be the UUID for a record, and many tables offer
430 additional ways to identify records.  Some commands also take
431 \fIcolumn\fR parameters that identify a particular field within the
432 records in a table.
433 .PP
434 The following tables are currently defined:
435 .IP "\fBOpen_vSwitch\fR"
436 Global configuration for an \fBovs\-vswitchd\fR.  This table contains
437 exactly one record, identified by specifying \fB.\fR as the record
438 name.
439 .IP "\fBBridge\fR"
440 Configuration for a bridge within an Open vSwitch.  Records may be
441 identified by bridge name.
442 .IP "\fBPort\fR"
443 A bridge port.  Records may be identified by port name.
444 .IP "\fBInterface\fR"
445 A network device attached to a port.  Records may be identified by
446 name.
447 .IP "\fBMirror\fR"
448 A port mirroring configuration attached to a bridge.  Records may be
449 identified by mirror name.
450 .IP "\fBController\fR"
451 Configuration for an OpenFlow controller.  A controller attached to a
452 particular bridge may be identified by the bridge's name.
453 .IP "\fBNetFlow\fR"
454 A NetFlow configuration attached to a bridge.  Records may be
455 identified by bridge name.
456 .IP "\fBSSL\fR"
457 The global SSL configuration for \fBovs\-vswitchd\fR.  The record
458 attached to the \fBOpen_vSwitch\fR table may be identified by
459 specifying \fB.\fR as the record name.
460 .IP "\fBsFlow\fR"
461 An sFlow configuration attached to a bridge.  Records may be
462 identified by bridge name.
463 .PP
464 Record names must be specified in full and with correct
465 capitalization.  Names of tables and columns are not case-sensitive,
466 and \fB\-\-\fR and \fB_\fR are treated interchangeably.  Unique
467 abbreviations are acceptable, e.g. \fBnet\fR or \fBn\fR is sufficient
468 to identify the \fBNetFlow\fR table.
469 .
470 .ST "Database Values"
471 .PP
472 Each column in the database accepts a fixed type of data.  The
473 currently defined basic types, and their representations, are:
474 .IP "integer"
475 A decimal integer in the range \-2**63 to 2**63\-1, inclusive.
476 .IP "real"
477 A floating-point number.
478 .IP "Boolean"
479 True or false, written \fBtrue\fR or \fBfalse\fR, respectively.
480 .IP "string"
481 An arbitrary Unicode string, except that null bytes are not allowed.
482 Quotes are optional for most strings that begin with an English letter
483 or underscore and consist only of letters, underscores, hyphens, and
484 periods.  However, \fBtrue\fR and \fBfalse\fR and strings that match
485 the syntax of UUIDs (see below) must be enclosed in double quotes to
486 distinguish them from other basic types.  When double quotes are used,
487 the syntax is that of strings in JSON, e.g. backslashes may be used to
488 escape special characters.  The empty string must be represented as a
489 pair of double quotes (\fB""\fR).
490 .IP "UUID"
491 Either a universally unique identifier in the style of RFC 4122,
492 e.g. \fBf81d4fae\-7dec\-11d0\-a765\-00a0c91e6bf6\fR, or an \fB@\fIname\fR
493 defined by the \fBcreate\fR command within the same \fBovs\-vsctl\fR
494 invocation.
495 .PP
496 Multiple values in a single column may be separated by spaces or a
497 single comma.  When multiple values are present, duplicates are not
498 allowed, and order is not important.  Conversely, some database
499 columns can have an empty set of values, represented as \fB[]\fR, and
500 square brackets may optionally enclose other non-empty sets or single
501 values as well.
502 .PP
503 A few database columns are ``maps'' of key-value pairs, where the key
504 and the value are each some fixed database type.  These are specified
505 in the form \fIkey\fB=\fIvalue\fR, where \fIkey\fR and \fIvalue\fR
506 follow the syntax for the column's key type and value type,
507 respectively.  When multiple pairs are present (separated by spaces or
508 a comma), duplicate keys are not allowed, and again the order is not
509 important.  Duplicate values are allowed.  An empty map is represented
510 as \fB{}\fR, and curly braces may be optionally enclose non-empty maps
511 as well.
512 .
513 .ST "Database Command Syntax"
514 .IP "\fBlist \fItable \fR[\fIrecord\fR]..."
515 List the values of all columns of each specified \fIrecord\fR.  If no
516 records are specified, lists all the records in \fItable\fR.
517 .IP
518 The UUIDs shown for rows created in the same \fBovs\-vsctl\fR
519 invocation will be wrong.
520 .
521 .IP "[\fB\-\-if\-exists\fR] \fBget \fItable record column\fR[\fB:\fIkey\fR]..."
522 Prints the value of each specified \fIcolumn\fR in the given
523 \fIrecord\fR in \fItable\fR.  For map columns, a \fIkey\fR may
524 optionally be specified, in which case the value associated with
525 \fIkey\fR in the column is printed, instead of the entire map.
526 .IP
527 For a map column, without \fB\-\-if\-exists\fR it is an error if
528 \fIkey\fR does not exist; with it, a blank line is printed.  If
529 \fIcolumn\fR is not a map column or if \fIkey\fR is not specified,
530 \fB\-\-if\-exists\fR has no effect.
531 .
532 .IP "\fBset \fItable record column\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR..."
533 Sets the value of each specified \fIcolumn\fR in the given
534 \fIrecord\fR in \fItable\fR to \fIvalue\fR.  For map columns, a
535 \fIkey\fR may optionally be specified, in which case the value
536 associated with \fIkey\fR in that column is changed (or added, if none
537 exists), instead of the entire map.
538 .
539 .IP "\fBadd \fItable record column \fR[\fIkey\fB=\fR]\fIvalue\fR..."
540 Adds the specified value or key-value pair to \fIcolumn\fR in
541 \fIrecord\fR in \fItable\fR.  If \fIcolumn\fR is a map, then \fIkey\fR
542 is required, otherwise it is prohibited.  If \fIkey\fR already exists
543 in a map column, then the current \fIvalue\fR is not replaced (use the
544 \fBset\fR command to replace an existing value).
545 .
546 .IP "\fBremove \fItable record column \fR\fIvalue\fR..."
547 .IQ "\fBremove \fItable record column \fR\fIkey\fR..."
548 .IQ "\fBremove \fItable record column \fR\fIkey\fB=\fR\fIvalue\fR..."
549 Removes the specified values or key-value pairs from \fIcolumn\fR in
550 \fIrecord\fR in \fItable\fR.  The first form applies to columns that
551 are not maps: each specified \fIvalue\fR is removed from the column.
552 The second and third forms apply to map columns: if only a \fIkey\fR
553 is specified, then any key-value pair with the given \fIkey\fR is
554 removed, regardless of its value; if a \fIvalue\fR is given then a
555 pair is removed only if both key and value match.
556 .IP
557 It is not an error if the column does not contain the specified key or
558 value or pair.
559 .
560 .IP "\fBclear\fR \fItable record column\fR..."
561 Sets each \fIcolumn\fR in \fIrecord\fR in \fItable\fR to the empty set
562 or empty map, as appropriate.  This command applies only to columns
563 that are allowed to be empty.
564 .
565 .IP "[\fB\-\-id=@\fIname\fR] \fBcreate\fR \fItable column\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR..."
566 Creates a new record in \fItable\fR and sets the initial values of
567 each \fIcolumn\fR.  Columns not explicitly set will receive their
568 default values.  Outputs the UUID of the new row.
569 .IP
570 If \fB@\fIname\fR is specified, then the UUID for the new row may be
571 referred to by that name elsewhere in the same \fBovs\-vsctl\fR
572 invocation in contexts where a UUID is expected.  Such references may
573 precede or follow the \fBcreate\fR command.
574 .
575 .IP "\fR[\fB\-\-if\-exists\fR] \fBdestroy \fItable record\fR..."
576 Deletes each specified \fIrecord\fR from \fItable\fR.  Unless
577 \fB\-\-if\-exists\fR is specified, each \fIrecord\fRs must exist.
578 .
579 .IP "\fBwait\-until \fItable record \fR[\fIcolumn\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR]..."
580 Waits until \fItable\fR contains a record named \fIrecord\fR whose
581 \fIcolumn\fR equals \fIvalue\fR or, if \fIkey\fR is specified, whose
582 \fIcolumn\fR contains a \fIkey\fR with the specified \fIvalue\fR.  Any
583 of the operators \fB!=\fR, \fB<\fR, \fB>\fR, \fB<=\fR, or \fB>=\fR may
584 be substituted for \fB=\fR to test for inequality, less than, greater
585 than, less than or equal to, or greater than or equal to,
586 respectively.  (Don't forget to escape \fB<\fR or \fB>\fR from
587 interpretation by the shell.)
588 .IP
589 If no \fIcolumn\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR arguments are given,
590 this command waits only until \fIrecord\fR exists.  If more than one
591 such argument is given, the command waits until all of them are
592 satisfied.
593 .IP
594 Usually \fBwait\-until\fR should be placed at the beginning of a set
595 of \fBovs\-vsctl\fR commands.  For example, \fBwait\-until bridge br0
596 \-\- get bridge br0 datapath_id\fR waits until a bridge named
597 \fBbr0\fR is created, then prints its \fBdatapath_id\fR column,
598 whereas \fBget bridge br0 datapath_id \-\- wait\-until bridge br0\fR
599 will abort if no bridge named \fBbr0\fR exists when \fBovs\-vsctl\fR
600 initially connects to the database.
601 .IP
602 Consider specifying \fB\-\-timeout=0\fR along with
603 \fB\-\-wait\-until\fR, to prevent \fBovs\-vsctl\fR from terminating
604 after waiting only at most 5 seconds.
605 .SH "EXAMPLES"
606 Create a new bridge named br0 and add port eth0 to it:
607 .IP
608 .B "ovs\-vsctl add\-br br0"
609 .br
610 .B "ovs\-vsctl add\-port br0 eth0"
611 .PP
612 Alternatively, perform both operations in a single atomic transaction:
613 .IP 
614 .B "ovs\-vsctl add\-br br0 \-\- add\-port br0 eth0"
615 .PP
616 Delete bridge \fBbr0\fR, reporting an error if it does not exist:
617 .IP
618 .B "ovs\-vsctl del\-br br0"
619 .PP
620 Delete bridge \fBbr0\fR if it exists (the \fB\-\-\fR is required to
621 separate \fBdel\-br\fR's options from the global options):
622 .IP
623 .B "ovs\-vsctl \-\- \-\-if\-exists del\-br br0"
624 .PP
625 Set the \fBqos\fR column of the \fBPort\fR record for \fBeth0\fR to
626 point to a new \fBQoS\fR record, which in turn points with its queue 0
627 to a new \fBQueue\fR record:
628 .IP
629 .B "ovs\-vsctl \-\- set port eth0 qos=@newqos \-\- \-\-id=@newqos create qos type=linux\-htb other\-config:max\-rate=1000000 queues:0=@newqueue \-\- \-\-id=@newqueue create queue other\-config:min\-rate=1000000 other\-config:max\-rate=1000000"
630 .
631 .SH "EXIT STATUS"
632 .IP "0"
633 Successful program execution.
634 .IP "1"
635 Usage, syntax, or configuration file error.
636 .IP "2"
637 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
638 bridge that does not exist.
639 .SH "SEE ALSO"
640 .
641 .BR ovsdb\-server (1),
642 .BR ovs\-vswitchd (8).
643 \