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