1ovsdb-tool(1) Open vSwitch Manual ovsdb-tool(1)
2
3
4
6 ovsdb-tool - Open vSwitch database management utility
7
9 ovsdb-tool [options] create [db [schema]]
10 ovsdb-tool [options] compact [db [target]]
11 ovsdb-tool [options] convert [db [schema [target]]]
12 ovsdb-tool [options] needs-conversion [db [schema]]
13 ovsdb-tool [options] db-version [db]
14 ovsdb-tool [options] schema-version [schema]
15 ovsdb-tool [options] db-cksum [db]
16 ovsdb-tool [options] schema-cksum [schema]
17 ovsdb-tool [options] query [db] transaction
18 ovsdb-tool [options] transact [db] transaction
19 ovsdb-tool [options] [-m | --more]... show-log [db]
20 ovsdb-tool help
21
22 Logging options:
23 [-v[module[:facility[:level]]]]...
24 [--verbose[=module[:facility[:level]]]]...
25 [--log-file[=file]]
26
27 Common options:
28 [-h | --help] [-V | --version]
29
30
32 The ovsdb-tool program is a command-line tool for managing Open vSwitch
33 database (OVSDB) files. It does not interact directly with running
34 Open vSwitch database servers (instead, use ovsdb-client).
35
36 Basic Commands
37 create db schema
38 Reads an OVSDB schema from the file named schema and creates a
39 new OVSDB database file named db using that schema. The new
40 database is initially empty. This command will not overwrite an
41 existing db.
42
43 schema must contain an OVSDB schema in JSON format. Refer to
44 the OVSDB specification for details.
45
46 compact db [target]
47 Reads db and writes a compacted version. If target is speci‐
48 fied, the compacted version is written as a new file named tar‐
49 get, which must not already exist. If target is omitted, then
50 the compacted version of the database replaces db in-place.
51
52 convert db schema [target]
53 Reads db, translating it into to the schema specified in schema,
54 and writes out the new interpretation. If target is specified,
55 the translated version is written as a new file named target,
56 which must not already exist. If target is omitted, then the
57 translated version of the database replaces db in-place.
58
59 This command can do simple ``upgrades'' and ``downgrades'' on a
60 database's schema. The data in db must be valid when inter‐
61 preted under schema, with only one exception: data in db for
62 tables and columns that do not exist in schema are ignored.
63 Columns that exist in schema but not in db are set to their
64 default values. All of schema's constraints apply in full.
65
66 needs-conversion db schema
67 Reads the schema embedded in db and the standalone schema in
68 schema and compares them. If the schemas are the same, prints
69 no on stdout; if they differ, print yes.
70
71 db-version db
72 schema-version schema
73 Prints the version number in the schema embedded within the
74 database db or in the standalone schema schema on stdout. A
75 schema version number has the form x.y.z. See
76 ovs-vswitchd.conf.db(5) for details.
77
78 Schema version numbers and Open vSwitch version numbers are
79 independent.
80
81 If schema or db was created before schema versioning was intro‐
82 duced, then it will not have a version number and this command
83 will print a blank line.
84
85 db-cksum db
86 schema-cksum schema
87 Prints the checksum in the schema embedded within the database
88 db or of the standalone schema schema on stdout.
89
90 If schema or db was created before schema checksums were intro‐
91 duced, then it will not have a checksum and this command will
92 print a blank line.
93
94 query db transaction
95 Opens db, executes transaction on it, and prints the results.
96 The transaction must be a JSON array in the format of the params
97 array for the JSON-RPC transact method, as described in the
98 OVSDB specification.
99
100 The db is opened for read-only access, so this command may
101 safely run concurrently with other database activity, including
102 ovsdb-server and other database writers. The transaction may
103 specify database modifications, but these will have no effect on
104 db.
105
106 transact db transaction
107 Opens db, executes transaction on it, prints the results, and
108 commits any changes to db. The transaction must be a JSON array
109 in the format of the params array for the JSON-RPC transact
110 method, as described in the OVSDB specification.
111
112 The db is opened and locked for read/write access, so this com‐
113 mand will fail if the database is opened for writing by any
114 other process, including ovsdb-server(1). Use ovsdb-client(1),
115 instead, to write to a database that is served by
116 ovsdb-server(1).
117
118 show-log db
119 Prints a summary of the records in db's log, including the time
120 and date at which each database change occurred and any associ‐
121 ated comment. This may be useful for debugging.
122
123 To increase the verbosity of output, add -m (or --more) one or
124 more times to the command line. With one -m, show-log prints a
125 summary of the records added, deleted, or modified by each
126 transaction. With two -ms, show-log also prints the values of
127 the columns modified by each change to a record.
128
130 Logging Options
131 -v[spec]
132 --verbose=[spec]
133 Sets logging levels. Without any spec, sets the log level for
134 every module and facility to dbg. Otherwise, spec is a list of
135 words separated by spaces or commas or colons, up to one from
136 each category below:
137
138 · A valid module name, as displayed by the vlog/list com‐
139 mand on ovs-appctl(8), limits the log level change to the
140 specified module.
141
142 · syslog, console, or file, to limit the log level change
143 to only to the system log, to the console, or to a file,
144 respectively.
145
146 · off, emer, err, warn, info, or dbg, to control the log
147 level. Messages of the given severity or higher will be
148 logged, and messages of lower severity will be filtered
149 out. off filters out all messages. See ovs-appctl(8)
150 for a definition of each log level.
151
152 Case is not significant within spec.
153
154 Regardless of the log levels set for file, logging to a file
155 will not take place unless --log-file is also specified (see
156 below).
157
158 For compatibility with older versions of OVS, any is accepted as
159 a word but has no effect.
160
161 -v
162 --verbose
163 Sets the maximum logging verbosity level, equivalent to --ver‐
164 bose=dbg.
165
166 --log-file[=file]
167 Enables logging to a file. If file is specified, then it is
168 used as the exact name for the log file. The default log file
169 name used if file is omitted is /var/log/open‐
170 vswitch/ovsdb-tool.log.
171
172 Other Options
173 -h
174 --help Prints a brief help message to the console.
175
176 -V
177 --version
178 Prints version information to the console.
179
181 The default db is /etc/openvswitch/conf.db. The default schema is
182 /usr/share/openvswitch/vswitch.ovsschema. The help command also dis‐
183 plays these defaults.
184
186 ovsdb-server(1), ovsdb-client(1), and the OVSDB specification.
187
188
189
190Open vSwitch 2.0.0 ovsdb-tool(1)