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