ovs-vsctl: New commands for working with external IDs.
[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] \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 .
33 .SS "Linux VLAN Bridging Compatibility"
34 The \fBovs\-vsctl\fR program supports the model of a bridge
35 implemented by Open vSwitch, in which a single bridge supports ports
36 on multiple VLANs.  In this model, each port on a bridge is either a
37 trunk port that potentially passes packets tagged with 802.1Q headers
38 that designate VLANs or it is assigned a single implicit VLAN that is
39 never tagged with an 802.1Q header.
40 .PP
41 For compatibility with software designed for the Linux bridge,
42 \fBovs\-vsctl\fR also supports a model in which traffic associated
43 with a given 802.1Q VLAN is segregated into a separate bridge.  A
44 special form of the \fBadd\-br\fR command (see below) creates a ``fake
45 bridge'' within an Open vSwitch bridge to simulate this behavior.
46 When such a ``fake bridge'' is active, \fBovs\-vsctl\fR will treat it
47 much like a bridge separate from its ``parent bridge,'' but the actual
48 implementation in Open vSwitch uses only a single bridge, with ports on
49 the fake bridge assigned the implicit VLAN of the fake bridge of which
50 they are members.
51 .
52 .SH OPTIONS
53 .
54 The following options affect the general outline of \fBovs\-vsctl\fR's
55 activities:
56 .
57 .IP "\fB\-\-db=\fIserver\fR"
58 Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR
59 contacts to query or modify configuration.  The default is
60 \fBunix:@RUNDIR@/ovsdb\-server\fR.  \fIserver\fR must take one of the
61 following forms:
62 .RS
63 .IP "\fBtcp:\fIip\fB:\fIport\fR"
64 Connect to the given TCP \fIport\fR on \fIip\fR.
65 .IP "\fBunix:\fIfile\fR"
66 Connect to the Unix domain server socket named \fIfile\fR.
67 .RE
68 .IP "\fB\-\-no\-wait\fR"
69 Prevents \fBovs\-vsctl\fR from waiting for \fBovs\-vswitchd\fR to
70 reconfigure itself according to the the modified database.  This
71 option should be used if \fBovs\-vswitchd\fR is not running;
72 otherwise, \fBovs-vsctl\fR will not exit until \fBovs-vswitchd\fR
73 starts.
74 .IP
75 This option has no effect if the commands specified do not change the
76 database.
77 .
78 .IP "\fB\-\-no\-syslog\fR"
79 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
80 changes that it makes to the system log.  This option disables this
81 logging.
82 .IP
83 This option is equivalent to \fB\-\-verbose=vvsctl:syslog:warn\fR.
84 .
85 .IP "\fB\-\-oneline\fR"
86 Modifies the output format so that the output for each command is printed
87 on a single line.  New-line characters that would otherwise separate
88 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
89 would otherwise appear in the output are doubled.
90 Prints a blank line for each command that has no output.
91 .
92 .so lib/vlog.man
93 .
94 .SH COMMANDS
95 The commands implemented by \fBovs\-vsctl\fR are described in the
96 sections below.
97 .
98 .SS "Bridge Commands"
99 These commands examine and manipulate Open vSwitch bridges.
100 .
101 .IP "\fBadd\-br \fIbridge\fR"
102 Creates a new bridge named \fIbridge\fR.  Initially the bridge will
103 have no ports (other than \fIbridge\fR itself).
104 .
105 .IP "\fBadd\-br \fIbridge parent vlan\fR"
106 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
107 vSwitch bridge \fIparent\fR, which must already exist and must not
108 itself be a fake bridge.  The new fake bridge will be on 802.1Q VLAN
109 \fIvlan\fR, which must be an integer between 1 and 4095.  Initially
110 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
111 .
112 .IP "\fBdel\-br \fIbridge\fR"
113 Deletes \fIbridge\fR and all of its ports.  If \fIbridge\fR is a real
114 bridge, this command also deletes any fake bridges that were created
115 with \fIbridge\fR as parent, including all of their ports.
116 .
117 .IP "\fBlist\-br\fR"
118 Lists all existing real and fake bridges on standard output, one per
119 line.
120 .
121 .IP "\fBbr\-exists \fIbridge\fR"
122 Tests whether \fIbridge\fR exists as a real or fake bridge.  If so,
123 \fBovs\-vsctl\fR exits successfully with exit code 0.  If not,
124 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
125 .
126 .IP "\fBbr\-to\-vlan \fIbridge\fR"
127 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
128 decimal integer.  If \fIbridge\fR is a real bridge, prints 0.
129 .
130 .IP "\fBbr\-to\-parent \fIbridge\fR"
131 If \fIbridge\fR is a fake bridge, prints the name of its parent
132 bridge.  If \fIbridge\fR is a real bridge, print \fIbridge\fR.
133 .
134 .IP "\fBbr\-set\-external\-id \fIbridge key\fR [\fIvalue\fR]"
135 Sets or clears an ``external ID'' value on \fIbridge\fR.  These values
136 are intended to identify entities external to Open vSwitch with which
137 \fIbridge\fR is associated, e.g. the bridge's identifier in a
138 virtualization management platform.  The Open vSwitch database schema
139 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
140 are otherwise arbitrary strings.
141 .IP
142 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
143 \fIbridge\fR, overwriting any previous value.  If \fIvalue\fR is
144 omitted, then \fIkey\fR is removed from \fIbridge\fR's set of external
145 IDs (if it was present).
146 .
147 .IP "\fBbr\-get\-external\-id \fIbridge\fR [\fIkey\fR]"
148 Queries the external IDs on \fIbridge\fR.  If \fIkey\fR is specified,
149 the output is the value for that \fIkey\fR or the empty string if
150 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
151 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
152 .
153 .SS "Port Commands"
154 .
155 These commands examine and manipulate Open vSwitch ports.  These
156 commands treat a bonded port as a single entity.
157 .
158 .IP "\fBlist\-ports \fIbridge\fR"
159 Lists all of the ports within \fIbridge\fR on standard output, one per
160 line.  The local port \fIbridge\fR is not included in the list.
161 .
162 .IP "\fBadd\-port \fIbridge port\fR"
163 Creates on \fIbridge\fR a new port named \fIport\fR from the network
164 device of the same name.
165 .
166 .IP "\fBadd\-bond \fIbridge port iface\fR\&..."
167 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
168 together the network devices given as each \fIiface\fR.  At least two
169 interfaces must be named.
170 .
171 .IP "\fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
172 Deletes \fIport\fR.  If \fIbridge\fR is omitted, \fIport\fR is removed
173 from whatever bridge contains it; if \fIbridge\fR is specified, it
174 must be the real or fake bridge that contains \fIport\fR.
175 .
176 .IP "\fBport\-to\-br \fIport\fR"
177 Prints the name of the bridge that contains \fIport\fR on standard
178 output.
179 .
180 .IP "\fBport\-set\-external\-id \fIport key\fR [\fIvalue\fR]"
181 Sets or clears an ``external ID'' value on \fIport\fR.  These value
182 are intended to identify entities external to Open vSwitch with which
183 \fIport\fR is associated, e.g. the port's identifier in a
184 virtualization management platform.  The Open vSwitch database schema
185 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
186 are otherwise arbitrary strings.
187 .IP
188 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
189 \fIport\fR, overwriting any previous value.  If \fIvalue\fR is
190 omitted, then \fIkey\fR is removed from \fIport\fR's set of external
191 IDs (if it was present).
192 .
193 .IP "\fBbr\-get\-external\-id \fIport\fR [\fIkey\fR]"
194 Queries the external IDs on \fIport\fR.  If \fIkey\fR is specified,
195 the output is the value for that \fIkey\fR or the empty string if
196 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
197 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
198 .
199 .SS "Interface Commands"
200 .
201 These commands examine the interfaces attached to an Open vSwitch
202 bridge.  These commands treat a bonded port as a collection of two or
203 more interfaces, rather than as a single port.
204 .
205 .IP "\fBlist\-ifaces \fIbridge\fR"
206 Lists all of the interfaces within \fIbridge\fR on standard output,
207 one per line.  The local port \fIbridge\fR is not included in the
208 list.
209 .
210 .IP "\fBiface\-to\-br \fIiface\fR"
211 Prints the name of the bridge that contains \fIiface\fR on standard
212 output.
213 .
214 .IP "\fBiface\-set\-external\-id \fIiface key\fR [\fIvalue\fR]"
215 Sets or clears an ``external ID'' value on \fIiface\fR.  These value
216 are intended to identify entities external to Open vSwitch with which
217 \fIiface\fR is associated, e.g. the interface's identifier in a
218 virtualization management platform.  The Open vSwitch database schema
219 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
220 are otherwise arbitrary strings.
221 .IP
222 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
223 \fIiface\fR, overwriting any previous value.  If \fIvalue\fR is
224 omitted, then \fIkey\fR is removed from \fIiface\fR's set of external
225 IDs (if it was present).
226 .
227 .IP "\fBbr\-get\-external\-id \fIiface\fR [\fIkey\fR]"
228 Queries the external IDs on \fIiface\fR.  If \fIkey\fR is specified,
229 the output is the value for that \fIkey\fR or the empty string if
230 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
231 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
232 .
233 .SH "EXAMPLES"
234 Create a new bridge named br0 and add port eth0 to it:
235 .IP
236 .B "ovs-vsctl add\-br br0"
237 .br
238 .B "ovs-vsctl add\-port br0 eth0"
239 .PP
240 Alternatively, perform both operations in a single atomic transaction:
241 .IP 
242 .B "ovs-vsctl add\-br br0 \-\- add\-port br0 eth0"
243 .
244 .SH "EXIT STATUS"
245 .IP "0"
246 Successful program execution.
247 .IP "1"
248 Usage, syntax, or configuration file error.
249 .IP "2"
250 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
251 bridge that does not exist.
252 .SH "SEE ALSO"
253 .
254 .BR ovsdb\-server (1),
255 .BR ovs\-vswitchd (8).