'\" p .\" -*- nroff -*- .TH "ovn-nbctl" 8 "ovn-nbctl" "OVN 22\[char46]12\[char46]0" "OVN Manual" .fp 5 L CR \\" Make fixed-width font available as \\fL. .de TQ . br . ns . TP "\\$1" .. .de ST . PP . RS -0.15in . I "\\$1" . RE .. .de SU . PP . I "\\$1" .. .PP .SH "NAME" .PP .PP ovn-nbctl \- Open Virtual Network northbound db management utility .SH "SYNOPSIS" .PP \fBovn\-nbctl\fR [\fIoptions\fR] \fIcommand\fR [\fIarg\fR\[char46]\[char46]\[char46]] .SH "DESCRIPTION" .PP .PP The \fBovn\-nbctl\fR program configures the \fBOVN_Northbound\fR database by providing a high-level interface to its configuration database\[char46] See \fBovn\-nb\fR(5) for comprehensive documentation of the database schema\[char46] .PP .PP \fBovn\-nbctl\fR connects to an \fBovsdb\-server\fR process that maintains an OVN_Northbound configuration database\[char46] Using this connection, it queries and possibly applies changes to the database, depending on the supplied commands\[char46] .PP .PP \fBovn\-nbctl\fR can perform any number of commands in a single run, implemented as a single atomic transaction against the database\[char46] .PP .PP The \fBovn\-nbctl\fR command line begins with global options (see \fBOPTIONS\fR below for details)\[char46] The global options are followed by one or more commands\[char46] Each command should begin with \fB\-\-\fR by itself as a command-line argument, to separate it from the following commands\[char46] (The \fB\-\-\fR before the first command is optional\[char46]) The command itself starts with command-specific options, if any, followed by the command name and any arguments\[char46] .SH "DAEMON MODE" .PP .PP When it is invoked in the most ordinary way, \fBovn\-nbctl\fR connects to an OVSDB server that hosts the northbound 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\(cqs reply\[char46] In common interactive use, this is fine, but if the database is large, the step in which \fBovn\-nbctl\fR retrieves a partial copy of the database can take a long time, which yields poor performance overall\[char46] .PP .PP To improve performance in such a case, \fBovn\-nbctl\fR offers a \(dqdaemon mode,\(dq in which the user first starts \fBovn\-nbctl\fR running in the background and afterward uses the daemon to execute operations\[char46] Over several \fBovn\-nbctl\fR command invocations, this performs better overall because it retrieves a copy of the database only once at the beginning, not once per program run\[char46] .PP .PP Use the \fB\-\-detach\fR option to start an \fBovn\-nbctl\fR daemon\[char46] With this option, \fBovn\-nbctl\fR prints the name of a control socket to stdout\[char46] The client should save this name in environment variable \fBOVN_NB_DAEMON\fR\[char46] Under the Bourne shell this might be done like this: .PP .nf \fL .br \fL export OVN_NB_DAEMON=$(ovn\-nbctl \-\-pidfile \-\-detach) .br \fL \fR .fi .PP .PP When \fBOVN_NB_DAEMON\fR is set, \fBovn\-nbctl\fR automatically and transparently uses the daemon to execute its commands\[char46] .PP .PP When the daemon is no longer needed, kill it and unset the environment variable, e\[char46]g\[char46]: .PP .nf \fL .br \fL kill $(cat $OVN_RUNDIR/ovn\-nbctl\[char46]pid) .br \fL unset OVN_NB_DAEMON .br \fL \fR .fi .PP .PP When using daemon mode, an alternative to the \fBOVN_NB_DAEMON\fR environment variable is to specify a path for the Unix socket\[char46] When starting the ovn-nbctl daemon, specify the \fB\-u\fR option with a full path to the location of the socket file\[char46] Here is an exmple: .PP .nf \fL .br \fL ovn\-nbctl \-\-detach \-u /tmp/mysock\[char46]ctl .br \fL \fR .fi .PP .PP Then to connect to the running daemon, use the \fB\-u\fR option with the full path to the socket created when the daemon was started: .PP .nf \fL .br \fL ovn\-nbctl \-u /tmp/mysock\[char46]ctl show .br \fL \fR .fi .ST "Daemon Commands" .PP .PP Daemon mode is internally implemented using the same mechanism used by \fBovn\-appctl\fR\[char46] One may also use \fBovn\-appctl\fR directly with the following commands: .RS .TP \fBrun\fR [\fIoptions\fR] \fIcommand\fR [\fIarg\fR\[char46]\[char46]\[char46]] [\fB\-\-\fR [\fIoptions\fR] \fIcommand\fR [\fIarg\fR\[char46]\[char46]\[char46]] \[char46]\[char46]\[char46]] Instructs the daemon process to run one or more \fBovn\-nbctl\fR commands described above and reply with the results of running these commands\[char46] Accepts the \fB\-\-no\-wait\fR, \fB\-\-wait\fR, \fB\-\-timeout\fR, \fB\-\-dry\-run\fR, \fB\-\-oneline\fR, and the options described under \fBTable Formatting Options\fR in addition to the the command-specific options\[char46] .TP \fBexit\fR Causes \fBovn\-nbctl\fR to gracefully terminate\[char46] .RE .SH "OPTIONS" .PP .PP The options listed below affect the behavior of \fBovn\-nbctl\fR as a whole\[char46] Some individual commands also accept their own options, which are given just before the command name\[char46] If the first command on the command line has options, then those options must be separated from the global options by \fB\-\-\fR\[char46] .PP .PP \fBovn\-nbctl\fR also accepts options from the \fBOVN_NBCTL_OPTIONS\fR environment variable, in the same format as on the command line\[char46] Options from the command line override those in the environment\[char46] .RS .TP \fB\-\-no\-wait\fR | \fB\-\-wait=none\fR .TQ .5in \fB\-\-wait=sb\fR .TQ .5in \fB\-\-wait=hv\fR These options control whether and how \fBovn\-nbctl\fR waits for the OVN system to become up-to-date with changes made in an \fBovn\-nbctl\fR invocation\[char46] .IP By default, or if \fB\-\-no\-wait\fR or \fB\-\-wait=none\fR, \fBovn\-nbctl\fR exits immediately after confirming that changes have been committed to the northbound database, without waiting\[char46] .IP With \fB\-\-wait=sb\fR, before \fBovn\-nbctl\fR exits, it waits for \fBovn\-northd\fR to bring the southbound database up-to-date with the northbound database updates\[char46] .IP With \fB\-\-wait=hv\fR, before \fBovn\-nbctl\fR exits, it additionally waits for all OVN chassis (hypervisors and gateways) to become up-to-date with the northbound database updates\[char46] (This can become an indefinite wait if any chassis is malfunctioning\[char46]) .IP Ordinarily, \fB\-\-wait=sb\fR or \fB\-\-wait=hv\fR only waits for changes by the current \fBovn\-nbctl\fR invocation to take effect\[char46] This means that, if none of the commands supplied to \fBovn\-nbctl\fR change the database, then the command does not wait at all\[char46] Use the \fBsync\fR command to override this behavior\[char46] .TP \fB\-\-db\fR \fIdatabase\fR The OVSDB database remote to contact\[char46] If the \fBOVN_NB_DB\fR environment variable is set, its value is used as the default\[char46] Otherwise, the default is \fBunix:/ovnnb_db\[char46]sock\fR, but this default is unlikely to be useful outside of single-machine OVN test environments\[char46] .TP \fB\-\-leader\-only\fR .TQ .5in \fB\-\-no\-leader\-only\fR By default, or with \fB\-\-leader\-only\fR, when the database server is a clustered database, \fBovn\-nbctl\fR will avoid servers other than the cluster leader\[char46] This ensures that any data that \fBovn\-nbctl\fR reads and reports is up-to-date\[char46] With \fB\-\-no\-leader\-only\fR, \fBovn\-nbctl\fR 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 \fB\-\-no\-leader\-only\fR)\[char46] Refer to \fBUnderstanding Cluster Consistency\fR in \fBovsdb\fR(7) for more information\[char46] .TP \fB\-\-shuffle\-remotes\fR .TQ .5in \fB\-\-no\-shuffle\-remotes\fR By default, or with \fB\-\-shuffle\-remotes\fR, when there are multiple remotes specified in the OVSDB connection string specified by \fB\-\-db\fR or the \fBOVN_NB_DB\fR environment variable, the order of the remotes will be shuffled before the client tries to connect\[char46] The remotes will be shuffled only once to a new order before the first connection attempt\[char46] The following retries, if any, will follow the same new order\[char46] The default behavior is to make sure clients of a clustered database can distribute evenly to all members of the cluster\[char46] With \fB\-\-no\-shuffle\-remotes\fR, \fBovn\-nbctl\fR will use the original order specified in the connection string to connect\[char46] This allows user to specify the preferred order, which is particularly useful for testing\[char46] .TP \fB\-\-no\-syslog\fR By default, \fBovn\-nbctl\fR logs its arguments and the details of any changes that it makes to the system log\[char46] This option disables this logging\[char46] .IP This option is equivalent to \fB\-\-verbose=nbctl:syslog:warn\fR\[char46] .TP \fB\-\-oneline\fR Modifies the output format so that the output for each command is printed on a single line\[char46] New-line characters that would otherwise separate lines are printed as \efB\e\en\efR, and any instances of \efB\e\e\efR that would otherwise appear in the output are doubled\[char46] Prints a blank line for each command that has no output\[char46] This option does not affect the formatting of output from the \fBlist\fR or \fBfind\fR commands; see \fBTable Formatting Options\fR below\[char46] .TP \fB\-\-dry\-run\fR Prevents \fBovn\-nbctl\fR from actually modifying the database\[char46] .TP \fB\-t \fIsecs\fB\fR .TQ .5in \fB\-\-timeout=\fIsecs\fB\fR By default, or with a \fIsecs\fR of \fB0\fR, \fBovn\-nbctl\fR waits forever for a response from the database\[char46] This option limits runtime to approximately \fIsecs\fR seconds\[char46] If the timeout expires, \fBovn\-nbctl\fR will exit with a \fBSIGALRM\fR signal\[char46] (A timeout would normally happen only if the database cannot be contacted, or if the system is overloaded\[char46]) .TP \fB\-\-print\-wait\-time\fR When \fB\-\-wait\fR is specified, the option \fB\-\-print\-wait\-time\fR can be used to print the time spent on waiting, depending on the value specified in \fB \-\-wait\fR option\[char46] If \fB\-\-wait=sb\fR is specified, it prints \(dqovn-northd delay before processing\(dq, which is the time between the Northbound DB update by the command and the moment when \fB ovn\-northd\fR starts processing the update, and \(dqovn-northd completion\(dq, which is the time between the Northbound DB update and the moment when \fBovn\-northd\fR completes the Southbound DB updating successfully\[char46] If \fB\-\-wait=hv\fR is specified, in addition to the above information, it also prints \(dqovn-controller(s) completion\(dq, which is the time between the Northbound DB update and the moment when the slowest hypervisor finishes processing the update\[char46] .RE .SS "Daemon Options" .TP \fB\-\-pidfile\fR[\fB=\fR\fIpidfile\fR] Causes a file (by default, \fB\fIprogram\fB\[char46]pid\fR) to be created indicating the PID of the running process\[char46] If the \fIpidfile\fR argument is not specified, or if it does not begin with \fB/\fR, then it is created in \fB\fR\[char46] .IP If \fB\-\-pidfile\fR is not specified, no pidfile is created\[char46] .TP \fB\-\-overwrite\-pidfile\fR By default, when \fB\-\-pidfile\fR is specified and the specified pidfile already exists and is locked by a running process, the daemon refuses to start\[char46] Specify \fB\-\-overwrite\-pidfile\fR to cause it to instead overwrite the pidfile\[char46] .IP When \fB\-\-pidfile\fR is not specified, this option has no effect\[char46] .TP \fB\-\-detach\fR Runs this program as a background process\[char46] 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 \fB\-\-no\-chdir\fR is specified)\[char46] After the child completes its initialization, the parent exits\[char46] .TP \fB\-\-monitor\fR Creates an additional process to monitor this program\[char46] If it dies due to a signal that indicates a programming error (\fBSIGABRT\fR, \fBSIGALRM\fR, \fBSIGBUS\fR, \fBSIGFPE\fR, \fBSIGILL\fR, \fBSIGPIPE\fR, \fBSIGSEGV\fR, \fBSIGXCPU\fR, or \fBSIGXFSZ\fR) then the monitor process starts a new copy of it\[char46] If the daemon dies or exits for another reason, the monitor process exits\[char46] .IP This option is normally used with \fB\-\-detach\fR, but it also functions without it\[char46] .TP \fB\-\-no\-chdir\fR By default, when \fB\-\-detach\fR is specified, the daemon changes its current working directory to the root directory after it detaches\[char46] Otherwise, invoking the daemon from a carelessly chosen directory would prevent the administrator from unmounting the file system that holds that directory\[char46] .IP Specifying \fB\-\-no\-chdir\fR suppresses this behavior, preventing the daemon from changing its current working directory\[char46] 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\[char46] .IP This option has no effect when \fB\-\-detach\fR is not specified\[char46] .TP \fB\-\-no\-self\-confinement\fR By default this daemon will try to self-confine itself to work with files under well-known directories determined at build time\[char46] 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\[char46] Note that in contrast to other access control implementations that are typically enforced from kernel-space (e\[char46]g\[char46] 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\[char46] .TP \fB\-\-user=\fR\fIuser\fR\fB:\fR\fIgroup\fR Causes this program to run as a different user specified in \fIuser\fR\fB:\fR\fIgroup\fR, thus dropping most of the root privileges\[char46] Short forms \fIuser\fR and \fB:\fR\fIgroup\fR are also allowed, with current user or group assumed, respectively\[char46] Only daemons started by the root user accepts this argument\[char46] .IP On Linux, daemons will be granted \fBCAP_IPC_LOCK\fR and \fBCAP_NET_BIND_SERVICES\fR before dropping root privileges\[char46] Daemons that interact with a datapath, such as \fBovs\-vswitchd\fR, will be granted three additional capabilities, namely \fBCAP_NET_ADMIN\fR, \fBCAP_NET_BROADCAST\fR and \fBCAP_NET_RAW\fR\[char46] The capability change will apply even if the new user is root\[char46] .IP On Windows, this option is not currently supported\[char46] For security reasons, specifying this option will cause the daemon process not to start\[char46] .SS "Logging options" .TP \fB\-v\fR[\fIspec\fR] .TQ .5in \fB\-\-verbose=\fR[\fIspec\fR] Sets logging levels\[char46] Without any \fIspec\fR, sets the log level for every module and destination to \fBdbg\fR\[char46] Otherwise, \fIspec\fR is a list of words separated by spaces or commas or colons, up to one from each category below: .RS .IP \(bu A valid module name, as displayed by the \fBvlog/list\fR command on \fBovs\-appctl\fR(8), limits the log level change to the specified module\[char46] .IP \(bu \fBsyslog\fR, \fBconsole\fR, or \fBfile\fR, to limit the log level change to only to the system log, to the console, or to a file, respectively\[char46] (If \fB\-\-detach\fR is specified, the daemon closes its standard file descriptors, so logging to the console will have no effect\[char46]) .IP On Windows platform, \fBsyslog\fR is accepted as a word and is only useful along with the \fB\-\-syslog\-target\fR option (the word has no effect otherwise)\[char46] .IP \(bu \fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or \fBdbg\fR, to control the log level\[char46] Messages of the given severity or higher will be logged, and messages of lower severity will be filtered out\[char46] \fBoff\fR filters out all messages\[char46] See \fBovs\-appctl\fR(8) for a definition of each log level\[char46] .RE .IP Case is not significant within \fIspec\fR\[char46] .IP Regardless of the log levels set for \fBfile\fR, logging to a file will not take place unless \fB\-\-log\-file\fR is also specified (see below)\[char46] .IP For compatibility with older versions of OVS, \fBany\fR is accepted as a word but has no effect\[char46] .TP \fB\-v\fR .TQ .5in \fB\-\-verbose\fR Sets the maximum logging verbosity level, equivalent to \fB\-\-verbose=dbg\fR\[char46] .TP \fB\-vPATTERN:\fR\fIdestination\fR\fB:\fR\fIpattern\fR .TQ .5in \fB\-\-verbose=PATTERN:\fR\fIdestination\fR\fB:\fR\fIpattern\fR Sets the log pattern for \fIdestination\fR to \fIpattern\fR\[char46] Refer to \fBovs\-appctl\fR(8) for a description of the valid syntax for \fIpattern\fR\[char46] .TP \fB\-vFACILITY:\fR\fIfacility\fR .TQ .5in \fB\-\-verbose=FACILITY:\fR\fIfacility\fR Sets the RFC5424 facility of the log message\[char46] \fIfacility\fR can be one of \fBkern\fR, \fBuser\fR, \fBmail\fR, \fBdaemon\fR, \fBauth\fR, \fBsyslog\fR, \fBlpr\fR, \fBnews\fR, \fBuucp\fR, \fBclock\fR, \fBftp\fR, \fBntp\fR, \fBaudit\fR, \fBalert\fR, \fBclock2\fR, \fBlocal0\fR, \fBlocal1\fR, \fBlocal2\fR, \fBlocal3\fR, \fBlocal4\fR, \fBlocal5\fR, \fBlocal6\fR or \fBlocal7\fR\[char46] If this option is not specified, \fBdaemon\fR is used as the default for the local system syslog and \fBlocal0\fR is used while sending a message to the target provided via the \fB\-\-syslog\-target\fR option\[char46] .TP \fB\-\-log\-file\fR[\fB=\fR\fIfile\fR] Enables logging to a file\[char46] If \fIfile\fR is specified, then it is used as the exact name for the log file\[char46] The default log file name used if \fIfile\fR is omitted is \fB/var/log/ovn/\fIprogram\fB\[char46]log\fR\[char46] .TP \fB\-\-syslog\-target=\fR\fIhost\fR\fB:\fR\fIport\fR Send syslog messages to UDP \fIport\fR on \fIhost\fR, in addition to the system syslog\[char46] The \fIhost\fR must be a numerical IP address, not a hostname\[char46] .TP \fB\-\-syslog\-method=\fR\fImethod\fR Specify \fImethod\fR as how syslog messages should be sent to syslog daemon\[char46] The following forms are supported: .RS .IP \(bu \fBlibc\fR, to use the libc \fBsyslog()\fR function\[char46] Downside of using this options is that libc adds fixed prefix to every message before it is actually sent to the syslog daemon over \fB/dev/log\fR UNIX domain socket\[char46] .IP \(bu \fBunix:\fIfile\fB\fR, to use a UNIX domain socket directly\[char46] It is possible to specify arbitrary message format with this option\[char46] However, \fBrsyslogd 8\[char46]9\fR and older versions use hard coded parser function anyway that limits UNIX domain socket use\[char46] If you want to use arbitrary message format with older \fBrsyslogd\fR versions, then use UDP socket to localhost IP address instead\[char46] .IP \(bu \fBudp:\fIip\fB:\fIport\fB\fR, to use a UDP socket\[char46] With this method it is possible to use arbitrary message format also with older \fBrsyslogd\fR\[char46] 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\[char46] .IP \(bu \fBnull\fR, to discard all messages logged to syslog\[char46] .RE .IP The default is taken from the \fBOVS_SYSLOG_METHOD\fR environment variable; if it is unset, the default is \fBlibc\fR\[char46] .SS "Table Formatting Options" These options control the format of output from the \fBlist\fR and \fBfind\fR commands\[char46] .RS .TP \fB\-f\fR \fIformat\fR .TQ .5in \fB\-\-format=\fR\fIformat\fR Sets the type of table formatting\[char46] The following types of \fIformat\fR are available: .RS .TP \fBtable\fR 2-D text tables with aligned columns\[char46] .TP \fBlist\fR (default) A list with one column per line and rows separated by a blank line\[char46] .TP \fBhtml\fR HTML tables\[char46] .TP \fBcsv\fR Comma-separated values as defined in RFC 4180\[char46] .TP \fBjson\fR JSON format as defined in RFC 4627\[char46] The output is a sequence of JSON objects, each of which corresponds to one table\[char46] Each JSON object has the following members with the noted values: .RS .TP \fBcaption\fR The table\(cqs caption\[char46] This member is omitted if the table has no caption\[char46] .TP \fBheadings\fR An array with one element per table column\[char46] Each array element is a string giving the corresponding column\(cqs heading\[char46] .TP \fBdata\fR An array with one element per table row\[char46] Each element is also an array with one element per table column\[char46] The elements of this second-level array are the cells that constitute the table\[char46] 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\[char46] .RE .RE .TP \fB\-d\fR \fIformat\fR .TQ .5in \fB\-\-data=\fR\fIformat\fR Sets the formatting for cells within output tables unless the table format is set to \fBjson\fR, in which case \fBjson\fR formatting is always used when formatting cells\[char46] The following types of \fIformat\fR are available: .RS .TP \fBstring\fR (default) The simple format described in the \fBDatabase Values\fR section of \fBovs\-vsctl\fR(8)\[char46] .TP \fBbare\fR The simple format with punctuation stripped off: \fB[]\fR and \fB{}\fR are omitted around sets, maps, and empty columns, items within sets and maps are space-separated, and strings are never quoted\[char46] This format may be easier for scripts to parse\[char46] .TP \fBjson\fR The RFC 4627 JSON format as described above\[char46] .RE .TP \fB\-\-no\-headings\fR This option suppresses the heading row that otherwise appears in the first row of table output\[char46] .TP \fB\-\-pretty\fR By default, JSON in output is printed as compactly as possible\[char46] This option causes JSON in output to be printed in a more readable fashion\[char46] Members of objects and elements of arrays are printed one per line, with indentation\[char46] .IP This option does not affect JSON in tables, which is always printed compactly\[char46] .TP \fB\-\-bare\fR Equivalent to \fB\-\-format=list \-\-data=bare \-\-no\-headings\fR\[char46] .RE .SS "PKI Options" .PP .PP PKI configuration is required to use SSL for the connection to the database\[char46] .RS .TP \fB\-p\fR \fIprivkey\[char46]pem\fR .TQ .5in \fB\-\-private\-key=\fR\fIprivkey\[char46]pem\fR Specifies a PEM file containing the private key used as identity for outgoing SSL connections\[char46] .TP \fB\-c\fR \fIcert\[char46]pem\fR .TQ .5in \fB\-\-certificate=\fR\fIcert\[char46]pem\fR Specifies a PEM file containing a certificate that certifies the private key specified on \fB\-p\fR or \fB\-\-private\-key\fR to be trustworthy\[char46] The certificate must be signed by the certificate authority (CA) that the peer in SSL connections will use to verify it\[char46] .TP \fB\-C\fR \fIcacert\[char46]pem\fR .TQ .5in \fB\-\-ca\-cert=\fR\fIcacert\[char46]pem\fR Specifies a PEM file containing the CA certificate for verifying certificates presented to this program by SSL peers\[char46] (This may be the same certificate that SSL peers use to verify the certificate specified on \fB\-c\fR or \fB\-\-certificate\fR, or it may be a different one, depending on the PKI design in use\[char46]) .TP \fB\-C none\fR .TQ .5in \fB\-\-ca\-cert=none\fR Disables verification of certificates presented by SSL peers\[char46] This introduces a security risk, because it means that certificates cannot be verified to be those of known trusted hosts\[char46] .RE .RS .TP \fB\-\-bootstrap\-ca\-cert=\fR\fIcacert\[char46]pem\fR When \fIcacert\[char46]pem\fR exists, this option has the same effect as \fB\-C\fR or \fB\-\-ca\-cert\fR\[char46] 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\[char46] 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\[char46] .IP 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\[char46] .IP This option is only useful if the SSL peer sends its CA certificate as part of the SSL certificate chain\[char46] The SSL protocol does not require the server to send the CA certificate\[char46] .IP This option is mutually exclusive with \fB\-C\fR and \fB\-\-ca\-cert\fR\[char46] .RE .SS "Other Options" .TP \fB\-h\fR .TQ .5in \fB\-\-help\fR Prints a brief help message to the console\[char46] .TP \fB\-V\fR .TQ .5in \fB\-\-version\fR Prints version information to the console\[char46] .SH "COMMANDS" .PP .PP The following sections describe the commands that \fBovn\-nbctl\fR supports\[char46] .SS "General Commands" .TP \fBinit\fR Initializes the database, if it is empty\[char46] If the database has already been initialized, this command has no effect\[char46] .TP \fBshow [\fIswitch\fB | \fIrouter\fB]\fR Prints a brief overview of the database contents\[char46] If \fIswitch\fR is provided, only records related to that logical switch are shown\[char46] If \fIrouter\fR is provided, only records related to that logical router are shown\[char46] .SS "Logical Switch Commands" .TP \fBls\-add\fR Creates a new, unnamed logical switch, which initially has no ports\[char46] The switch does not have a name, other commands must refer to this switch by its UUID\[char46] .TP [\fB\-\-may\-exist\fR | \fB\-\-add\-duplicate\fR] \fBls\-add\fR \fIswitch\fR Creates a new logical switch named \fIswitch\fR, which initially has no ports\[char46] .IP The OVN northbound database schema does not require logical switch names to be unique, but the whole point to the names is to provide an easy way for humans to refer to the switches, making duplicate names unhelpful\[char46] Thus, without any options, this command regards it as an error if \fIswitch\fR is a duplicate name\[char46] With \fB\-\-may\-exist\fR, adding a duplicate name succeeds but does not create a new logical switch\[char46] With \fB\-\-add\-duplicate\fR, the command really creates a new logical switch with a duplicate name\[char46] It is an error to specify both options\[char46] If there are multiple logical switches with a duplicate name, configure the logical switches using the UUID instead of the \fIswitch\fR name\[char46] .TP [\fB\-\-if\-exists\fR] \fBls\-del\fR \fIswitch\fR Deletes \fIswitch\fR\[char46] It is an error if \fIswitch\fR does not exist, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBls\-list\fR Lists all existing switches on standard output, one per line\[char46] .SS "ACL Commands" .PP .PP These commands operates on ACL objects for a given \fIentity\fR\[char46] The \fIentity\fR can be either a logical switch or a port group\[char46] The \fIentity\fR can be specified as uuid or name\[char46] The \fB\-\-type\fR option can be used to specify the type of the \fIentity\fR, in case both a logical switch and a port groups exist with the same name specified for \fIentity\fR\[char46] \fBtype\fR must be either \fBswitch\fR or \fBport\-group\fR\[char46] .RS .TP [\fB\-\-type=\fR{\fBswitch\fR | \fBport\-group\fR}] [\fB\-\-log\fR] [\fB\-\-meter=\fR\fImeter\fR] [\fB\-\-severity=\fR\fIseverity\fR] [\fB\-\-name=\fR\fIname\fR] [\fB\-\-label=\fR\fIlabel\fR] [\fB\-\-may\-exist\fR] [\fB\-\-apply\-after\-lb\fR] \fBacl\-add\fR \fIentity\fR \fIdirection\fR \fIpriority\fR \fImatch\fR \fIverdict\fR Adds the specified ACL to \fIentity\fR\[char46] \fIdirection\fR must be either \fBfrom\-lport\fR or \fBto\-lport\fR\[char46] \fIpriority\fR must be between \fB0\fR and \fB32767\fR, inclusive\[char46] A full description of the fields are in \fBovn\-nb\fR(5)\[char46] If \fB\-\-may\-exist\fR is specified, adding a duplicated ACL succeeds but the ACL is not really created\[char46] Without \fB\-\-may\-exist\fR, adding a duplicated ACL results in error\[char46] .IP The \fB\-\-log\fR option enables packet logging for the ACL\[char46] The options \fB\-\-severity\fR and \fB\-\-name\fR specify a severity and name, respectively, for log entries (and also enable logging)\[char46] The severity must be one of \fBalert\fR, \fBwarning\fR, \fBnotice\fR, \fBinfo\fR, or \fBdebug\fR\[char46] If a severity is not specified, the default is \fBinfo\fR\[char46] The \fB\-\-meter=\fImeter\fB\fR option is used to rate-limit packet logging\[char46] The \fImeter\fR argument names a meter configured by \fBmeter\-add\fR\[char46] .IP The \fB\-\-apply\-after\-lb\fR option sets \fBapply\-after\-lb=true\fR in the \fBoptions\fR column of the \fBACL\fR table\[char46] As the option name suggests, the ACL will be applied after the logical switch load balancer stage\[char46] .TP [\fB\-\-type=\fR{\fBswitch\fR | \fBport\-group\fR}] \fBacl\-del\fR \fIentity\fR [\fIdirection\fR [\fIpriority\fR \fImatch\fR]] Deletes ACLs from \fIentity\fR\[char46] If only \fIentity\fR is supplied, all the ACLs from the \fIentity\fR are deleted\[char46] If \fIdirection\fR is also specified, then all the flows in that direction will be deleted from the \fIentity\fR\[char46] If all the fields are given, then a single flow that matches all the fields will be deleted\[char46] .TP [\fB\-\-type=\fR{\fBswitch\fR | \fBport\-group\fR}] \fBacl\-list\fR \fIentity\fR Lists the ACLs on \fIentity\fR\[char46] .RE .SS "Logical Switch QoS Rule Commands" .TP [\fB\-\-may\-exist\fR] \fBqos\-add\fR \fIswitch\fR \fIdirection\fR \fIpriority\fR \fImatch\fR [\fBdscp=\fR\fIdscp\fR] [\fBrate=\fR\fIrate\fR [\fBburst=\fR\fIburst\fR]] Adds QoS marking and metering rules to \fIswitch\fR\[char46] \fIdirection\fR must be either \fBfrom\-lport\fR or \fBto\-lport\fR\[char46] \fIpriority\fR must be between \fB0\fR and \fB32767\fR, inclusive\[char46] .IP If \fBdscp=\fR\fIdscp\fR is specified, then matching packets will have DSCP marking applied\[char46] \fIdscp\fR must be between \fB0\fR and \fB63\fR, inclusive\[char46] If \fBrate=\fR\fIrate\fR is specified then matching packets will have metering applied at \fIrate\fR kbps\[char46] If metering is configured, then \fBburst=\fR\fIburst\fR specifies the burst rate limit in kilobits\[char46] \fBdscp\fR and/or \fBrate\fR are required arguments\[char46] .IP If \fB\-\-may\-exist\fR is specified, adding a duplicated QoS rule succeeds but the QoS rule is not really created\[char46] Without \fB\-\-may\-exist\fR, adding a duplicated QoS rule results in error\[char46] .TP \fBqos\-del\fR \fIswitch\fR [\fIdirection\fR [\fIpriority\fR \fImatch\fR]] Deletes QoS rules from \fIswitch\fR\[char46] If only \fIswitch\fR is supplied, all the QoS rules from the logical switch are deleted\[char46] If \fIdirection\fR is also specified, then all the flows in that direction will be deleted from the logical switch\[char46] If all the fields are supplied, then a single flow that matches the given fields will be deleted\[char46] .IP If \fIswitch\fR and \fIuuid\fR are supplied, then the QoS rule with specified uuid is deleted\[char46] .TP \fBqos\-list\fR \fIswitch\fR Lists the QoS rules on \fIswitch\fR\[char46] .SS "Meter Commands" .TP \fBmeter\-add\fR \fIname\fR \fIaction\fR \fIrate\fR \fIunit\fR [\fIburst\fR] Adds the specified meter\[char46] \fIname\fR must be a unique name to identify this meter\[char46] The \fIaction\fR argument specifies what should happen when this meter is exceeded\[char46] The only supported action is \fBdrop\fR\[char46] .IP The \fIunit\fR specifies the unit for the \fIrate\fR argument; valid values are \fBkbps\fR and \fBpktps\fR for kilobits per second and packets per second, respectively\[char46] The \fIburst\fR option configures the maximum burst allowed for the band in kilobits or packets depending on whether the \fIunit\fR chosen was \fBkbps\fR or \fBpktps\fR, respectively\[char46] If a burst is not supplied, the switch is free to select some reasonable value depending on its configuration\[char46] .IP \fBovn\-nbctl\fR only supports adding a meter with a single band, but the other commands support meters with multiple bands\[char46] .IP Names that start with \(dq__\(dq (two underscores) are reserved for internal use by OVN, so \fBovn\-nbctl\fR does not allow adding them\[char46] .TP \fBmeter\-del\fR [\fIname\fR] Deletes meters\[char46] By default, all meters are deleted\[char46] If \fIname\fR is supplied, only the meter with that name will be deleted\[char46] .TP \fBmeter\-list\fR Lists all meters\[char46] .SS "Logical Switch Port Commands" .TP [\fB\-\-may\-exist\fR] \fBlsp\-add\fR \fIswitch\fR \fIport\fR Creates on \fIlswitch\fR a new logical switch port named \fIport\fR\[char46] .IP It is an error if a logical port named \fIport\fR already exists, unless \fB\-\-may\-exist\fR is specified\[char46] Regardless of \fB\-\-may\-exist\fR, it is an error if the existing port is in some logical switch other than \fIswitch\fR or if it has a parent port\[char46] .TP [\fB\-\-may\-exist\fR] \fBlsp\-add\fR \fIswitch\fR \fIport\fR \fIparent\fR \fItag_request\fR Creates on \fIswitch\fR a logical switch port named \fIport\fR that is a child of \fIparent\fR that is identified with VLAN ID \fItag_request\fR, which must be between \fB0\fR and \fB4095\fR, inclusive\[char46] If \fItag_request\fR is \fB0\fR, \fBovn\-northd\fR generates a tag that is unique in the scope of \fIparent\fR\[char46] This is useful in cases such as virtualized container environments where Open vSwitch does not have a direct connection to the container\(cqs port and it must be shared with the virtual machine\(cqs port\[char46] .IP It is an error if a logical port named \fIport\fR already exists, unless \fB\-\-may\-exist\fR is specified\[char46] Regardless of \fB\-\-may\-exist\fR, it is an error if the existing port is not in \fIswitch\fR or if it does not have the specified \fIparent\fR and \fItag_request\fR\[char46] .TP [\fB\-\-if\-exists\fR] \fBlsp\-del\fR \fIport\fR Deletes \fIport\fR\[char46] It is an error if \fIport\fR does not exist, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlsp\-list\fR \fIswitch\fR Lists all the logical switch ports within \fIswitch\fR on standard output, one per line\[char46] .TP \fBlsp\-get\-parent\fR \fIport\fR If set, get the parent port of \fIport\fR\[char46] If not set, print nothing\[char46] .TP \fBlsp\-get\-tag\fR \fIport\fR If set, get the tag for \fIport\fR traffic\[char46] If not set, print nothing\[char46] .TP \fBlsp\-set\-addresses\fR \fIport\fR [\fIaddress\fR]\[char46]\[char46]\[char46] Sets the addresses associated with \fIport\fR to \fIaddress\fR\[char46] Each \fIaddress\fR should be one of the following: .RS .TP an Ethernet address, optionally followed by a space and one or more IP addresses OVN delivers packets for the Ethernet address to this port\[char46] .TP \fBunknown\fR OVN delivers unicast Ethernet packets whose destination MAC address is not in any logical port\(cqs addresses column to ports with address \fBunknown\fR\[char46] .TP \fBdynamic\fR Use this keyword to make \fBovn\-northd\fR generate a globally unique MAC address and choose an unused IPv4 address with the logical port\(cqs subnet and store them in the port\(cqs \fBdynamic_addresses\fR column\[char46] .TP \fBrouter\fR Accepted only when the \fBtype\fR of the logical switch port is \fBrouter\fR\[char46] This indicates that the Ethernet, IPv4, and IPv6 addresses for this logical switch port should be obtained from the connected logical router port, as specified by \fBrouter\-port\fR in \fBlsp\-set\-options\fR\[char46] .RE .IP Multiple addresses may be set\[char46] If no \fIaddress\fR argument is given, \fIport\fR will have no addresses associated with it\[char46] .TP \fBlsp\-get\-addresses\fR \fIport\fR Lists all the addresses associated with \fIport\fR on standard output, one per line\[char46] .TP \fBlsp\-set\-port\-security\fR \fIport\fR [\fIaddrs\fR]\[char46]\[char46]\[char46] Sets the port security addresses associated with \fIport\fR to \fIaddrs\fR\[char46] Multiple sets of addresses may be set by using multiple \fIaddrs\fR arguments\[char46] If no \fIaddrs\fR argument is given, \fIport\fR will not have port security enabled\[char46] .IP Port security limits the addresses from which a logical port may send packets and to which it may receive packets\[char46] See the \fBovn\-nb\fR(5) documentation for the \fBport_security\fR column in the \fBLogical_Switch_Port\fR table for details\[char46] .TP \fBlsp\-get\-port\-security\fR \fIport\fR Lists all the port security addresses associated with \fIport\fR on standard output, one per line\[char46] .TP \fBlsp\-get\-up\fR \fIport\fR Prints the state of \fIport\fR, either \fBup\fR or \fBdown\fR\[char46] .TP \fBlsp\-set\-enabled\fR \fIport\fR \fIstate\fR Set the administrative state of \fIport\fR, either \fBenabled\fR or \fBdisabled\fR\[char46] When a port is disabled, no traffic is allowed into or out of the port\[char46] .TP \fBlsp\-get\-enabled\fR \fIport\fR Prints the administrative state of \fIport\fR, either \fBenabled\fR or \fBdisabled\fR\[char46] .TP \fBlsp\-set\-type\fR \fIport\fR \fItype\fR Set the type for the logical port\[char46] The type must be one of the following: .RS .TP \fB(empty string)\fR A VM (or VIF) interface\[char46] .TP \fBrouter\fR A connection to a logical router\[char46] .TP \fBlocalnet\fR A connection to a locally accessible network from each ovn-controller instance\[char46] A logical switch can only have a single localnet port attached\[char46] This is used to model direct connectivity to an existing network\[char46] .TP \fBlocalport\fR A connection to a local VIF\[char46] Traffic that arrives on a localport is never forwarded over a tunnel to another chassis\[char46] These ports are present on every chassis and have the same address in all of them\[char46] This is used to model connectivity to local services that run on every hypervisor\[char46] .TP \fBl2gateway\fR A connection to a physical network\[char46] .TP \fBvtep\fR A port to a logical switch on a VTEP gateway\[char46] .RE .TP \fBlsp\-get\-type\fR \fIport\fR Get the type for the logical port\[char46] .TP \fBlsp\-set\-options\fR \fIport\fR [\fIkey=value\fR]\[char46]\[char46]\[char46] Set type-specific key-value options for the logical port\[char46] .TP \fBlsp\-get\-options\fR \fIport\fR Get the type-specific options for the logical port\[char46] .TP \fBlsp\-set\-dhcpv4\-options\fR \fIport\fR \fIdhcp_options\fR Set the DHCPv4 options for the logical port\[char46] The \fIdhcp_options\fR is a UUID referring to a set of DHCP options in the \fBDHCP_Options\fR table\[char46] .TP \fBlsp\-get\-dhcpv4\-options\fR \fIport\fR Get the configured DHCPv4 options for the logical port\[char46] .TP \fBlsp\-set\-dhcpv6\-options\fR \fIport\fR \fIdhcp_options\fR Set the DHCPv6 options for the logical port\[char46] The \fIdhcp_options\fR is a UUID referring to a set of DHCP options in the \fBDHCP_Options\fR table\[char46] .TP \fBlsp\-get\-dhcpv6\-options\fR \fIport\fR Get the configured DHCPv6 options for the logical port\[char46] .TP \fBlsp\-get\-ls\fR \fIport\fR Get the logical switch which the \fIport\fR belongs to\[char46] .TP \fBlsp\-attach\-mirror\fR \fIport\fR \fIm\fR Attaches the mirror \fIm\fR to the logical port \fIport\fR\[char46] .TP \fBlsp\-dettach\-mirror\fR \fIport\fR \fIm\fR Detaches the mirror \fIm\fR from the logical port \fIport\fR\[char46] .SS "Forwarding Group Commands" .TP [\fB\-\-liveness\fR]\fBfwd\-group\-add\fR \fIgroup\fR \fIswitch\fR \fIvip\fR \fIvmac\fR \fIports\fR Creates a new forwarding group named \fIgroup\fR as the name with the provided \fIvip\fR and \fIvmac\fR\[char46] \fIvip\fR should be a virtual IP address and \fIvmac\fR should be a virtual MAC address to access the forwarding group\[char46] \fIports\fR are the logical switch port names that are put in the forwarding group\[char46] Example for \fIports\fR is lsp1 lsp2 \[char46]\[char46]\[char46] Traffic destined to virtual IP of the forwarding group will be load balanced to all the child ports\[char46] .IP When \fB\-\-liveness\fR is specified then child ports are expected to be bound to external devices like routers\[char46] BFD should be configured between hypervisors and the external devices\[char46] The child port selection will become dependent on BFD status with its external device\[char46] .TP [\fB\-\-if\-exists\fR] \fBfwd\-group\-del\fR \fIgroup \fR Deletes \fIgroup\fR\[char46] It is an error if \fIgroup\fR does not exist, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBfwd\-group\-list\fR [\fIswitch\fR] Lists all existing forwarding groups, If \fIswitch\fR is specified then only the forwarding groups configured for \fIswitch\fR will be listed\[char46] .SS "Logical Router Commands" .TP \fBlr\-add\fR Creates a new, unnamed logical router, which initially has no ports\[char46] The router does not have a name, other commands must refer to this router by its UUID\[char46] .TP [\fB\-\-may\-exist\fR | \fB\-\-add\-duplicate\fR] \fBlr\-add\fR \fIrouter\fR Creates a new logical router named \fIrouter\fR, which initially has no ports\[char46] .IP The OVN northbound database schema does not require logical router names to be unique, but the whole point to the names is to provide an easy way for humans to refer to the routers, making duplicate names unhelpful\[char46] Thus, without any options, this command regards it as an error if \fIrouter\fR is a duplicate name\[char46] With \fB\-\-may\-exist\fR, adding a duplicate name succeeds but does not create a new logical router\[char46] With \fB\-\-add\-duplicate\fR, the command really creates a new logical router with a duplicate name\[char46] It is an error to specify both options\[char46] If there are multiple logical routers with a duplicate name, configure the logical routers using the UUID instead of the \fIrouter\fR name\[char46] .TP [\fB\-\-if\-exists\fR] \fBlr\-del\fR \fIrouter\fR Deletes \fIrouter\fR\[char46] It is an error if \fIrouter\fR does not exist, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlr\-list\fR Lists all existing routers on standard output, one per line\[char46] .SS "Logical Router Port Commands" .TP [\fB\-\-may\-exist\fR] \fBlrp\-add\fR \fIrouter\fR \fIport\fR \fImac\fR \fInetwork\fR\[char46]\[char46]\[char46] [\fBpeer=\fR\fIpeer\fR] Creates on \fIrouter\fR a new logical router port named \fIport\fR with Ethernet address \fImac\fR and one or more IP address/netmask for each \fInetwork\fR\[char46] .IP The optional argument \fBpeer\fR identifies a logical router port that connects to this one\[char46] The following example adds a router port with an IPv4 and IPv6 address with peer \fBlr1\fR: .IP \fBlrp\-add lr0 lrp0 00:11:22:33:44:55 192\[char46]168\[char46]0\[char46]1/24 2001:db8::1/64 peer=lr1\fR .IP It is an error if a logical router port named \fIport\fR already exists, unless \fB\-\-may\-exist\fR is specified\[char46] Regardless of \fB\-\-may\-exist\fR, it is an error if the existing router port is in some logical router other than \fIrouter\fR\[char46] .TP [\fB\-\-if\-exists\fR] \fBlrp\-del\fR \fIport\fR Deletes \fIport\fR\[char46] It is an error if \fIport\fR does not exist, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlrp\-list\fR \fIrouter\fR Lists all the logical router ports within \fIrouter\fR on standard output, one per line\[char46] .TP \fBlrp\-set\-enabled\fR \fIport\fR \fIstate\fR Set the administrative state of \fIport\fR, either \fBenabled\fR or \fBdisabled\fR\[char46] When a port is disabled, no traffic is allowed into or out of the port\[char46] .TP \fBlrp\-get\-enabled\fR \fIport\fR Prints the administrative state of \fIport\fR, either \fBenabled\fR or \fBdisabled\fR\[char46] .TP \fBlrp\-set\-gateway\-chassis\fR \fIport\fR \fIchassis\fR [\fIpriority\fR] Set gateway chassis for \fIport\fR\[char46] \fIchassis\fR is the name of the chassis\[char46] This creates a gateway chassis entry in Gateway_Chassis table\[char46] It won\(cqt check if chassis really exists in OVN_Southbound database\[char46] Priority will be set to 0 if \fIpriority\fR is not provided by user\[char46] \fIpriority\fR must be between \fB0\fR and \fB32767\fR, inclusive\[char46] .TP \fBlrp\-del\-gateway\-chassis\fR \fIport\fR \fIchassis\fR Deletes gateway chassis from \fIport\fR\[char46] It is an error if gateway chassis with \fIchassis\fR for \fIport\fR does not exist\[char46] .TP \fBlrp\-get\-gateway\-chassis\fR \fIport\fR Lists all the gateway chassis with priority within \fIport\fR on standard output, one per line, ordered based on priority\[char46] .SS "Logical Router Static Route Commands" .TP [\fB\-\-may\-exist\fR] [\fB\-\-policy\fR=\fIPOLICY\fR] [\fB\-\-ecmp\fR] [\fB\-\-ecmp\-symmetric\-reply\fR] [\fB\-\-bfd[=\fIUUID\fB\fR]] \fBlr\-route\-add\fR \fIrouter\fR \fIprefix\fR \fInexthop\fR [\fIport\fR] Adds the specified route to \fIrouter\fR\[char46] \fIprefix\fR describes an IPv4 or IPv6 prefix for this route, such as \fB192\[char46]168\[char46]100\[char46]0/24\fR\[char46] \fInexthop\fR specifies the gateway to use for this route, which should be the IP address of one of \fIrouter\fR logical router ports or the IP address of a logical port\[char46] If \fIport\fR is specified, packets that match this route will be sent out that port\[char46] When \fIport\fR is omitted, OVN infers the output port based on \fInexthop\fR\[char46] Nexthop can be set to \fIdiscard\fR for dropping packets which match the given route\[char46] .IP \fB\-\-policy\fR describes the policy used to make routing decisions\[char46] This should be one of \(dqdst-ip\(dq or \(dqsrc-ip\(dq\[char46] If not specified, the default is \(dqdst-ip\(dq\[char46] .IP The \fB\-\-ecmp\fR option allows for multiple routes with the same \fIprefix\fR \fIPOLICY\fR but different \fInexthop\fR and \fIport\fR to be added\[char46] .IP The \fB\-\-ecmp\-symmetric\-reply\fR option makes it so that traffic that arrives over an ECMP route will have its reply traffic sent out over that same route\[char46] Setting \fB\-\-ecmp\-symmetric\-reply\fR implies \fB\-\-ecmp\fR so it is not necessary to set both\[char46] .IP \fB\-\-bfd\fR option is used to link a BFD session to the OVN route\[char46] If the BFD session UUID is provided, it will be used for the OVN route otherwise the next-hop will be used to perform a lookup in the OVN BFD table\[char46] If the lookup fails and \fIport\fR is specified, a new entry in the BFD table will be created using the \fInexthop\fR as \fIdst_ip\fR and \fIport\fR as \fIlogical_port\fR\[char46] .IP It is an error if a route with \fIprefix\fR and \fIPOLICY\fR already exists, unless \fB\-\-may\-exist\fR, \fB\-\-ecmp\fR, or \fB\-\-ecmp\-symmetric\-reply\fR is specified\[char46] If \fB\-\-may\-exist\fR is specified but not \fB\-\-ecmp\fR or \fB\-\-ecmp\-symmetric\-reply\fR, the existed route will be updated with the new nexthop and port\[char46] If \fB\-\-ecmp\fR or \fB\-\-ecmp\-symmetric\-reply\fR is specified, a new route will be added, regardless of the existed route\[char46], which is useful when adding ECMP routes, i\[char46]e\[char46] routes with same \fIPOLICY\fR and \fIprefix\fR but different \fInexthop\fR and \fIport\fR\[char46] .TP [\fB\-\-if\-exists\fR] [\fB\-\-policy\fR=\fIPOLICY\fR] \fBlr\-route\-del\fR \fIrouter\fR [\fIprefix\fR [\fInexthop\fR [\fIport\fR]]] Deletes routes from \fIrouter\fR\[char46] If only \fIrouter\fR is supplied, all the routes from the logical router are deleted\[char46] If \fIPOLICY\fR, \fIprefix\fR, \fInexthop\fR and/or \fIport\fR are also specified, then all the routes that match the conditions will be deleted from the logical router\[char46] .IP It is an error if there is no matching route entry, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlr\-route\-list\fR \fIrouter\fR Lists the routes on \fIrouter\fR\[char46] .SS "Logical Router Policy Commands" .TP [\fB\-\-may\-exist\fR]\fBlr\-policy\-add\fR \fIrouter\fR \fIpriority\fR \fImatch\fR \fIaction\fR [\fInexthop\fR[,\fInexthop\fR,\[char46]\[char46]\[char46]]] [\fIoptions key=value]\fR] Add Policy to \fIrouter\fR which provides a way to configure permit/deny and reroute policies on the router\[char46] Permit/deny policies are similar to OVN ACLs, but exist on the logical-router\[char46] Reroute policies are needed for service-insertion and service-chaining\[char46] \fInexthop\fR is an optional parameter\[char46] It needs to be provided only when \fIaction\fR is \fIreroute\fR\[char46] Multiple \fBnexthops\fR can be specified for ECMP routing\[char46] A policy is uniquely identified by \fIpriority\fR and \fImatch\fR\[char46] Multiple policies can have the same \fIpriority\fR\[char46] \fIoptions\fR sets the router policy options as key-value pair\[char46] The supported option is : \fBpkt_mark\fR\[char46] .IP If \fB\-\-may\-exist\fR is specified, adding a duplicated routing policy with the same priority and match string is not really created\[char46] Without \fB\-\-may\-exist\fR, adding a duplicated routing policy results in error\[char46] .IP The following example shows a policy to lr1, which will drop packets from\fB192\[char46]168\[char46]100\[char46]0/24\fR\[char46] .IP \fBlr\-policy\-add lr1 100 ip4\[char46]src == 192\[char46]168\[char46]100\[char46]0/24 drop\fR\[char46] .IP \fB lr\-policy\-add lr1 100 ip4\[char46]src == 192\[char46]168\[char46]100\[char46]0/24 allow pkt_mark=100 \fR\[char46] .TP [\fB\-\-if\-exists\fR] \fBlr\-policy\-del\fR \fIrouter\fR [\fI{priority | uuid} [match]\fR] Deletes polices from \fIrouter\fR\[char46] If only \fIrouter\fR is supplied, all the polices from the logical router are deleted\[char46] If \fIpriority\fR and/or \fImatch\fR are also specified, then all the polices that match the conditions will be deleted from the logical router\[char46] .IP If \fIrouter\fR and \fIuuid\fR are supplied, then the policy with specified uuid is deleted\[char46] It is an error if \fIuuid\fR does not exist, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlr\-policy\-list\fR \fIrouter\fR Lists the polices on \fIrouter\fR\[char46] .SS "NAT Commands" .TP [\fB\-\-may\-exist\fR] [\fB\-\-stateless\fR] [\fB\-\-gateway_port\fR=\fIGATEWAY_PORT\fR] \fBlr\-nat\-add\fR \fIrouter\fR \fItype\fR \fIexternal_ip\fR \fIlogical_ip\fR [\fIlogical_port\fR \fIexternal_mac\fR] Adds the specified NAT to \fIrouter\fR\[char46] The \fItype\fR must be one of \fBsnat\fR, \fBdnat\fR, or \fBdnat_and_snat\fR\[char46] The \fIexternal_ip\fR is an IPv4 address\[char46] The \fIlogical_ip\fR is an IPv4 network (e\[char46]g 192\[char46]168\[char46]1\[char46]0/24) or an IPv4 address\[char46] The \fIlogical_port\fR and \fIexternal_mac\fR are only accepted when \fIrouter\fR is a distributed router (rather than a gateway router) and \fItype\fR is \fBdnat_and_snat\fR\[char46] The \fIlogical_port\fR is the name of an existing logical switch port where the \fIlogical_ip\fR resides\[char46] The \fIexternal_mac\fR is an Ethernet address\[char46] .IP When \fB\-\-stateless\fR is specified then it implies that we will be not use connection tracker, i\[char46]e internal ip and external ip are 1:1 mapped\[char46] This implies that \fB\-\-stateless\fR is applicable only to dnat_and_snat type NAT rules\[char46] An external ip with \fB\-\-stateless\fR NAT cannot be shared with any other NAT rule\[char46] .IP \fB\-\-gateway\-port\fR option allows specifying the distributed gateway port of \fIrouter\fR where the NAT rule needs to be applied\[char46] \fIGATEWAY_PORT\fR should reference a \fBLogical_Router_Port\fR row that is a distributed gateway port of \fIrouter\fR\[char46] When \fIrouter\fR has multiple distributed gateway ports and the gateway port for this NAT can\(cqt be inferred from the \fIexternal_ip\fR, it is an error to not specify the \fIGATEWAY_PORT\fR\[char46] .IP When \fItype\fR is \fBdnat\fR, the externally visible IP address \fIexternal_ip\fR is DNATted to the IP address \fIlogical_ip\fR in the logical space\[char46] .IP When \fItype\fR is \fBsnat\fR, IP packets with their source IP address that either matches the IP address in \fIlogical_ip\fR or is in the network provided by \fIlogical_ip\fR is SNATed into the IP address in \fIexternal_ip\fR\[char46] .IP When \fItype\fR is \fBdnat_and_snat\fR, the externally visible IP address \fIexternal_ip\fR is DNATted to the IP address \fIlogical_ip\fR in the logical space\[char46] In addition, IP packets with the source IP address that matches \fIlogical_ip\fR is SNATed into the IP address in \fIexternal_ip\fR\[char46] .IP When the \fIlogical_port\fR and \fIexternal_mac\fR are specified, the NAT rule will be programmed on the chassis where the \fIlogical_port\fR resides\[char46] This includes ARP replies for the \fIexternal_ip\fR, which return the value of \fIexternal_mac\fR\[char46] All packets transmitted with source IP address equal to \fIexternal_ip\fR will be sent using the \fIexternal_mac\fR\[char46] .IP It is an error if a NAT already exists with the same values of \fIrouter\fR, \fItype\fR, \fIexternal_ip\fR, \fIlogical_ip\fR and \fIGATEWAY_PORT\fR (in case of multiple distributed gateway ports), unless \fB\-\-may\-exist\fR is specified\[char46] When \fB\-\-may\-exist\fR, \fIlogical_port\fR, and \fIexternal_mac\fR are all specified, the existing values of \fIlogical_port\fR and \fIexternal_mac\fR are overwritten\[char46] .TP [\fB\-\-if\-exists\fR] \fBlr\-nat\-del\fR \fIrouter\fR [\fItype\fR [\fIip\fR] [\fIgateway_port\fR]] Deletes NATs from \fIrouter\fR\[char46] If only \fIrouter\fR is supplied, all the NATs from the logical router are deleted\[char46] If \fItype\fR is also specified, then all the NATs that match the \fItype\fR will be deleted from the logical router\[char46] If \fIip\fR is also specified without specifying \fIgateway_port\fR, then all the NATs that match the \fItype\fR and \fIip\fR will be deleted from the logical router\[char46] If \fIgateway_port\fR is specified without specifying \fIip\fR, then all the NATs that match the \fItype\fR and \fIgateway_port\fR will be deleted from the logical router\[char46] If all the fields are given, then a single NAT rule that matches all the fields will be deleted\[char46] When \fItype\fR is \fBsnat\fR, the \fIip\fR should be logical_ip\[char46] When \fItype\fR is \fBdnat\fR or \fBdnat_and_snat\fR, the \fIip\fR should be external_ip\[char46] .IP It is an error if both \fIip\fR and \fIgateway_port\fR are specified and there is no matching NAT entry, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlr\-nat\-list\fR \fIrouter\fR Lists the NATs on \fIrouter\fR\[char46] .SS "Load Balancer Commands" .TP [\fB\-\-may\-exist\fR | \fB\-\-add\-duplicate\fR | \fB\-\-reject\fR | \fB\-\-event\fR] \fBlb\-add\fR \fIlb\fR \fIvip\fR \fIips\fR [\fIprotocol\fR] Creates a new load balancer named \fIlb\fR with the provided \fIvip\fR and \fIips\fR or adds the \fIvip\fR to an existing \fIlb\fR\[char46] \fIvip\fR should be a virtual IP address (or an IP address and a port number with \fB:\fR as a separator)\[char46] Examples for \fIvip\fR are \fB192\[char46]168\[char46]1\[char46]4\fR, \fBfd0f::1\fR, and \fB192\[char46]168\[char46]1\[char46]5:8080\fR\[char46] \fIips\fR should be comma separated IP endpoints (or comma separated IP addresses and port numbers with \fB:\fR as a separator)\[char46] \fIips\fR must be the same address family as \fIvip\fR\[char46] Examples for \fIips\fR are \fB10\[char46]0\[char46]0\[char46]1,10\[char46]0\[char46]0\[char46]2\fRor \fB[fdef::1]:8800,[fdef::2]:8800\fR\[char46] .IP The optional argument \fIprotocol\fR must be either \fBtcp\fR, \fBudp\fR or \fBsctp\fR\[char46] This argument is useful when a port number is provided as part of the \fIvip\fR\[char46] If the \fIprotocol\fR is unspecified and a port number is provided as part of the \fIvip\fR, OVN assumes the \fIprotocol\fR to be \fBtcp\fR\[char46] .IP It is an error if the \fIvip\fR already exists in the load balancer named \fIlb\fR, unless \fB\-\-may\-exist\fR is specified\[char46] With \fB\-\-add\-duplicate\fR, the command really creates a new load balancer with a duplicate name\[char46] .IP If the load balancer is created with \fB\-\-reject\fR option and it has no active backends, a TCP reset segment (for tcp) or an ICMP port unreachable packet (for all other kind of traffic) will be sent whenever an incoming packet is received for this load-balancer\[char46] Please note using \fB\-\-reject\fR option will disable empty_lb SB controller event for this load balancer\[char46] .IP If the load balancer is created with \fB\-\-event\fR option and it has no active backends, whenever the lb receives traffic, the event is reported in the Controller_Event table in the SB db\[char46] Please note \fB\-\-event\fR option can\(cqt be specified with \fB\-\-reject\fR one\[char46] .IP The following example adds a load balancer\[char46] .IP \fBlb\-add lb0 30\[char46]0\[char46]0\[char46]10:80 192\[char46]168\[char46]10\[char46]10:80,192\[char46]168\[char46]10\[char46]20:80,192\[char46]168\[char46]10\[char46]30:80 udp\fR .TP [\fB\-\-if\-exists\fR] \fBlb\-del\fR \fIlb\fR [\fIvip\fR] Deletes \fIlb\fR or the \fIvip\fR from \fIlb\fR\[char46] If \fIvip\fR is supplied, only the \fIvip\fR will be deleted from the \fIlb\fR\[char46] If only the \fIlb\fR is supplied, the \fIlb\fR will be deleted\[char46] It is an error if \fIvip\fR does not already exist in \fIlb\fR, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlb\-list\fR [\fIlb\fR] Lists the LBs\[char46] If \fIlb\fR is also specified, then only the specified \fIlb\fR will be listed\[char46] .TP [\fB\-\-may\-exist\fR] \fBls\-lb\-add\fR \fIswitch\fR \fIlb\fR Adds the specified \fIlb\fR to \fIswitch\fR\[char46] It is an error if a load balancer named \fIlb\fR already exists in the \fIswitch\fR, unless \fB\-\-may\-exist\fR is specified\[char46] .TP [\fB\-\-if\-exists\fR] \fBls\-lb\-del\fR \fIswitch\fR [\fIlb\fR] Removes \fIlb\fR from \fIswitch\fR\[char46] If only \fIswitch\fR is supplied, all the LBs from the logical switch are removed\[char46] If \fIlb\fR is also specified, then only the \fIlb\fR will be removed from the logical switch\[char46] It is an error if \fIlb\fR does not exist in the \fIswitch\fR, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBls\-lb\-list\fR \fIswitch\fR Lists the LBs for the given \fIswitch\fR\[char46] .TP [\fB\-\-may\-exist\fR] \fBlr\-lb\-add\fR \fIrouter\fR \fIlb\fR Adds the specified \fIlb\fR to \fIrouter\fR\[char46] It is an error if a load balancer named \fIlb\fR already exists in the \fIrouter\fR, unless \fB\-\-may\-exist\fR is specified\[char46] .TP [\fB\-\-if\-exists\fR] \fBlr\-lb\-del\fR \fIrouter\fR [\fIlb\fR] Removes \fIlb\fR from \fIrouter\fR\[char46] If only \fIrouter\fR is supplied, all the LBs from the logical router are removed\[char46] If \fIlb\fR is also specified, then only the \fIlb\fR will be removed from the logical router\[char46] It is an error if \fIlb\fR does not exist in the \fIrouter\fR, unless \fB\-\-if\-exists\fR is specified\[char46] .TP \fBlr\-lb\-list\fR \fIrouter\fR Lists the LBs for the given \fIrouter\fR\[char46] .SS "DHCP Options commands" .TP \fBdhcp\-options\-create\fR \fIcidr\fR [\fIkey=value\fR] Creates a new DHCP Options entry in the \fBDHCP_Options\fR table with the specified \fBcidr\fR and optional \fBexternal\-ids\fR\[char46] .TP \fBdhcp\-options\-list\fR Lists the DHCP Options entries\[char46] .TP \fBdhcp\-options\-del\fR \fIdhcp-option\fR Deletes the DHCP Options entry referred by \fIdhcp-option\fR UUID\[char46] .TP \fBdhcp\-options\-set\-options\fR \fIdhcp-option\fR [\fIkey=value\fR]\[char46]\[char46]\[char46] Set the DHCP Options for the \fIdhcp-option\fR UUID\[char46] .TP \fBdhcp\-options\-get\-options\fR \fIdhcp-option\fR Lists the DHCP Options for the \fIdhcp-option\fR UUID\[char46] .SS "Port Group commands" .TP \fBpg\-add\fR \fIgroup\fR [\fIport\fR]\[char46]\[char46]\[char46] Creates a new port group in the \fBPort_Group\fR table named \fBgroup\fR with optional \fBports\fR added to the group\[char46] .TP \fBpg\-set\-ports\fR \fIgroup\fR \fIport\fR\[char46]\[char46]\[char46] Sets \fBports\fR on the port group named \fBgroup\fR\[char46] It is an error if \fBgroup\fR does not exist\[char46] .TP \fBpg\-del\fR \fIgroup\fR Deletes port group \fBgroup\fR\[char46] It is an error if \fBgroup\fR does not exist\[char46] .SS "HA Chassis Group commands" .TP \fBha\-chassis\-group\-add\fR \fIgroup\fR Creates a new HA chassis group in the \fBHA_Chassis_Group\fR table named \fBgroup\fR\[char46] .TP \fBha\-chassis\-group\-del\fR \fIgroup\fR Deletes the HA chassis group \fBgroup\fR\[char46] It is an error if \fBgroup\fR does not exist\[char46] .TP \fBha\-chassis\-group\-list\fR Lists the HA chassis group \fBgroup\fR along with the \fBHA chassis\fR if any associated with it\[char46] .TP \fBha\-chassis\-group\-add\-chassis\fR \fIgroup\fR \fIchassis\fR \fIpriority\fR Adds a new HA chassis \fBchassis\fR to the HA Chassis group \fBgroup\fR with the specified priority\[char46] If the \fBchassis\fR already exists, then the \fBpriority\fR is updated\[char46] The \fBchassis\fR should be the name of the chassis in the \fBOVN_Southbound\fR\[char46] .TP \fBha\-chassis\-group\-remove\-chassis\fR \fIgroup\fR \fIchassis\fR Removes the HA chassis \fBchassis\fR from the HA chassis group \fBgroup\fR\[char46] It is an error if \fBchassis\fR does not exist\[char46] .SS "Control Plane Protection Policy commands" .PP .PP These commands manage meters configured in \fBCopp\fR table linking them to logical datapaths through \fBcopp\fR column in \fBLogical_Switch\fR or \fBLogical_Router\fR tables\[char46] Protocol packets for which CoPP is enforced when sending packets to ovn-controller (if configured): .RS .IP \(bu ARP .IP \(bu ND_NS .IP \(bu ND_NA .IP \(bu ND_RA .IP \(bu ND .IP \(bu DNS .IP \(bu IGMP .IP \(bu packets that require ARP resolution before forwarding .IP \(bu packets that require ND_NS before forwarding .IP \(bu packets that need to be replied to with ICMP Errors .IP \(bu packets that need to be replied to with TCP RST .IP \(bu packets that need to be replied to with DHCP_OPTS .IP \(bu packets that trigger a reject action .IP \(bu packets that trigger a SCTP abort action .IP \(bu controller_events .IP \(bu BFD .RE .RS .TP \fBcopp\-add\fR \fIname\fR \fIproto\fR \fImeter\fR Adds the control \fBproto\fR to \fBmeter\fR mapping to the control plane protection policy \fBname\fR\[char46] If no policy exists yet, it creates one\[char46] If a mapping already existed for \fBproto\fR, this will overwrite it\[char46] .TP \fBcopp\-del\fR \fIname\fR [\fIproto\fR] Removes the control \fBproto\fR mapping for the \fBname\fR control plane protection policy\[char46] If \fBproto\fR is not specified, the whole control plane protection policy is destroyed\[char46] .TP \fBcopp\-list\fR \fIname\fR Display the current control plane protection policy for \fBname\fR\[char46] .TP \fBls\-copp\-add\fR \fIname\fR \fIswitch\fR Adds the control plane protection policy \fBname\fR to the logical switch \fBswitch\fR\[char46] .TP \fBlr\-copp\-add\fR \fIname\fR \fIrouter\fR Adds the control plane protection policy \fBname\fR to the logical router \fBrouter\fR\[char46] .RE .SS "Mirror commands" .TP \fBmirror\-add\fR \fIm\fR \fItype\fR \fIindex\fR \fIfilter\fR \fIdest\fR Creates a new mirror in the \fBMirror\fR table with the name \fBm\fR with the below mandatory arguments\[char46] .IP \fItype\fR specifies the mirror type - \fBgre\fR or \fBerspan\fR\[char46] .IP \fIindex\fR specifies the tunnel index value (which is an integer)\[char46] .IP \fIfilter\fR specifies the mirror source selection\[char46] Can be \fBfrom\-lport\fR or \fBto\-lport\fR\[char46] .IP \fIdest\fR specifies the mirror destination IP (v4 or v6)\[char46] .TP \fBmirror\-del\fR \fIm\fR Deletes the mirror \fBm\fR\[char46] .TP \fBmirror\-list\fR Lists the mirrors\[char46] .SS "Synchronization Commands" .TP sync Ordinarily, \fB\-\-wait=sb\fR or \fB\-\-wait=hv\fR only waits for changes by the current \fBovn\-nbctl\fR invocation to take effect\[char46] This means that, if none of the commands supplied to \fBovn\-nbctl\fR change the database, then the command does not wait at all\[char46] With the \fBsync\fR command, however, \fBovn\-nbctl\fR waits even for earlier changes to the database to propagate down to the southbound database or all of the OVN chassis, according to the argument to \fB\-\-wait\fR\[char46] .SS "Remote Connectivity Commands" .PP .PP These commands manipulate the \fBconnections\fR column in the \fBNB_Global\fR table and rows in the \fBConnection\fR table\[char46] When \fBovsdb\-server\fR is configured to use the \fBconnections\fR column for OVSDB connections, this allows the administrator to use \fBovn\-nbctl\fR to configure database connections\[char46] .RS .TP \fBget\-connection\fR Prints the configured connection(s)\[char46] .TP \fBdel\-connection\fR Deletes the configured connection(s)\[char46] .TP [\fB\-\-inactivity\-probe=\fR\fImsecs\fR] \fBset\-connection\fR \fItarget\fR\[char46]\[char46]\[char46] Sets the configured manager target or targets\[char46] Use \fB\-\-inactivity\-probe=\fR\fImsecs\fR to override the default idle connection inactivity probe time\[char46] Use 0 to disable inactivity probes\[char46] .RE .SS "SSL Configuration Commands" .TP \fBget\-ssl\fR Prints the SSL configuration\[char46] .TP \fBdel\-ssl\fR Deletes the current SSL configuration\[char46] .TP [\fB\-\-bootstrap\fR] \fBset\-ssl\fR \fIprivate-key\fR \fIcertificate\fR \fIca-cert\fR [\fIssl-protocol-list\fR [\fIssl-cipher-list\fR]] Sets the SSL configuration\[char46] .SS "Database Commands" .PP .PP These commands query and modify the contents of \fBovsdb\fR tables\[char46] They are a slight abstraction of the \fBovsdb\fR interface and as such they operate at a lower level than other \fBovn\-nbctl\fR commands\[char46] .PP \fIIdentifying Tables, Records, and Columns\fR .PP .PP Each of these commands has a \fItable\fR parameter to identify a table within the database\[char46] Many of them also take a \fIrecord\fR parameter that identifies a particular record within a table\[char46] The \fIrecord\fR 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\[char46] Many tables offer additional ways to identify records\[char46] Some commands also take \fIcolumn\fR parameters that identify a particular field within the records in a table\[char46] .PP .PP For a list of tables and their columns, see \fBovn\-nb\fR(5) or see the table listing from the \fB\-\-help\fR option\[char46] .PP .PP 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\[char46] Names of tables and columns are not case-sensitive, and \fB\-\fR and \fB_\fR are treated interchangeably\[char46] Unique abbreviations of table and column names are acceptable, e\[char46]g\[char46] \fBd\fR or \fBdhcp\fR is sufficient to identify the \fBDHCP_Options\fR table\[char46] .PP .PP .PP \fIDatabase Values\fR .PP .PP Each column in the database accepts a fixed type of data\[char46] The currently defined basic types, and their representations, are: .RS .TP integer A decimal integer in the range \-2**63 to 2**63\-1, inclusive\[char46] .TP real A floating-point number\[char46] .TP Boolean True or false, written \fBtrue\fR or \fBfalse\fR, respectively\[char46] .TP string An arbitrary Unicode string, except that null bytes are not allowed\[char46] Quotes are optional for most strings that begin with an English letter or underscore and consist only of letters, underscores, hyphens, and periods\[char46] However, \fBtrue\fR and \fBfalse\fR and strings that match the syntax of UUIDs (see below) must be enclosed in double quotes to distinguish them from other basic types\[char46] When double quotes are used, the syntax is that of strings in JSON, e\[char46]g\[char46] backslashes may be used to escape special characters\[char46] The empty string must be represented as a pair of double quotes (\fB\(dq\(dq\fR)\[char46] .TP UUID Either a universally unique identifier in the style of RFC 4122, e\[char46]g\[char46] \fBf81d4fae\-7dec\-11d0\-a765\-00a0c91e6bf6\fR, or an \fB@\fR\fIname\fR defined by a \fBget\fR or \fBcreate\fR command within the same \fBovs\-vsctl\fR invocation\[char46] .RE .PP .PP Multiple values in a single column may be separated by spaces or a single comma\[char46] When multiple values are present, duplicates are not allowed, and order is not important\[char46] Conversely, some database columns can have an empty set of values, represented as \fB[]\fR, and square brackets may optionally enclose other non-empty sets or single values as well\[char46] .PP .PP A few database columns are ``maps\(cq\(cq of key-value pairs, where the key and the value are each some fixed database type\[char46] These are specified in the form \fIkey\fR\fB=\fR\fIvalue\fR, where \fIkey\fR and \fIvalue\fR follow the syntax for the column\(cqs key type and value type, respectively\[char46] When multiple pairs are present (separated by spaces or a comma), duplicate keys are not allowed, and again the order is not important\[char46] Duplicate values are allowed\[char46] An empty map is represented as \fB{}\fR\[char46] Curly braces may optionally enclose non-empty maps as well (but use quotes to prevent the shell from expanding \fBother\-config={0=x,1=y}\fR into \fBother\-config=0=x other\-config=1=y\fR, which may not have the desired effect)\[char46] .PP \fIDatabase Command Syntax\fR .RS .TP [\fB\-\-if\-exists\fR] [\fB\-\-columns=\fR\fIcolumn\fR[\fB,\fR\fIcolumn\fR]\[char46]\[char46]\[char46]] \fBlist\fR \fItable\fR [\fIrecord\fR]\[char46]\[char46]\[char46] Lists the data in each specified \fIrecord\fR\[char46] If no records are specified, lists all the records in \fItable\fR\[char46] .IP If \fB\-\-columns\fR is specified, only the requested columns are listed, in the specified order\[char46] Otherwise, all columns are listed, in alphabetical order by column name\[char46] .IP Without \fB\-\-if\-exists\fR, it is an error if any specified \fIrecord\fR does not exist\[char46] With \fB\-\-if\-exists\fR, the command ignores any \fIrecord\fR that does not exist, without producing any output\[char46] .TP [\fB\-\-columns=\fR\fIcolumn\fR[\fB,\fR\fIcolumn\fR]\[char46]\[char46]\[char46]] \fBfind\fR \fItable\fR [\fIcolumn\fR[\fB:\fR\fIkey\fR]\fB=\fR\fIvalue\fR]\[char46]\[char46]\[char46] Lists the data in each record in \fItable\fR whose \fIcolumn\fR equals \fIvalue\fR or, if \fIkey\fR is specified, whose \fIcolumn\fR contains a \fIkey\fR with the specified \fIvalue\fR\[char46] The following operators may be used where \fB=\fR is written in the syntax summary: .RS .TP \fB= != < > <= >=\fR Selects records in which \fIcolumn\fR[\fB:\fR\fIkey\fR] equals, does not equal, is less than, is greater than, is less than or equal to, or is greater than or equal to \fIvalue\fR, respectively\[char46] .IP Consider \fIcolumn\fR[\fB:\fR\fIkey\fR] and \fIvalue\fR as sets of elements\[char46] Identical sets are considered equal\[char46] Otherwise, if the sets have different numbers of elements, then the set with more elements is considered to be larger\[char46] Otherwise, consider a element from each set pairwise, in increasing order within each set\[char46] The first pair that differs determines the result\[char46] (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\[char46]) .TP \fB{=} {!=}\fR Test for set equality or inequality, respectively\[char46] .TP \fB{<=}\fR Selects records in which \fIcolumn\fR[\fB:\fR\fIkey\fR] is a subset of \fIvalue\fR\[char46] For example, \fBflood\-vlans{<=}1,2\fR selects records in which the \fBflood\-vlans\fR column is the empty set or contains 1 or 2 or both\[char46] .TP \fB{<}\fR Selects records in which \fIcolumn\fR[\fB:\fR\fIkey\fR] is a proper subset of \fIvalue\fR\[char46] For example, \fBflood\-vlans{<}1,2\fR selects records in which the \fBflood\-vlans\fR column is the empty set or contains 1 or 2 but not both\[char46] .TP \fB{>=} {>}\fR Same as \fB{<=}\fR and \fB{<}\fR, respectively, except that the relationship is reversed\[char46] For example, \fBflood\-vlans{>=}1,2\fR selects records in which the \fBflood\-vlans\fR column contains both 1 and 2\[char46] .RE .IP The following operators are available only in Open vSwitch 2\[char46]16 and later: .RS .TP \fB{in}\fR Selects records in which every element in \fIcolumn\fR[\fB:\fR\fIkey\fR] is also in \fIvalue\fR\[char46] (This is the same as \fB{<=}\fR\[char46]) .TP \fB{not\-in}\fR Selects records in which every element in \fIcolumn\fR[\fB:\fR\fIkey\fR] is not in \fIvalue\fR\[char46] .RE .IP For arithmetic operators (\fB= != < > <= >=\fR), when \fIkey\fR is specified but a particular record\(cqs \fIcolumn\fR does not contain \fIkey\fR, the record is always omitted from the results\[char46] Thus, the condition \fBother\-config:mtu!=1500\fR matches records that have a \fBmtu\fR key whose value is not 1500, but not those that lack an \fBmtu\fR key\[char46] .IP For the set operators, when \fIkey\fR is specified but a particular record\(cqs \fIcolumn\fR does not contain \fIkey\fR, the comparison is done against an empty set\[char46] Thus, the condition \fBother\-config:mtu{!=}1500\fR matches records that have a \fBmtu\fR key whose value is not 1500 and those that lack an \fBmtu\fR key\[char46] .IP Don\(cqt forget to escape \fB<\fR or \fB>\fR from interpretation by the shell\[char46] .IP If \fB\-\-columns\fR is specified, only the requested columns are listed, in the specified order\[char46] Otherwise all columns are listed, in alphabetical order by column name\[char46] .IP The UUIDs shown for rows created in the same \fBovs\-vsctl\fR invocation will be wrong\[char46] .TP [\fB\-\-if\-exists\fR] [\fB\-\-id=@\fR\fIname\fR] \fBget\fR \fItable record\fR [\fIcolumn\fR[\fB:\fR\fIkey\fR]]\[char46]\[char46]\[char46] Prints the value of each specified \fIcolumn\fR in the given \fIrecord\fR in \fItable\fR\[char46] For map columns, a \fIkey\fR may optionally be specified, in which case the value associated with \fIkey\fR in the column is printed, instead of the entire map\[char46] .IP Without \fB\-\-if\-exists\fR, it is an error if \fIrecord\fR does not exist or \fIkey\fR is specified, if \fIkey\fR does not exist in \fIrecord\fR\[char46] With \fB\-\-if\-exists\fR, a missing \fIrecord\fR yields no output and a missing \fIkey\fR prints a blank line\[char46] .IP If \fB@\fR\fIname\fR is specified, then the UUID for \fIrecord\fR may be referred to by that name later in the same \fBovs\-vsctl\fR invocation in contexts where a UUID is expected\[char46] .IP Both \fB\-\-id\fR and the \fIcolumn\fR arguments are optional, but usually at least one or the other should be specified\[char46] If both are omitted, then \fBget\fR has no effect except to verify that \fIrecord\fR exists in \fItable\fR\[char46] .IP \fB\-\-id\fR and \fB\-\-if\-exists\fR cannot be used together\[char46] .TP [\fB\-\-if\-exists\fR] \fBset\fR \fItable record column\fR[\fB:\fR\fIkey\fR]\fB=\fR\fIvalue\fR\[char46]\[char46]\[char46] Sets the value of each specified \fIcolumn\fR in the given \fIrecord\fR in \fItable\fR to \fIvalue\fR\[char46] For map columns, a \fIkey\fR may optionally be specified, in which case the value associated with \fIkey\fR in that column is changed (or added, if none exists), instead of the entire map\[char46] .IP Without \fB\-\-if\-exists\fR, it is an error if \fIrecord\fR does not exist\[char46] With \fB\-\-if\-exists\fR, this command does nothing if \fIrecord\fR does not exist\[char46] .TP [\fB\-\-if\-exists\fR] \fBadd\fR \fItable record column\fR [\fIkey\fR\fB=\fR]\fIvalue\fR\[char46]\[char46]\[char46] Adds the specified value or key-value pair to \fIcolumn\fR in \fIrecord\fR in \fItable\fR\[char46] If \fIcolumn\fR is a map, then \fIkey\fR is required, otherwise it is prohibited\[char46] If \fIkey\fR already exists in a map column, then the current \fIvalue\fR is not replaced (use the \fBset\fR command to replace an existing value)\[char46] .IP Without \fB\-\-if\-exists\fR, it is an error if \fIrecord\fR does not exist\[char46] With \fB\-\-if\-exists\fR, this command does nothing if \fIrecord\fR does not exist\[char46] .TP [\fB\-\-if\-exists\fR] \fBremove\fR \fItable record column value\fR\[char46]\[char46]\[char46] .IP [\fB\-\-if\-exists\fR] \fBremove\fR \fItable record column key\fR\[char46]\[char46]\[char46] .IP [\fB\-\-if\-exists\fR] \fBremove\fR \fItable record column key\fR\fB=\fR\fIvalue\fR\[char46]\[char46]\[char46] Removes the specified values or key-value pairs from \fIcolumn\fR in \fIrecord\fR in \fItable\fR\[char46] The first form applies to columns that are not maps: each specified \fIvalue\fR is removed from the column\[char46] The second and third forms apply to map columns: if only a \fIkey\fR is specified, then any key-value pair with the given \fIkey\fR is removed, regardless of its value; if a \fIvalue\fR is given then a pair is removed only if both key and value match\[char46] .IP It is not an error if the column does not contain the specified key or value or pair\[char46] .IP Without \fB\-\-if\-exists\fR, it is an error if \fIrecord\fR does not exist\[char46] With \fB\-\-if\-exists\fR, this command does nothing if \fIrecord\fR does not exist\[char46] .TP [\fB\-\-if\-exists\fR] \fBclear\fR \fItable record column\fR\[char46]\[char46]\[char46] Sets each \fIcolumn\fR in \fIrecord\fR in \fItable\fR to the empty set or empty map, as appropriate\[char46] This command applies only to columns that are allowed to be empty\[char46] .IP Without \fB\-\-if\-exists\fR, it is an error if \fIrecord\fR does not exist\[char46] With \fB\-\-if\-exists\fR, this command does nothing if \fIrecord\fR does not exist\[char46] .TP [\fB\-\-id=(@\fR\fIname\fR|\fIuuid\fR)] \fBcreate\fR \fItable column\fR[\fB:\fR\fIkey\fR]\fB=\fR\fIvalue\fR\[char46]\[char46]\[char46] Creates a new record in \fItable\fR and sets the initial values of each \fIcolumn\fR\[char46] Columns not explicitly set will receive their default values\[char46] Outputs the UUID of the new row\[char46] .IP If \fB@\fR\fIname\fR is specified, then the UUID for the new row may be referred to by that name elsewhere in the same \fB\e*(PN\fR invocation in contexts where a UUID is expected\[char46] Such references may precede or follow the \fBcreate\fR command\[char46] .IP If a valid \fIuuid\fR is specified, then it is used as the UUID of the new row\[char46] .RS .TP Caution (ovs-vsctl as example) Records in the Open vSwitch database are significant only when they can be reached directly or indirectly from the \fBOpen_vSwitch\fR table\[char46] Except for records in the \fBQoS\fR or \fBQueue\fR tables, records that are not reachable from the \fBOpen_vSwitch\fR table are automatically deleted from the database\[char46] This deletion happens immediately, without waiting for additional \fBovs\-vsctl\fR commands or other database activity\[char46] Thus, a \fBcreate\fR command must generally be accompanied by additional commands \fIwithin the same\fR \fBovs\-vsctl\fR \fIinvocation\fR to add a chain of references to the newly created record from the top-level \fBOpen_vSwitch\fR record\[char46] The \fBEXAMPLES\fR section gives some examples that show how to do this\[char46] .RE .TP [\fB\-\-if\-exists\fR] \fBdestroy\fR \fItable record\fR\[char46]\[char46]\[char46] Deletes each specified \fIrecord\fR from \fItable\fR\[char46] Unless \fB\-\-if\-exists\fR is specified, each \fIrecord\fRs must exist\[char46] .TP \fB\-\-all destroy\fR \fItable\fR Deletes all records from the \fItable\fR\[char46] .RS .TP Caution (ovs-vsctl as example) The \fBdestroy\fR command is only useful for records in the \fBQoS\fR or \fBQueue\fR tables\[char46] Records in other tables are automatically deleted from the database when they become unreachable from the \fBOpen_vSwitch\fR table\[char46] This means that deleting the last reference to a record is sufficient for deleting the record itself\[char46] For records in these tables, \fBdestroy\fR is silently ignored\[char46] See the \fBEXAMPLES\fR section below for more information\[char46] .RE .TP \fBwait\-until\fR \fItable record\fR [\fIcolumn\fR[\fB:\fR\fIkey\fR]\fB=\fR\fIvalue\fR]\[char46]\[char46]\[char46] Waits until \fItable\fR contains a record named \fIrecord\fR whose \fIcolumn\fR equals \fIvalue\fR or, if \fIkey\fR is specified, whose \fIcolumn\fR contains a \fIkey\fR with the specified \fIvalue\fR\[char46] This command supports the same operators and semantics described for the \fBfind\fR command above\[char46] .IP If no \fIcolumn\fR[\fB:\fR\fIkey\fR]\fB=\fR\fIvalue\fR arguments are given, this command waits only until \fIrecord\fR exists\[char46] If more than one such argument is given, the command waits until all of them are satisfied\[char46] .RS .TP Caution (ovs-vsctl as example) Usually \fBwait\-until\fR should be placed at the beginning of a set of \fBovs\-vsctl\fR commands\[char46] For example, \fBwait\-until bridge br0 \-\- get bridge br0 datapath_id\fR waits until a bridge named \fBbr0\fR is created, then prints its \fBdatapath_id\fR column, whereas \fBget bridge br0 datapath_id \-\- wait\-until bridge br0\fR will abort if no bridge named \fBbr0\fR exists when \fBovs\-vsctl\fR initially connects to the database\[char46] .RE .IP Consider specifying \fB\-\-timeout=0\fR along with \fB\-\-wait\-until\fR, to prevent \fBovs\-vsctl\fR from terminating after waiting only at most 5 seconds\[char46] .TP \fBcomment\fR [\fIarg\fR]\[char46]\[char46]\[char46] This command has no effect on behavior, but any database log record created by the command will include the command and its arguments\[char46] .RE .SH "ENVIRONMENT" .TP \fBOVN_NB_DAEMON\fR If set, this should name the Unix domain socket for an \fBovn\-nbctl\fR server process\[char46] See \fBDaemon Mode\fR, above, for more information\[char46] .TP \fBOVN_NBCTL_OPTIONS\fR If set, a set of options for \fBovn\-nbctl\fR to apply automatically, in the same form as on the command line\[char46] .TP \fBOVN_NB_DB\fR If set, the default database to contact when the \fB\-\-db\fR option is not used\[char46] .SH "EXIT STATUS" .TP 0 Successful program execution\[char46] .TP 1 Usage, syntax, or network error\[char46] .SH "SEE ALSO" \fBovn\-nb\fR(5), \fBovn\-appctl\fR(8)\[char46]