ovsdb-server(1)

NAME
ovsdb-server - Open vSwitch database server

SYNOPSIS
ovsdb-server [database]... [--remote=remote]... [--run=command]

DESCRIPTION
The ovsdb-server program provides RPC interfaces to one or more Open vSwitch databases (OVSDBs). It supports JSON-RPC client connections over active or passive TCP/IP or Unix domain sockets.

Each OVSDB file may be specified on the command line as database. If none is specified, the default is @DBDIR@/conf.db. The database files must already have been created and initialized using, for example, ovsdb-tool create.

OPTIONS

--remote=remote
    Adds remote as a connection method used by ovsdb-server. remote must take one of the following forms:

    db:db,table,column
        Reads additional connection methods from column in all of the rows in table within db. As the contents of column changes, ovsdb-server also adds and drops connection methods accordingly.

        If column's type is string or set of strings, then the connection methods are taken directly from the column. The connection methods in the column must have one of the forms described above.

        If column's type is UUID or set of UUIDs and references a table, then each UUID is looked up in the referenced table to obtain a row. The following columns in the row, if present and of the correct type, configure a connection method. Any additional columns are ignored.

        target (string)
            Connection method, in one of the forms described above. This column is mandatory: if it is missing or empty then no connection method can be configured.

        max_backoff (integer)
            Maximum number of milliseconds to wait between connection attempts.

        inactivity_probe (integer)
            Maximum number of milliseconds of idle time on connection to client before sending an inactivity probe message.

        It is an error for column to have another type.

    To connect or listen on multiple connection methods, use multiple --remote options.

--run=command]
    Ordinarily ovsdb-server runs forever, or until it is told to exit (see RUNTIME MANAGEMENT COMMANDS below). With this option, ovsdb-server instead starts a shell subprocess running command. When the subprocess terminates, ovsdb-server also exits gracefully. If the subprocess exits normally with exit code 0, then ovsdb-server exits with exit code 0 also; otherwise, it exits with exit code 1.

    This option can be useful where a database server is needed only to run a single command, e.g.: ovsdb-server --remote=punix:socket --run='ovsdb-client dump unix:socket Open_vSwitch'

    This option is not supported on Windows platform.

  Daemon Options

  Service Options

  Logging Options

  Public Key Infrastructure Options
The options described below for configuring the SSL public key infrastructure accept a special syntax for obtaining their configuration from the database. If any of these options is given db:db,table,column as its argument, then the actual file name is read from the specified column in table within the db database. The column must have type string or set of strings. The first nonempty string in the table is taken as the file name. (This means that ordinarily there should be at most one row in table.)

  Other Options

RUNTIME MANAGEMENT COMMANDS
ovs-appctl(8) can send commands to a running ovsdb-server process. The currently supported commands are described below.

  OVSDB-SERVER COMMANDS
These commands are specific to ovsdb-server.

exit
    Causes ovsdb-server to gracefully terminate.

ovsdb-server/compact [db]...
    Compacts each database db in-place. If no db is specified, compacts every database in-place. Databases are also automatically compacted occasionally.

ovsdb-server/reconnect
    Makes ovsdb-server drop all of the JSON-RPC connections to database clients and reconnect.

    This command might be useful for debugging issues with database clients.

ovsdb-server/add-remote remote
    Adds a remote, as if --remote=remote had been specified on the ovsdb-server command line. (If remote is already a remote, this command succeeds without changing the configuration.)

ovsdb-server/remove-remote remote
    Removes the specified remote from the configuration, failing with an error if remote is not configured as a remote. This command only works with remotes that were named on --remote or ovsdb-server/add-remote, that is, it will not remove remotes added indirectly because they were read from the database by configuring a db:db,table,column remote. (You can remove a database source with ovsdb-server/remove-remote db:db,table,column, but not individual remotes found indirectly through the database.)

ovsdb-server/list-remotes
    Outputs a list of the currently configured remotes named on --remote or ovsdb-server/add-remote, that is, it does not list remotes added indirectly because they were read from the database by configuring a db:db,table,column remote.

ovsdb-server/add-db database
    Adds the database to the running ovsdb-server. The database file must already have been created and initialized using, for example, ovsdb-tool create.

ovsdb-server/remove-db database
    Removes database from the running ovsdb-server. database must be a database name as listed by ovsdb-server/list-dbs.

    If a remote has been configured that points to the specified database (e.g. --remote=db:database,... on the command line), then it will be disabled until another database with the same name is added again (with ovsdb-server/add-db).

    Any public key infrastructure options specified through this database (e.g. --private-key=db:database,... on the command line) will be disabled until another database with the same name is added again (with ovsdb-server/add-db).

ovsdb-server/list-dbs
    Outputs a list of the currently configured databases added either through the command line or through the ovsdb-server/add-db command.

SPECIFICATIONS

ovsdb-server implements the Open vSwitch Database (OVSDB) protocol specified in RFC 7047, with the following clarifications:

3.1. JSON Usage
    RFC 4627 says that names within a JSON object should be unique. The Open vSwitch JSON parser discards all but the last value for a name that is specified more than once.

    The definition of <error> allows for implementation extensions. Currently ovsdb-server uses the following additional "error" strings which might change in later releases):

    syntax error or unknown column
        The request could not be parsed as an OVSDB request. An additional "syntax" member, whose value is a string that contains JSON, may narrow down the particular syntax that could not be parsed.

    internal error
        The request triggered a bug in ovsdb-server.

    ovsdb error
        A map or set contains a duplicate key.

3.2. Schema Format
    RFC 7047 requires the "version" field in <database-schema>. Current versions of ovsdb-server allow it to be omitted (future versions are likely to require it).

4. Wire Protocol
    The original OVSDB specifications included the following reason, omitted from RFC 7047, to operate JSON-RPC directly over a stream instead of over HTTP:

    •   JSON-RPC is a peer-to-peer protocol, but HTTP is a client-server protocol, which is a poor match. Thus, JSON-RPC over HTTP requires the client to periodically poll the server to receive server requests.

    •   HTTP is more complicated than stream connections and doesn't provide any corresponding advantage.

    •   The JSON-RPC specification for HTTP transport is incomplete.

4.1.5. Monitor
    For backward compatibility, ovsdb-server currently permits a single <monitor-request> to be used instead of an array; it is treated as a single-element array. Future versions of ovsdb-server might remove this compatibility feature.

    Because the <json-value> parameter is used to match subsequent update notifications (see below) to the request, it must be unique among all active monitors. ovsdb-server rejects attempt to create two monitors with the same identifier.

5.1. Notation
    For <condition>, RFC 7047 only allows the use of !=, ==, includes, and excludes operators with set types. Open vSwitch 2.4 and later extend <condition> to allow the use of <, <=, >=, and > operators with columns with type ``set of 0 or 1 integer'' and ``set of 0 or 1 real''. These conditions evaluate to false when the column is empty, and otherwise as described in RFC 7047 for integer and real types.

BUGS
In Open vSwitch before version 2.4, when ovsdb-server sent JSON-RPC error responses to some requests, it incorrectly formulated them with the result and error swapped, so that the response appeared to indicate success (with a nonsensical result) rather than an error. The requests that suffered from this problem were:

transact
    Only if the request names a nonexistent database.

monitor
    In all error cases.

Of these cases, the only error that a well-written application is likely to encounter in practice is monitor of tables or columns that do not exist, in an situation where the application has been upgraded but the old database schema is still temporarily in use. To handle this situation gracefully, we recommend that clients should treat a monitor response with a result that contains an error key-value pair as an error (assuming that the database being monitored does not contain a table named error).

SEE ALSO
ovsdb-tool(1).