ovn-sbctl

title: ovn-sbctl(8)

text:
# ovn-sbctl(8)

## NAME
ovn-sbctl - Open Virtual Network southbound db management utility

## SYNOPSIS
ovn-sbctl [options] command [arg...]

## DESCRIPTION
The ovn-sbctl program configures the OVN_Southbound database by providing a high-level interface to its configuration database. See ovn-sb(5) for comprehensive documentation of the database schema.

ovn-sbctl connects to an ovsdb-server process that maintains an OVN_Southbound configuration database. Using this connection, it queries and possibly applies changes to the database, depending on the supplied commands.

ovn-sbctl can perform any number of commands in a single run, implemented as a single atomic transaction against the database.

The ovn-sbctl command line begins with global options (see OPTIONS below for details). The global options are followed by one or more commands. Each command should begin with -- by itself as a command-line argument, to separate it from the following commands. (The -- before the first command is optional.) The command itself starts with command-specific options, if any, followed by the command name and any arguments.

## DAEMON MODE
When it is invoked in the most ordinary way, ovn-sbctl connects to an OVSDB server that hosts the southbound database, retrieves a partial copy of the database that is complete enough to do its work, sends a transaction request to the server, and receives and processes the server’s reply. In common interactive use, this is fine, but if the database is large, the step in which ovn-sbctl retrieves a partial copy of the database can take a long time, which yields poor performance overall.

To improve performance in such a case, ovn-sbctl offers a "daemon mode," in which the user first starts ovn-sbctl running in the background and afterward uses the daemon to execute operations. Over several ovn-sbctl command invocations, this performs better overall because it retrieves a copy of the database only once at the beginning, not once per program run.

Use the --detach option to start an ovn-sbctl daemon. With this option, ovn-sbctl prints the name of a control socket to stdout. The client should save this name in environment variable OVN_SB_DAEMON. Under the Bourne shell this might be done like this:

```
      export OVN_SB_DAEMON=$(ovn-sbctl --pidfile --detach)

```

When OVN_SB_DAEMON is set, ovn-sbctl automatically and transparently uses the daemon to execute its commands.

When the daemon is no longer needed, kill it and unset the environment variable, e.g.:

```
      kill $(cat $OVN_RUNDIR/ovn-sbctl.pid)

      unset OVN_SB_DAEMON

```

When using daemon mode, an alternative to the OVN_SB_DAEMON environment variable is to specify a path for the Unix socket. When starting the ovn-sbctl daemon, specify the -u option with a full path to the location of the socket file. Here is an exmple:

```
      ovn-sbctl --detach -u /tmp/mysock.ctl

```

Then to connect to the running daemon, use the -u option with the full path to the socket created when the daemon was started:

```
      ovn-sbctl -u /tmp/mysock.ctl show

```

Daemon Commands

Daemon mode is internally implemented using the same mechanism used by ovn-appctl. One may also use ovn-appctl directly with the following commands:

run [options] command [arg...] [-- [options] command [arg...] ...]

Instructs the daemon process to run one or more ovn-sbctl commands described above and reply with the results of running these commands. Accepts the --timeout, --dry-run, --oneline, and the options described under Table Formatting Options in addition to the the command-specific options.

exit

Causes ovn-sbctl to gracefully terminate.

## OPTIONS
The options listed below affect the behavior of ovn-sbctl as a whole. Some individual commands also accept their own options, which are given just before the command name. If the first command on the command line has options, then those options must be separated from the global options by --.

ovn-sbctl also accepts options from the OVN_SBCTL_OPTIONS environment variable, in the same format as on the command line. Options from the command line override those in the environment.

--db database

The OVSDB database remote to contact. If the OVN_SB_DB environment variable is set, its value is used as the default. Otherwise, the default is unix:/ovnsb_db.sock, but this default is unlikely to be useful outside of single-machine OVN test environments.

--leader-only

--no-leader-only

By default, or with --leader-only, when the database server is a clustered database, ovn-sbctl will avoid servers other than the cluster leader. This ensures that any data that ovn-sbctl reads and reports is up-to-date. With --no-leader-only, ovn-sbctl will use any server in the cluster, which means that for read-only transactions it can report and act on stale data (transactions that modify the database are always serialized even with --no-leader-only). Refer to Understanding Cluster Consistency in ovsdb(7) for more information.

--shuffle-remotes

--no-shuffle-remotes

By default, or with --shuffle-remotes, when there are multiple remotes specified in the OVSDB connection string specified by --db or the OVN_SB_DB environment variable, the order of the remotes will be shuffled before the client tries to connect. The remotes will be shuffled only once to a new order before the first connection attempt. The following retries, if any, will follow the same new order. The default behavior is to make sure clients of a clustered database can distribute evenly to all members of the cluster. With --no-shuffle-remotes, ovn-sbctl will use the original order specified in the connection string to connect. This allows user to specify the preferred order, which is particularly useful for testing.

--no-syslog

By default, ovn-sbctl logs its arguments and the details of any changes that it makes to the system log. This option disables this logging.

This option is equivalent to --verbose=sbctl:syslog:warn.

--oneline

Modifies the output format so that the output for each command is printed on a single line. New-line characters that would otherwise separate lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that would otherwise appear in the output are doubled. Prints a blank line for each command that has no output. This option does not affect the formatting of output from the list or find commands; see Table Formatting Options below.

--dry-run

Prevents ovn-sbctl from actually modifying the database.

-t secs

--timeout=secs

By default, or with a secs of 0, ovn-sbctl waits forever for a response from the database. This option limits runtime to approximately secs seconds. If the timeout expires, ovn-sbctl will exit with a SIGALRM signal. (A timeout would normally happen only if the database cannot be contacted, or if the system is overloaded.)

### Daemon Options
--pidfile[=pidfile]

Causes a file (by default, program.pid) to be created indicating the PID of the running process. If the pidfile argument is not specified, or if it does not begin with /, then it is created in .

If --pidfile is not specified, no pidfile is created.

--overwrite-pidfile

By default, when --pidfile is specified and the specified pidfile already exists and is locked by a running process, the daemon refuses to start. Specify --overwrite-pidfile to cause it to instead overwrite the pidfile.

When --pidfile is not specified, this option has no effect.

--detach

Runs this program as a background process. The process forks, and in the child it starts a new session, closes the standard file descriptors (which has the side effect of disabling logging to the console), and changes its current directory to the root (unless --no-chdir is specified). After the child completes its initialization, the parent exits.

--monitor

Creates an additional process to monitor this program. If it dies due to a signal that indicates a programming error (SIGABRT, SIGALRM, SIGBUS, SIGFPE, SIGILL, SIGPIPE, SIGSEGV, SIGXCPU, or SIGXFSZ) then the monitor process starts a new copy of it. If the daemon dies or exits for another reason, the monitor process exits.

This option is normally used with --detach, but it also functions without it.

--no-chdir

By default, when --detach is specified, the daemon changes its current working directory to the root directory after it detaches. Otherwise, invoking the daemon from a carelessly chosen directory would prevent the administrator from unmounting the file system that holds that directory.

Specifying --no-chdir suppresses this behavior, preventing the daemon from changing its current working directory. This may be useful for collecting core files, since it is common behavior to write core dumps into the current working directory and the root directory is not a good directory to use.

This option has no effect when --detach is not specified.

--no-self-confinement

By default this daemon will try to self-confine itself to work with files under well-known directories determined at build time. It is better to stick with this default behavior and not to use this flag unless some other Access Control is used to confine daemon. Note that in contrast to other access control implementations that are typically enforced from kernel-space (e.g. DAC or MAC), self-confinement is imposed from the user-space daemon itself and hence should not be considered as a full confinement strategy, but instead should be viewed as an additional layer of security.

--user=user:group

Causes this program to run as a different user specified in user:group, thus dropping most of the root privileges. Short forms user and :group are also allowed, with current user or group assumed, respectively. Only daemons started by the root user accepts this argument.

On Linux, daemons will be granted CAP_IPC_LOCK and CAP_NET_BIND_SERVICES before dropping root privileges. Daemons that interact with a datapath, such as ovs-vswitchd, will be granted three additional capabilities, namely CAP_NET_ADMIN, CAP_NET_BROADCAST and CAP_NET_RAW. The capability change will apply even if the new user is root.

On Windows, this option is not currently supported. For security reasons, specifying this option will cause the daemon process not to start.

### Logging options
-v[spec]

--verbose=[spec]

Sets logging levels. Without any spec, sets the log level for every module and destination to dbg. Otherwise, spec is a list of words separated by spaces or commas or colons, up to one from each category below:

- A valid module name, as displayed by the vlog/list command on ovs-appctl(8), limits the log level change to the specified module.

- syslog, console, or file, to limit the log level change to only to the system log, to the console, or to a file, respectively. (If --detach is specified, the daemon closes its standard file descriptors, so logging to the console will have no effect.)

On Windows platform, syslog is accepted as a word and is only useful along with the --syslog-target option (the word has no effect otherwise).

•

off, emer, err, warn, info, or dbg, to control the log level. Messages of the given severity or higher will be logged, and messages of lower severity will be filtered out. off filters out all messages. See ovs-appctl(8) for a definition of each log level.

Case is not significant within spec.

Regardless of the log levels set for file, logging to a file will not take place unless --log-file is also specified (see below).

For compatibility with older versions of OVS, any is accepted as a word but has no effect.

-v

--verbose

Sets the maximum logging verbosity level, equivalent to --verbose=dbg.

-vPATTERN:destination:pattern

--verbose=PATTERN:destination:pattern

Sets the log pattern for destination to pattern. Refer to ovs-appctl(8) for a description of the valid syntax for pattern.

-vFACILITY:facility

--verbose=FACILITY:facility

Sets the RFC5424 facility of the log message. facility can be one of kern, user, mail, daemon, auth, syslog, lpr, news, uucp, clock, ftp, ntp, audit, alert, clock2, local0, local1, local2, local3, local4, local5, local6 or local7. If this option is not specified, daemon is used as the default for the local system syslog and local0 is used while sending a message to the target provided via the --syslog-target option.

--log-file[=file]

Enables logging to a file. If file is specified, then it is used as the exact name for the log file. The default log file name used if file is omitted is /var/log/ovn/program.log.

--syslog-target=host:port

Send syslog messages to UDP port on host, in addition to the system syslog. The host must be a numerical IP address, not a hostname.

--syslog-method=method

Specify method as how syslog messages should be sent to syslog daemon. The following forms are supported:

- libc, to use the libc syslog() function. Downside of using this options is that libc adds fixed prefix to every message before it is actually sent to the syslog daemon over /dev/log UNIX domain socket.

- unix:file, to use a UNIX domain socket directly. It is possible to specify arbitrary message format with this option. However, rsyslogd 8.9 and older versions use hard coded parser function anyway that limits UNIX domain socket use. If you want to use arbitrary message format with older rsyslogd versions, then use UDP socket to localhost IP address instead.

- udp:ip:port, to use a UDP socket. With this method it is possible to use arbitrary message format also with older rsyslogd. When sending syslog messages over UDP socket extra precaution needs to be taken into account, for example, syslog daemon needs to be configured to listen on the specified UDP port, accidental iptables rules could be interfering with local syslog traffic and there are some security considerations that apply to UDP sockets, but do not apply to UNIX domain sockets.

- null, to discard all messages logged to syslog.

The default is taken from the OVS_SYSLOG_METHOD environment variable; if it is unset, the default is libc.

### Table Formatting Options
These options control the format of output from the list and find commands.

-f format

--format=format

Sets the type of table formatting. The following types of format are available:

table

2-D text tables with aligned columns.

list (default)

A list with one column per line and rows separated by a blank line.

html

HTML tables.

csv

Comma-separated values as defined in RFC 4180.

json

JSON format as defined in RFC 4627. The output is a sequence of JSON objects, each of which corresponds to one table. Each JSON object has the following members with the noted values:

caption

The table’s caption. This member is omitted if the table has no caption.

headings

An array with one element per table column. Each array element is a string giving the corresponding column’s heading.

data

An array with one element per table row. Each element is also an array with one element per table column. The elements of this second-level array are the cells that constitute the table. Cells that represent OVSDB data or data types are expressed in the format described in the OVSDB specification; other cells are simply expressed as text strings.

-d format

--data=format

Sets the formatting for cells within output tables unless the table format is set to json, in which case json formatting is always used when formatting cells. The following types of format are available:

string (default)

The simple format described in the Database Values section of ovs-vsctl(8).

bare

The simple format with punctuation stripped off: [] and {} are omitted around sets, maps, and empty columns, items within sets and maps are space-separated, and strings are never quoted. This format may be easier for scripts to parse.

json

The RFC 4627 JSON format as described above.

--no-headings

This option suppresses the heading row that otherwise appears in the first row of table output.

--pretty

By default, JSON in output is printed as compactly as possible. This option causes JSON in output to be printed in a more readable fashion. Members of objects and elements of arrays are printed one per line, with indentation.

This option does not affect JSON in tables, which is always printed compactly.

--bare

Equivalent to --format=list --data=bare --no-headings.

### PKI Options
PKI configuration is required to use SSL for the connection to the database.

-p privkey.pem

--private-key=privkey.pem

Specifies a PEM file containing the private key used as identity for outgoing SSL connections.

-c cert.pem

--certificate=cert.pem

Specifies a PEM file containing a certificate that certifies the private key specified on -p or --private-key to be trustworthy. The certificate must be signed by the certificate authority (CA) that the peer in SSL connections will use to verify it.

-C cacert.pem

--ca-cert=cacert.pem

Specifies a PEM file containing the CA certificate for verifying certificates presented to this program by SSL peers. (This may be the same certificate that SSL peers use to verify the certificate specified on -c or --certificate, or it may be a different one, depending on the PKI design in use.)

-C none

--ca-cert=none

Disables verification of certificates presented by SSL peers. This introduces a security risk, because it means that certificates cannot be verified to be those of known trusted hosts.

--bootstrap-ca-cert=cacert.pem

When cacert.pem exists, this option has the same effect as -C or --ca-cert. If it does not exist, then the executable will attempt to obtain the CA certificate from the SSL peer on its first SSL connection and save it to the named PEM file. If it is successful, it will immediately drop the connection and reconnect, and from then on all SSL connections must be authenticated by a certificate signed by the CA certificate thus obtained.

This option exposes the SSL connection to a man-in-the-middle attack obtaining the initial CA certificate, but it may be useful for bootstrapping.

This option is only useful if the SSL peer sends its CA certificate as part of the SSL certificate chain. The SSL protocol does not require the server to send the CA certificate.

This option is mutually exclusive with -C and --ca-cert.

### Other Options
-h

--help

Prints a brief help message to the console.

-V

--version

Prints version information to the console.

## COMMANDS
The following sections describe the commands that ovn-sbctl supports.

### OVN_Southbound Commands
These commands work with an OVN_Southbound database as a whole.

init

Initializes the database, if it is empty. If the database has already been initialized, this command has no effect.

show

Prints a brief overview of the database contents.

### Chassis Commands
These commands manipulate OVN_Southbound chassis.

[--may-exist] chassis-add chassis encap-type encap-ip

Creates a new chassis named chassis. encap-type is a comma-separated list of tunnel types. The chassis will have one encap entry for each specified tunnel type with encap-ip as the destination IP for each.

Without --may-exist, attempting to create a chassis that exists is an error. With --may-exist, this command does nothing if chassis already exists.

[--if-exists] chassis-del chassis

Deletes chassis and its encaps and gateway_ports.

Without --if-exists, attempting to delete a chassis that does not exist is an error. With --if-exists attempting to delete a chassis that does not exist has no effect.

### Port Binding Commands
These commands manipulate OVN_Southbound port bindings.

[--may-exist] lsp-bind logical-port chassis

Binds the logical port named logical-port to chassis.

Without --may-exist, attempting to bind a logical port that has already been bound is an error. With --may-exist, this command does nothing if logical-port has already been bound to a chassis.

[--if-exists] lsp-unbind logical-port

Removes the binding of logical-port.

Without --if-exists, attempting to unbind a logical port that is not bound is an error. With --if-exists, attempting to unbind logical port that is not bound has no effect.

### Logical Flow Commands
[--uuid] [--ovs[=remote]] [--stats] [--vflows] lflow-list [logical-datapath] [lflow...]

List logical flows. If logical-datapath is specified, only list flows for that logical datapath. The logical-datapath may be given as a UUID or as a datapath name (reporting an error if multiple datapaths have the same name).

If at least one lflow is given, only matching logical flows, if any, are listed. Each lflow may be specified as a UUID or the first few characters of a UUID, optionally prefixed by 0x. (Because ovn-controller sets OpenFlow flow cookies to the first 32 bits of the corresponding logical flow’s UUID, this makes it easy to look up the logical flow that generated a particular OpenFlow flow.)

If --uuid is specified, the output includes the first 32 bits of each logical flow’s UUID. This makes it easier to find the OpenFlow flows that correspond to a given logical flow.

If --ovs is included, ovn-sbctl attempts to obtain and display the OpenFlow flows that correspond to each OVN logical flow. To do so, ovn-sbctl connects to remote (by default, unix:/br-int.mgmt) over OpenFlow and retrieves the flows. If remote is specified, it must be an active OpenFlow connection method described in ovsdb(7). Please see the discussion of the similar --ovs option in ovn-trace(8) for more information about the OpenFlow flow output.

By default, OpenFlow flow output includes only match and actions. Add --stats to include all OpenFlow information, such as packet and byte counters, duration, and timeouts.

If --vflows is included, other southbound database records directly used for generating OpenFlow flows are also listed. This includes: port-bindings, mac-bindings, multicast-groups, chassis. The --ovs and --stats can also be used in conjunction with --vflows.

[--uuid] dump-flows [logical-datapath]

Alias for lflow-list.

count-flows [logical-datapath]

prints numbers of logical flows per table and per datapath.

### Remote Connectivity Commands
These commands manipulate the connections column in the SB_Global table and rows in the Connection table. When ovsdb-server is configured to use the connections column for OVSDB connections, this allows the administrator to use \fBovn\-sbctl\fR to configure database connections.

get-connection

Prints the configured connection(s).

del-connection

Deletes the configured connection(s).

[--inactivity-probe=msecs] set-connection target...

Sets the configured manager target or targets. Use --inactivity-probe=msecs to override the default idle connection inactivity probe time. Use 0 to disable inactivity probes.

### SSL Configuration Commands
When ovsdb-server is configured to connect using SSL, the following parameters are required:

private-key

Specifies a PEM file containing the private key used for SSL connections.

certificate

Specifies a PEM file containing a certificate, signed by the certificate authority (CA) used by the connection peers, that certifies the private key, identifying a trustworthy peer.

ca-cert

Specifies a PEM file containing the CA certificate used to verify that the connection peers are trustworthy.

These SSL settings apply to all SSL connections made by the southbound database server.

get-ssl

Prints the SSL configuration.

del-ssl

Deletes the current SSL configuration.

[--bootstrap] set-ssl private-key certificate ca-cert [ssl-protocol-list [ssl-cipher-list]]

Sets the SSL configuration.

### Database Commands
These commands query and modify the contents of ovsdb tables. They are a slight abstraction of the ovsdb interface and as such they operate at a lower level than other ovn-sbctl commands.

Identifying Tables, Records, and Columns

Each of these commands has a table parameter to identify a table within the database. Many of them also take a record parameter that identifies a particular record within a table. The record parameter may be the UUID for a record, which may be abbreviated to its first 4 (or more) hex digits, as long as that is unique. Many tables offer additional ways to identify records. Some commands also take column parameters that identify a particular field within the records in a table.

For a list of tables and their columns, see ovn-sb(5) or see the table listing from the --help option.

Record names must be specified in full and with correct capitalization, except that UUIDs may be abbreviated to their first 4 (or more) hex digits, as long as that is unique within the table. Names of tables and columns are not case-sensitive, and - and _ are treated interchangeably. Unique abbreviations of table and column names are acceptable, e.g. d or dhcp is sufficient to identify the DHCP_Options table.

Database Values

Each column in the database accepts a fixed type of data. The currently defined basic types, and their representations, are:

integer

A decimal integer in the range -2**63 to 2**63-1, inclusive.

real

A floating-point number.

Boolean

True or false, written true or false, respectively.

string

An arbitrary Unicode string, except that null bytes are not allowed. Quotes are optional for most strings that begin with an English letter or underscore and consist only of letters, underscores, hyphens, and periods. However, true and false and strings that match the syntax of UUIDs (see below) must be enclosed in double quotes to distinguish them from other basic types. When double quotes are used, the syntax is that of strings in JSON, e.g. backslashes may be used to escape special characters. The empty string must be represented as a pair of double quotes ("").

UUID

Either a universally unique identifier in the style of RFC 4122, e.g. f81d4fae-7dec-11d0-a765-00a0c91e6bf6, or an @name defined by a get or create command within the same ovs-vsctl invocation.

Multiple values in a single column may be separated by spaces or a single comma. When multiple values are present, duplicates are not allowed, and order is not important. Conversely, some database columns can have an empty set of values, represented as [], and square brackets may optionally enclose other non-empty sets or single values as well.

A few database columns are ``maps’’ of key-value pairs, where the key and the value are each some fixed database type. These are specified in the form key=value, where key and value follow the syntax for the column’s key type and value type, respectively. When multiple pairs are present (separated by spaces or a comma), duplicate keys are not allowed, and again the order is not important. Duplicate values are allowed. An empty map is represented as {}. Curly braces may optionally enclose non-empty maps as well (but use quotes to prevent the shell from expanding other-config={0=x,1=y} into other-config=0=x other-config=1=y, which may not have the desired effect).

Database Command Syntax

[--if-exists] [--columns=column[,column]...] list table [record]...

Lists the data in each specified record. If no records are specified, lists all the records in table.

If --columns is specified, only the requested columns are listed, in the specified order. Otherwise, all columns are listed, in alphabetical order by column name.

Without --if-exists, it is an error if any specified record does not exist. With --if-exists, the command ignores any record that does not exist, without producing any output.

[--columns=column[,column]...] find table [column[:key]=value]...

Lists the data in each record in table whose column equals value or, if key is specified, whose column contains a key with the specified value. The following operators may be used where = is written in the syntax summary:

= != < > <= >=

Selects records in which column[:key] equals, does not equal, is less than, is greater than, is less than or equal to, or is greater than or equal to value, respectively.

Consider column[:key] and value as sets of elements. Identical sets are considered equal. Otherwise, if the sets have different numbers of elements, then the set with more elements is considered to be larger. Otherwise, consider a element from each set pairwise, in increasing order within each set. The first pair that differs determines the result. (For a column that contains key-value pairs, first all the keys are compared, and values are considered only if the two sets contain identical keys.)

{=} {!=}

Test for set equality or inequality, respectively.

{<=}

Selects records in which column[:key] is a subset of value. For example, flood-vlans{<=}1,2 selects records in which the flood-vlans column is the empty set or contains 1 or 2 or both.

{<}

Selects records in which column[:key] is a proper subset of value. For example, flood-vlans{<}1,2 selects records in which the flood-vlans column is the empty set or contains 1 or 2 but not both.

{>=} {>}

Same as {<=} and {<}, respectively, except that the relationship is reversed. For example, flood-vlans{>=}1,2 selects records in which the flood-vlans column contains both 1 and 2.

The following operators are available only in Open vSwitch 2.16 and later:

{in}

Selects records in which every element in column[:key] is also in value. (This is the same as {<=}.)

{not-in}

Selects records in which every element in column[:key] is not in value.

For arithmetic operators (= != < > <= >=), when key is specified but a particular record’s column does not contain key, the record is always omitted from the results. Thus, the condition other-config:mtu!=1500 matches records that have a mtu key whose value is not 1500, but not those that lack an mtu key.

For the set operators, when key is specified but a particular record’s column does not contain key, the comparison is done against an empty set. Thus, the condition other-config:mtu{!=}1500 matches records that have a mtu key whose value is not 1500 and those that lack an mtu key.

Don’t forget to escape < or > from interpretation by the shell.

If --columns is specified, only the requested columns are listed, in the specified order. Otherwise all columns are listed, in alphabetical order by column name.

The UUIDs shown for rows created in the same ovs-vsctl invocation will be wrong.

[--if-exists] [--id=@name] get table record [column[:key]]...

Prints the value of each specified column in the given record in table. For map columns, a key may optionally be specified, in which case the value associated with key in the column is printed, instead of the entire map.

Without --if-exists, it is an error if record does not exist or key is specified, if key does not exist in record. With --if-exists, a missing record yields no output and a missing key prints a blank line.

If @name is specified, then the UUID for record may be referred to by that name later in the same ovs-vsctl invocation in contexts where a UUID is expected.

Both --id and the column arguments are optional, but usually at least one or the other should be specified. If both are omitted, then get has no effect except to verify that record exists in table.

--id and --if-exists cannot be used together.

[--if-exists] set table record column[:key]=value...

Sets the value of each specified column in the given record in table to value. For map columns, a key may optionally be specified, in which case the value associated with key in that column is changed (or added, if none exists), instead of the entire map.

Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.

[--if-exists] add table record column [key=]value...

Adds the specified value or key-value pair to column in record in table. If column is a map, then key is required, otherwise it is prohibited. If key already exists in a map column, then the current value is not replaced (use the set command to replace an existing value).

Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.

[--if-exists] remove table record column value...

[--if-exists] remove table record column key...

[--if-exists] remove table record column key=value... Removes the specified values or key-value pairs from column in record in table. The first form applies to columns that are not maps: each specified value is removed from the column. The second and third forms apply to map columns: if only a key is specified, then any key-value pair with the given key is removed, regardless of its value; if a value is given then a pair is removed only if both key and value match.

It is not an error if the column does not contain the specified key or value or pair.

Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.

[--if-exists] clear table record column...

Sets each column in record in table to the empty set or empty map, as appropriate. This command applies only to columns that are allowed to be empty.

Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.

[--id=(@name|uuid)] create table column[:key]=value...

Creates a new record in table and sets the initial values of each column. Columns not explicitly set will receive their default values. Outputs the UUID of the new row.

If @name is specified, then the UUID for the new row may be referred to by that name elsewhere in the same \*(PN invocation in contexts where a UUID is expected. Such references may precede or follow the create command.

If a valid uuid is specified, then it is used as the UUID of the new row.

Caution (ovs-vsctl as example)

Records in the Open vSwitch database are significant only when they can be reached directly or indirectly from the Open_vSwitch table. Except for records in the QoS or Queue tables, records that are not reachable from the Open_vSwitch table are automatically deleted from the database. This deletion happens immediately, without waiting for additional ovs-vsctl commands or other database activity. Thus, a create command must generally be accompanied by additional commands within the same ovs-vsctl invocation to add a chain of references to the newly created record from the top-level Open_vSwitch record. The EXAMPLES section gives some examples that show how to do this.

[--if-exists] destroy table record...

Deletes each specified record from table. Unless --if-exists is specified, each records must exist.

--all destroy table

Deletes all records from the table.

Caution (ovs-vsctl as example)

The destroy command is only useful for records in the QoS or Queue tables. Records in other tables are automatically deleted from the database when they become unreachable from the Open_vSwitch table. This means that deleting the last reference to a record is sufficient for deleting the record itself. For records in these tables, destroy is silently ignored. See the EXAMPLES section below for more information.

wait-until table record [column[:key]=value]...

Waits until table contains a record named record whose column equals value or, if key is specified, whose column contains a key with the specified value. This command supports the same operators and semantics described for the find command above.

If no column[:key]=value arguments are given, this command waits only until record exists. If more than one such argument is given, the command waits until all of them are satisfied.

Caution (ovs-vsctl as example)

Usually wait-until should be placed at the beginning of a set of ovs-vsctl commands. For example, wait-until bridge br0 -- get bridge br0 datapath_id waits until a bridge named br0 is created, then prints its datapath_id column, whereas get bridge br0 datapath_id -- wait-until bridge br0 will abort if no bridge named br0 exists when ovs-vsctl initially connects to the database.

Consider specifying --timeout=0 along with --wait-until, to prevent ovs-vsctl from terminating after waiting only at most 5 seconds.

comment [arg]...

This command has no effect on behavior, but any database log record created by the command will include the command and its arguments.

## ENVIRONMENT
OVN_SB_DAEMON

If set, this should name the Unix domain socket for an ovn-sbctl server process. See Daemon Mode, above, for more information.

OVN_SBCTL_OPTIONS

If set, a set of options for ovn-sbctl to apply automatically, in the same form as on the command line.

OVN_SB_DB

If set, the default database to contact when the --db option is not used.

## EXIT STATUS
0

Successful program execution.

1

Usage, syntax, or network error.

## SEE ALSO
ovn-sb(5), ovn-appctl(8).


ovn-trace

package: ovn

title: ovn-trace(8)

text:
# ovn-trace(8)

## NAME
ovn-trace - Open Virtual Network logical network tracing utility

## SYNOPSIS
ovn-trace [options] [datapath] microflow

ovn-trace [options] --detach

## DESCRIPTION
This utility simulates packet forwarding within an OVN logical network. It can be used to run through ``what-if’’ scenarios: if a packet originates at a logical port, what will happen to it and where will it ultimately end up? Users already familiar with the Open vSwitch ofproto/trace command described in ovs-vswitch(8) will find ovn-trace to be a similar tool for logical networks.

ovn-trace works by reading the Logical_Flow and other tables from the OVN southbound database (see ovn-sb(5)). It simulates a packet’s path through logical networks by repeatedly looking it up in the logical flow table, following the entire tree of possibilities.

ovn-trace simulates only the OVN logical network. It does not simulate the physical elements on which the logical network is layered. This means that, for example, it is unimportant how VMs are distributed among hypervisors, or whether their hypervisors are functioning and reachable, so ovn-trace will yield the same results regardless. There is one important exception: ovn-northd, the daemon that generates the logical flows that ovn-trace simulates, treats logical ports differently based on whether they are up or down. Thus, if you see surprising results, ensure that the ports involved in a simulation are up.

The simplest way to use ovn-trace is to provide the microflow (and optional datapath) arguments on the command line. In this case, it simulates the behavior of a single packet and exits. For an alternate usage model, see Daemon Mode below.

The optional datapath argument specifies the name of a logical datapath. Acceptable names are the name from the northbound Logical_Switch or Logical_Router table, the UUID of a record from one of those tables, or the UUID of a record from the southbound Datapath_Binding table. (The datapath is optional because ovn-trace can figure it out from the inport that the microflow matches.)

The microflow argument describes the packet whose forwarding is to be simulated, in the syntax of an OVN logical expression, as described in ovn-sb(5), to express constraints. The parser understands prerequisites; for example, if the expression refers to ip4.src, there is no need to explicitly state ip4 or eth.type == 0x800.

For reasonable L2 behavior, the microflow should include at least inport and eth.dst, plus eth.src if port security is enabled. For example:

```
    inport == "lp11" && eth.src == 00:01:02:03:04:05 && eth.dst == ff:ff:ff:ff:ff:ff

```

For reasonable L3 behavior, microflow should also include ip4.src and ip4.dst (or ip6.src and ip6.dst) and ip.ttl. For example:

```
    inport == "lp111" && eth.src == f0:00:00:00:01:11 && eth.dst == 00:00:00:00:ff:11

    && ip4.src == 192.168.11.1 && ip4.dst == 192.168.22.2 && ip.ttl == 64

```

Here’s an ARP microflow example:

```
    inport == "lp123"

    && eth.dst == ff:ff:ff:ff:ff:ff && eth.src == f0:00:00:00:01:11

    && arp.op == 1 && arp.sha == f0:00:00:00:01:11 && arp.spa == 192.168.1.11

    && arp.tha == ff:ff:ff:ff:ff:ff && arp.tpa == 192.168.2.22

```

ovn-trace will reject erroneous microflow expressions, which beyond syntax errors fall into two categories. First, they can be ambiguous. For example, tcp.src == 80 is ambiguous because it does not state IPv4 or IPv6 as the Ethernet type. ip4 && tcp.src > 1024 is also ambiguous because it does not constrain bits of tcp.src to particular values. Second, they can be contradictory, e.g. ip4 && ip6.

## OUTPUT
ovn-trace supports the three different forms of output, each described in a separate section below. Regardless of the selected output format, ovn-trace starts the output with a line that shows the microflow being traced in OpenFlow syntax.

### Detailed Output
The detailed form of output is also the default form. This form groups output into sections headed up by the ingress or egress pipeline being traversed. Each pipeline lists each table that was visited (by number and name), the ovn-northd source file and line number of the code that added the flow, the match expression and priority of the logical flow that was matched, and the actions that were executed.

The execution of OVN logical actions naturally forms a ``control stack’’ that resembles that of a program in conventional programming languages such as C or Java. Because the next action that calls into another logical flow table for a lookup is a recursive construct, OVN ``programs’’ in practice tend to form deep control stacks that, displayed in the obvious way using additional indentation for each level, quickly use up the horizontal space on all but the widest displays. To make detailed output more readable, without loss of generality, ovn-trace omits indentation for ``tail recursion,’’ that is, when next is the last action in a logical flow, it does not indent details of the next table lookup more deeply. Output still uses indentation when it is needed for clarity.

OVN ``programs’’ traces also tend to encounter long strings of logical flows with match expression 1 (which matches every packet) and the single action next;. These are uninteresting and merely clutter output, so ovn-trace omits them entirely even from detailed output.

The following excerpt from detailed ovn-trace output shows a section for a packet traversing the ingress pipeline of logical datapath ls1 with ingress logical port lp111. The packet matches a logical flow in table 0 (aka ls_in_port_sec_l2) with priority 50 and executes next(1); to pass to table 1. Tables 1 through 11 are trivial and omitted. In table 19 (aka ls_in_l2_lkup), the packet matches a flow with priority 50 based on its Ethernet destination address and the flow’s actions output the packet to the lrp11-attachement logical port.

```
    ingress(dp="ls1", inport="lp111")

    ---------------------------------

    0. ls_in_port_sec_l2: inport == "lp111", priority 50

    next(1);

    19. ls_in_l2_lkup: eth.dst == 00:00:00:00:ff:11, priority 50

    outport = "lrp11-attachment";

    output;

```

### Summary Output
Summary output includes the logical pipelines visited by a packet and the logical actions executed on it. Compared to the detailed output, however, it removes details of tables and logical flows traversed by a packet. It uses a format closer to that of a programming language and does not attempt to avoid indentation. The summary output equivalent to the above detailed output fragment is:

```
    ingress(dp="ls1", inport="lp111") {

    outport = "lrp11-attachment";

    output;

    ...

    };

```

### Minimal Output
Minimal output includes only actions that modify packet data (not including OVN registers or metadata such as outport) and output actions that actually deliver a packet to a logical port (excluding patch ports). The operands of actions that modify packet data are displayed reduced to constants, e.g. ip4.dst = reg0; might be show as ip4.dst = 192.168.0.1; if that was the value actually loaded. This yields output even simpler than the summary format. (Users familiar with Open vSwitch may recognize this as similar in spirit to the datapath actions listed at the bottom of ofproto/trace output.)

The minimal output format reflects the externally seen behavior of the logical networks more than it does the implementation. This makes this output format the most suitable for use in regression tests, because it is least likely to change when logical flow tables are rearranged without semantic change.

## STATEFUL ACTIONS
Some OVN logical actions use or update state that is not available in the southbound database. ovn-trace handles these actions as described below:

ct_next

By default ovn-trace treats flows as ``tracked’’ and ``established.’’ See the description of the --ct option for a way to override this behavior.

ct_dnat (without an argument)

Forks the pipeline. In one fork, advances to the next table as if next; were executed. The packet is not changed, on the assumption that no NAT state was available. In the other fork, the pipeline continues without change after the ct_dnat action.

ct_snat (without an argument)

This action distinguishes between gateway routers and distributed routers. A gateway router is defined as a logical datapath that contains an l3gateway port; any other logical datapath is a distributed router. On a gateway router, ct_snat; is treated as a no-op. On a distributed router, it is treated the same way as ct_dnat;.

ct_dnat(ip)

ct_snat(ip)

Forks the pipeline. In one fork, sets ip4.dst (or ip4.src) to ip and ct.dnat (or ct.snat) to 1 and advances to the next table as if next; were executed. In the other fork, the pipeline continues without change after the ct_dnat (or ct_snat) action.

ct_lb;

ct_lb(ip[:port]...);

Forks the pipeline. In one fork, sets ip4.dst (or ip6.dst) to one of the load-balancer addresses and the destination port to its associated port, if any, and sets ct.dnat to 1. With one or more arguments, gives preference to the address specified on --lb-dst, if any; without arguments, uses the address and port specified on --lb-dst. In the other fork, the pipeline continues without change after the ct_lb action.

ct_commit

put_arp

put_nd

These actions are treated as no-ops.

## DAEMON MODE
If ovn-trace is invoked with the --detach option (see Daemon Options, below), it runs in the background as a daemon and accepts commands from ovs-appctl (or another JSON-RPC client) indefinitely. The currently supported commands are described below.

trace [options] [datapath] microflow

Traces microflow through datapath and replies with the results of the trace. Accepts the options described under Trace Options below.

exit

Causes ovn-trace to gracefully terminate.

## OPTIONS

### Trace Options
--detailed

--summary

--minimal

These options control the form and level of detail in ovn-trace output. If more than one of these options is specified, all of the selected forms are output, in the order listed above, each headed by a banner line. If none of these options is given, --detailed is the default. See Output, above, for a description of each kind of output.

--all

Selects all three forms of output.

--ovs[=remote]

Makes ovn-trace attempt to obtain and display the OpenFlow flows that correspond to each OVN logical flow. To do so, ovn-trace connects to remote (by default, unix:/br-int.mgmt) over OpenFlow and retrieves the flows. If remote is specified, it must be an active OpenFlow connection method described in ovsdb(7).

To make the best use of the output, it is important to understand the relationship between logical flows and OpenFlow flows. ovn-architecture(7), under Architectural Physical Life Cycle of a Packet, describes this relationship. Keep in mind the following points:

- ovn-trace currently shows all the OpenFlow flows to which a logical flow corresponds, even though an actual packet ordinarily matches only one of these.

- Some logical flows can map to the Open vSwitch ``conjunctive match’’ extension (see ovs-fields(7)). Currently ovn-trace cannot display the flows with conjunction actions that effectively produce the conj_id match.

- Some logical flows may not be represented in the OpenFlow tables on a given hypervisor, if they could not be used on that hypervisor.

- Some OpenFlow flows do not correspond to logical flows, such as OpenFlow flows that map between physical and logical ports. These flows will never show up in a trace.

- When ovn-trace omits uninteresting logical flows from output, it does not look up the corresponding OpenFlow flows.

--ct=flags

This option sets the ct_state flags that a ct_next logical action will report. The flags must be a comma- or space-separated list of the following connection tracking flags:

- trk: Include to indicate connection tracking has taken place. (This bit is set automatically even if not listed in flags.

- new: Include to indicate a new flow.

- est: Include to indicate an established flow.

- rel: Include to indicate a related flow.

- rpl: Include to indicate a reply flow.

- inv: Include to indicate a connection entry in a bad state.

- dnat: Include to indicate a packet whose destination IP address has been changed.

- snat: Include to indicate a packet whose source IP address has been changed.

The ct_next action is used to implement the OVN distributed firewall. For testing, useful flag combinations include:

- trk,new: A packet in a flow in either direction through a firewall that has not yet been committed (with ct_commit).

- trk,est: A packet in an established flow going out through a firewall.

- trk,rpl: A packet coming in through a firewall in reply to an established flow.

- trk,inv: An invalid packet in either direction.

A packet might pass through the connection tracker twice in one trip through OVN: once following egress from a VM as it passes outward through a firewall, and once preceding ingress to a second VM as it passes inward through a firewall. Use multiple --ct options to specify the flags for multiple ct_next actions.

When --ct is unspecified, or when there are fewer --ct options than ct_next actions, the flags default to trk,est.

--lb-dst=ip[:port]

Sets the IP from VIP pool to use as destination of the packet. --lb-dst is not available in daemon mode.

--select-id=id

Specify the id to be selected by the select action. id must be one of the values listed in the select action. Otherwise, a random id is selected from the list, as if --select-id were not specified. --select-id is not available in daemon mode.

--friendly-names

--no-friendly-names

When cloud management systems such as OpenStack are layered on top of OVN, they often use long, human-unfriendly names for ports and datapaths, for example, ones that include entire UUIDs. They do usually include friendlier names, but the long, hard-to-read names are the ones that appear in matches and actions. By default, or with --friendly-names, ovn-trace substitutes these friendlier names for the long names in its output. Use --no-friendly-names to disable this behavior; this option might be useful, for example, if a program is going to parse ovn-trace output.

### Daemon Options
--pidfile[=pidfile]

Causes a file (by default, program.pid) to be created indicating the PID of the running process. If the pidfile argument is not specified, or if it does not begin with /, then it is created in .

If --pidfile is not specified, no pidfile is created.

--overwrite-pidfile

By default, when --pidfile is specified and the specified pidfile already exists and is locked by a running process, the daemon refuses to start. Specify --overwrite-pidfile to cause it to instead overwrite the pidfile.

When --pidfile is not specified, this option has no effect.

--detach

Runs this program as a background process. The process forks, and in the child it starts a new session, closes the standard file descriptors (which has the side effect of disabling logging to the console), and changes its current directory to the root (unless --no-chdir is specified). After the child completes its initialization, the parent exits.

--monitor

Creates an additional process to monitor this program. If it dies due to a signal that indicates a programming error (SIGABRT, SIGALRM, SIGBUS, SIGFPE, SIGILL, SIGPIPE, SIGSEGV, SIGXCPU, or SIGXFSZ) then the monitor process starts a new copy of it. If the daemon dies or exits for another reason, the monitor process exits.

This option is normally used with --detach, but it also functions without it.

--no-chdir

By default, when --detach is specified, the daemon changes its current working directory to the root directory after it detaches. Otherwise, invoking the daemon from a carelessly chosen directory would prevent the administrator from unmounting the file system that holds that directory.

Specifying --no-chdir suppresses this behavior, preventing the daemon from changing its current working directory. This may be useful for collecting core files, since it is common behavior to write core dumps into the current working directory and the root directory is not a good directory to use.

This option has no effect when --detach is not specified.

--no-self-confinement

By default this daemon will try to self-confine itself to work with files under well-known directories determined at build time. It is better to stick with this default behavior and not to use this flag unless some other Access Control is used to confine daemon. Note that in contrast to other access control implementations that are typically enforced from kernel-space (e.g. DAC or MAC), self-confinement is imposed from the user-space daemon itself and hence should not be considered as a full confinement strategy, but instead should be viewed as an additional layer of security.

--user=user:group

Causes this program to run as a different user specified in user:group, thus dropping most of the root privileges. Short forms user and :group are also allowed, with current user or group assumed, respectively. Only daemons started by the root user accepts this argument.

On Linux, daemons will be granted CAP_IPC_LOCK and CAP_NET_BIND_SERVICES before dropping root privileges. Daemons that interact with a datapath, such as ovs-vswitchd, will be granted three additional capabilities, namely CAP_NET_ADMIN, CAP_NET_BROADCAST and CAP_NET_RAW. The capability change will apply even if the new user is root.

On Windows, this option is not currently supported. For security reasons, specifying this option will cause the daemon process not to start.

### Logging Options
-v[spec]

--verbose=[spec]

Sets logging levels. Without any spec, sets the log level for every module and destination to dbg. Otherwise, spec is a list of words separated by spaces or commas or colons, up to one from each category below:

- A valid module name, as displayed by the vlog/list command on ovs-appctl(8), limits the log level change to the specified module.

- syslog, console, or file, to limit the log level change to only to the system log, to the console, or to a file, respectively. (If --detach is specified, the daemon closes its standard file descriptors, so logging to the console will have no effect.)

On Windows platform, syslog is accepted as a word and is only useful along with the --syslog-target option (the word has no effect otherwise).

•

off, emer, err, warn, info, or dbg, to control the log level. Messages of the given severity or higher will be logged, and messages of lower severity will be filtered out. off filters out all messages. See ovs-appctl(8) for a definition of each log level.

Case is not significant within spec.

Regardless of the log levels set for file, logging to a file will not take place unless --log-file is also specified (see below).

For compatibility with older versions of OVS, any is accepted as a word but has no effect.

-v

--verbose

Sets the maximum logging verbosity level, equivalent to --verbose=dbg.

-vPATTERN:destination:pattern

--verbose=PATTERN:destination:pattern

Sets the log pattern for destination to pattern. Refer to ovs-appctl(8) for a description of the valid syntax for pattern.

-vFACILITY:facility

--verbose=FACILITY:facility

Sets the RFC5424 facility of the log message. facility can be one of kern, user, mail, daemon, auth, syslog, lpr, news, uucp, clock, ftp, ntp, audit, alert, clock2, local0, local1, local2, local3, local4, local5, local6 or local7. If this option is not specified, daemon is used as the default for the local system syslog and local0 is used while sending a message to the target provided via the --syslog-target option.

--log-file[=file]

Enables logging to a file. If file is specified, then it is used as the exact name for the log file. The default log file name used if file is omitted is /var/log/ovn/program.log.

--syslog-target=host:port

Send syslog messages to UDP port on host, in addition to the system syslog. The host must be a numerical IP address, not a hostname.

--syslog-method=method

Specify method as how syslog messages should be sent to syslog daemon. The following forms are supported:

- libc, to use the libc syslog() function. Downside of using this options is that libc adds fixed prefix to every message before it is actually sent to the syslog daemon over /dev/log UNIX domain socket.

- unix:file, to use a UNIX domain socket directly. It is possible to specify arbitrary message format with this option. However, rsyslogd 8.9 and older versions use hard coded parser function anyway that limits UNIX domain socket use. If you want to use arbitrary message format with older rsyslogd versions, then use UDP socket to localhost IP address instead.

- udp:ip:port, to use a UDP socket. With this method it is possible to use arbitrary message format also with older rsyslogd. When sending syslog messages over UDP socket extra precaution needs to be taken into account, for example, syslog daemon needs to be configured to listen on the specified UDP port, accidental iptables rules could be interfering with local syslog traffic and there are some security considerations that apply to UDP sockets, but do not apply to UNIX domain sockets.

- null, to discard all messages logged to syslog.

The default is taken from the OVS_SYSLOG_METHOD environment variable; if it is unset, the default is libc.

### PKI Options
PKI configuration is required to use SSL for the connection to the database (and the switch, if --ovs is specified).

-p privkey.pem

--private-key=privkey.pem

Specifies a PEM file containing the private key used as identity for outgoing SSL connections.

-c cert.pem

--certificate=cert.pem

Specifies a PEM file containing a certificate that certifies the private key specified on -p or --private-key to be trustworthy. The certificate must be signed by the certificate authority (CA) that the peer in SSL connections will use to verify it.

-C cacert.pem

--ca-cert=cacert.pem

Specifies a PEM file containing the CA certificate for verifying certificates presented to this program by SSL peers. (This may be the same certificate that SSL peers use to verify the certificate specified on -c or --certificate, or it may be a different one, depending on the PKI design in use.)

-C none

--ca-cert=none

Disables verification of certificates presented by SSL peers. This introduces a security risk, because it means that certificates cannot be verified to be those of known trusted hosts.

### Other Options
--db database

The OVSDB database remote to contact. If the OVN_SB_DB environment variable is set, its value is used as the default. Otherwise, the default is unix:/db.sock, but this default is unlikely to be useful outside of single-machine OVN test environments.

-h

--help

Prints a brief help message to the console.

-V

--version

Prints version information to the console.

branch: sisyphus


ovn-ic

package: ovn-central

title: ovn-ic(8)

text:
# ovn-ic(8)

## NAME
ovn-ic - Open Virtual Network interconnection controller

## SYNOPSIS
ovn-ic [options]

## DESCRIPTION
ovn-ic, OVN interconnection controller, is a centralized daemon which communicates with global interconnection databases IC_NB/IC_SB to configure and exchange data with local NB/SB for interconnecting with other OVN deployments.

## OPTIONS
--ovnnb-db=database

The OVSDB database containing the OVN Northbound Database. If the OVN_NB_DB environment variable is set, its value is used as the default. Otherwise, the default is unix:/ovnnb_db.sock.

--ovnsb-db=database

The OVSDB database containing the OVN Southbound Database. If the OVN_SB_DB environment variable is set, its value is used as the default. Otherwise, the default is unix:/ovnsb_db.sock.

--ic-nb-db=database

The OVSDB database containing the OVN Interconnection Northbound Database. If the OVN_IC_NB_DB environment variable is set, its value is used as the default. Otherwise, the default is unix:/ovn_ic_nb_db.sock.

--ic-sb-db=database

The OVSDB database containing the OVN Interconnection Southbound Database. If the OVN_IC_SB_DB environment variable is set, its value is used as the default. Otherwise, the default is unix:/ovn_ic_sb_db.sock.

database in the above options must be an OVSDB active or passive connection method, as described in ovsdb(7).

### Daemon Options
--pidfile[=pidfile]

Causes a file (by default, program.pid) to be created indicating the PID of the running process. If the pidfile argument is not specified, or if it does not begin with /, then it is created in .

If --pidfile is not specified, no pidfile is created.

--overwrite-pidfile

By default, when --pidfile is specified and the specified pidfile already exists and is locked by a running process, the daemon refuses to start. Specify --overwrite-pidfile to cause it to instead overwrite the pidfile.

When --pidfile is not specified, this option has no effect.

--detach

Runs this program as a background process. The process forks, and in the child it starts a new session, closes the standard file descriptors (which has the side effect of disabling logging to the console), and changes its current directory to the root (unless --no-chdir is specified). After the child completes its initialization, the parent exits.

--monitor

Creates an additional process to monitor this program. If it dies due to a signal that indicates a programming error (SIGABRT, SIGALRM, SIGBUS, SIGFPE, SIGILL, SIGPIPE, SIGSEGV, SIGXCPU, or SIGXFSZ) then the monitor process starts a new copy of it. If the daemon dies or exits for another reason, the monitor process exits.

This option is normally used with --detach, but it also functions without it.

--no-chdir

By default, when --detach is specified, the daemon changes its current working directory to the root directory after it detaches. Otherwise, invoking the daemon from a carelessly chosen directory would prevent the administrator from unmounting the file system that holds that directory.

Specifying --no-chdir suppresses this behavior, preventing the daemon from changing its current working directory. This may be useful for collecting core files, since it is common behavior to write core dumps into the current working directory and the root directory is not a good directory to use.

This option has no effect when --detach is not specified.

--no-self-confinement

By default this daemon will try to self-confine itself to work with files under well-known directories determined at build time. It is better to stick with this default behavior and not to use this flag unless some other Access Control is used to confine daemon. Note that in contrast to other access control implementations that are typically enforced from kernel-space (e.g. DAC or MAC), self-confinement is imposed from the user-space daemon itself and hence should not be considered as a full confinement strategy, but instead should be viewed as an additional layer of security.

--user=user:group

Causes this program to run as a different user specified in user:group, thus dropping most of the root privileges. Short forms user and :group are also allowed, with current user or group assumed, respectively. Only daemons started by the root user accepts this argument.

On Linux, daemons will be granted CAP_IPC_LOCK and CAP_NET_BIND_SERVICES before dropping root privileges. Daemons that interact with a datapath, such as ovs-vswitchd, will be granted three additional capabilities, namely CAP_NET_ADMIN, CAP_NET_BROADCAST and CAP_NET_RAW. The capability change will apply even if the new user is root.

On Windows, this option is not currently supported. For security reasons, specifying this option will cause the daemon process not to start.

### Logging Options
-v[spec]

--verbose=[spec]

Sets logging levels. Without any spec, sets the log level for every module and destination to dbg. Otherwise, spec is a list of words separated by spaces or commas or colons, up to one from each category below:

- A valid module name, as displayed by the vlog/list command on ovs-appctl(8), limits the log level change to the specified module.

- syslog, console, or file, to limit the log level change to only to the system log, to the console, or to a file, respectively. (If --detach is specified, the daemon closes its standard file descriptors, so logging to the console will have no effect.)

On Windows platform, syslog is accepted as a word and is only useful along with the --syslog-target option (the word has no effect otherwise).

•

off, emer, err, warn, info, or dbg, to control the log level. Messages of the given severity or higher will be logged, and messages of lower severity will be filtered out. off filters out all messages. See ovs-appctl(8) for a definition of each log level.

Case is not significant within spec.

Regardless of the log levels set for file, logging to a file will not take place unless --log-file is also specified (see below).

For compatibility with older versions of OVS, any is accepted as a word but has no effect.

-v

--verbose

Sets the maximum logging verbosity level, equivalent to --verbose=dbg.

-vPATTERN:destination:pattern

--verbose=PATTERN:destination:pattern

Sets the log pattern for destination to pattern. Refer to ovs-appctl(8) for a description of the valid syntax for pattern.

-vFACILITY:facility

--verbose=FACILITY:facility

Sets the RFC5424 facility of the log message. facility can be one of kern, user, mail, daemon, auth, syslog, lpr, news, uucp, clock, ftp, ntp, audit, alert, clock2, local0, local1, local2, local3, local4, local5, local6 or local7. If this option is not specified, daemon is used as the default for the local system syslog and local0 is used while sending a message to the target provided via the --syslog-target option.

--log-file[=file]

Enables logging to a file. If file is specified, then it is used as the exact name for the log file. The default log file name used if file is omitted is /var/log/ovn/program.log.

--syslog-target=host:port

Send syslog messages to UDP port on host, in addition to the system syslog. The host must be a numerical IP address, not a hostname.

--syslog-method=method

Specify method as how syslog messages should be sent to syslog daemon. The following forms are supported:

- libc, to use the libc syslog() function. Downside of using this options is that libc adds fixed prefix to every message before it is actually sent to the syslog daemon over /dev/log UNIX domain socket.

- unix:file, to use a UNIX domain socket directly. It is possible to specify arbitrary message format with this option. However, rsyslogd 8.9 and older versions use hard coded parser function anyway that limits UNIX domain socket use. If you want to use arbitrary message format with older rsyslogd versions, then use UDP socket to localhost IP address instead.

- udp:ip:port, to use a UDP socket. With this method it is possible to use arbitrary message format also with older rsyslogd. When sending syslog messages over UDP socket extra precaution needs to be taken into account, for example, syslog daemon needs to be configured to listen on the specified UDP port, accidental iptables rules could be interfering with local syslog traffic and there are some security considerations that apply to UDP sockets, but do not apply to UNIX domain sockets.

- null, to discard all messages logged to syslog.

The default is taken from the OVS_SYSLOG_METHOD environment variable; if it is unset, the default is libc.

### PKI Options
PKI configuration is required in order to use SSL for the connections to the Northbound and Southbound databases.

-p privkey.pem

--private-key=privkey.pem

Specifies a PEM file containing the private key used as identity for outgoing SSL connections.

-c cert.pem

--certificate=cert.pem

Specifies a PEM file containing a certificate that certifies the private key specified on -p or --private-key to be trustworthy. The certificate must be signed by the certificate authority (CA) that the peer in SSL connections will use to verify it.

-C cacert.pem

--ca-cert=cacert.pem

Specifies a PEM file containing the CA certificate for verifying certificates presented to this program by SSL peers. (This may be the same certificate that SSL peers use to verify the certificate specified on -c or --certificate, or it may be a different one, depending on the PKI design in use.)

-C none

--ca-cert=none

Disables verification of certificates presented by SSL peers. This introduces a security risk, because it means that certificates cannot be verified to be those of known trusted hosts.

### Other Options
--unixctl=socket

Sets the name of the control socket on which program listens for runtime management commands (see RUNTIME MANAGEMENT COMMANDS, below). If socket does not begin with /, it is interpreted as relative to . If --unixctl is not used at all, the default socket is /program.pid.ctl, where pid is program’s process ID.

On Windows a local named pipe is used to listen for runtime management commands. A file is created in the absolute path as pointed by socket or if --unixctl is not used at all, a file is created as program in the configured OVS_RUNDIR directory. The file exists just to mimic the behavior of a Unix domain socket.

Specifying none for socket disables the control socket feature.

-h

--help

Prints a brief help message to the console.

-V

--version

Prints version information to the console.

## RUNTIME MANAGEMENT COMMANDS
ovs-appctl can send commands to a running ovn-ic process. The currently supported commands are described below.

exit

Causes ovn-ic to gracefully terminate.

pause

Pauses the ovn-ic operation from processing any database changes. This will also instruct ovn-ic to drop any lock on SB DB.

resume

Resumes the ovn-ic operation to process database contents. This will also instruct ovn-northd to aspire for the lock on SB DB.

is-paused

Returns "true" if ovn-ic is currently paused, "false" otherwise.

status

Prints this server’s status. Status will be "active" if ovn-ic has acquired OVSDB lock on SB DB, "standby" if it has not or "paused" if this instance is paused.

## ACTIVE-STANDBY FOR HIGH AVAILABILITY
You may run ovn-ic more than once in an OVN deployment. When connected to a standalone or clustered DB setup, OVN will automatically ensure that only one of them is active at a time. If multiple instances of ovn-ic are running and the active ovn-ic fails, one of the hot standby instances of ovn-ic will automatically take over.