ovn-ic-nbctl(8)
β¨ ovn-ic-nbctl β the Open Virtual Network interconnection northbound db management utility β¨
ok bestie, so this is ovn-ic-nbctl, and it lives in section 8 of the OVN Manual. It's the whole entire vibe for managing the OVN interconnection northbound database. Let's get into it π
πΈ SYNOPSIS πΈ
ovn-ic-nbctl [options] command [arg...]
π¦ DESCRIPTION π¦
This utility can be used to manage the OVN interconnection northbound database. That's it, that's the whole job, and it ate π
β GENERAL COMMANDS β
initβ Initializes the database, if it is empty. If the database has already been initialized, this command has no effect. It's giving "if you know you know, otherwise we're not touching it."showβ Prints a brief overview of the database contents. A little vibe check on the whole db, if you will.
π TRANSIT SWITCH COMMANDS π
[--may-exist] ts-addswitch β Creates a new transit switch named switch.
Transit switch names must be unique. Adding a duplicated name results in error. With --may-exist, adding a duplicate name succeeds but does not create a new transit switch. So like, it's fine, nothing new happens, no drama, no new switch. π«Ά
[--if-exists] ts-delswitch β Deletes switch. It is an error if switch does not exist, unless--if-existsis specified. πts-listβ Lists all existing switches on standard output, one per line. So satisfying to read ngl π[--may-exist] tsp-addswitch port[column[:key] =value]...β Creates a new transit switch port named port on switch.
Transit switch port names must be unique. Adding a duplicated name results in error. With --may-exist, adding a duplicate name succeeds but does not create a new transit switch port.
[--if-exists] tsp-delport β Deletes port. It is an error if port does not exist, unless--if-existsis specified.tsp-set-addrport[address]...β Sets the addresses associated with port to address. Each address should be one of the following:- an Ethernet address, optionally followed by a space and one or more IP addresses
- OVN delivers packets for the Ethernet address to this port.
routerβ Accepted only when the type of the transit switch port isrouter. This indicates that the Ethernet, IPv4, and IPv6 addresses for this transit switch port should be obtained from the connected logical router port, as specified bypeerpeer column.
- an Ethernet address, optionally followed by a space and one or more IP addresses
Multiple addresses may be set. If no address argument is given, port will have no addresses associated with it. Clean slate, iconic behavior β¨
πΎ 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-ic-nbctl commands. So like, we're going deep. Bring snacks. π
π 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-ic-nb(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. t or transit is sufficient to identify the Transit_Switch table. Short king behavior, we love to see it π
π§ 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**63to2**63-1, inclusive.realβ A floating-point number.Booleanβ True or false, writtentrueorfalse, 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,trueandfalseand 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 agetorcreatecommand within the sameovs-vsctlinvocation.
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). Shell expansion is not your friend here bestie, wrap it in quotes π
β¨οΈ Database Command Syntax
[--if-exists] [--columns=column[,column]...] listtable[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. Silence. Peace. π§
[--columns=column[,column]...] findtable[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,2selects records in which theflood-vlanscolumn is the empty set or contains1or2or both.{<}β Selects records in which column[:key]is a proper subset of value. For example,flood-vlans{<}1,2selects records in which theflood-vlanscolumn is the empty set or contains1or2but not both.{>=} {>}β Same as{<=}and{<}, respectively, except that the relationship is reversed. For example,flood-vlans{>=}1,2selects records in which theflood-vlanscolumn contains both1and2.
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. Your shell will absolutely try something if you don't π«
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. Not a drill, bestie, don't trust those UUIDs π
[--if-exists] [--id=@name] get table record [column[:key]]...β bestie, this one reads stuff. It prints the value of every column you list, in the record you picked, inside table. And if a column is a map? You can drop a key after it with:and it'll print just the value sitting at that key instead of the whole entire map. π
So like, no --if-exists? Then it's an error if record doesn't exist, or if you named a key and that key isn't in record. With --if-exists, a missing record gives you literally nothing back (no output, no drama) and a missing key just prints a blank line. π
Oh and if you pass @name, then that name becomes a whole nickname for the record's UUID, and you can refer to it later in the same ovs-vsctl invocation anywhere a UUID is expected. Iconic behavior honestly. β¨
Both --id and the column arguments are optional β but fr, usually you want at least one of them. If you omit both, get does absolutely nothing except verify that record exists in table. It's giving "I'm just here to vibe check." π«Ά
Heads up:--idand--if-existscan NOT be used together. Periodt.
[--if-exists] set table record column[:key]=value...β the glow-up command π. It sets the value of each column you name in that record in table to value. For map columns you can name a key and it'll change (or add, if there's nothing there yet) just the value at that key, instead of replacing the whole map.
No --if-exists? It's an error if record doesn't exist. With --if-exists, the command just does nothing when record doesn't exist. No fuss, no mess. πΈ
[--if-exists] add table record column [key=]value...β this one appends the value or key-value pair you give it to column in record in table. If column is a map, then key is required β and if column isn't a map, then key is straight up prohibited. π«
Big important thing: if key already exists in a map column, the current value is not replaced. That's what set is for, bestie. add is not a replacement girlie, it's an addition girlie. π
No --if-exists β error if record doesn't exist. With --if-exists β does nothing if record doesn't exist.
[--if-exists] remove table record column value...[--if-exists] remove table record column key...[--if-exists] remove table record column key=value...β the three flavors of removal π¦. They remove the values or key-value pairs you specify from column in record in table.- The first form is for columns that are not maps: each value you list gets removed from the column.
- The second and third forms are for map columns: if you only give a key, then any key-value pair with that key gets removed, no matter what its value is. If you give a value too, then a pair only gets removed if both the key and the value match. No cap. π§
And listen: it is not an error if the column doesn't contain the key, value, or pair you asked to remove. It's just like, okay, nothing to do, moving on. π
No --if-exists β error if record doesn't exist. With --if-exists β does nothing if record doesn't exist.
[--if-exists] clear table record column...β clears each column in record in table to the empty set or empty map, whichever is appropriate. β
Important: this command applies only to columns that are allowed to be empty. Don't try it on the ones that aren't.
No --if-exists β error if record doesn't exist. With --if-exists β does nothing if record doesn't exist.
[--id=(@name|uuid)] create table column[:key]=value...β creating a whole new record, main character energy π. It makes a new record in table and sets the initial values of each column. Any column you don't explicitly set just receives its default value. And then it outputs the UUID of the brand new row. π«
If you specify @name, then the new row's UUID can be referred to by that name anywhere else in the same ovn-ic-nbctl invocation where a UUID is expected. And plot twist: those references can come before or after the create command. Time is fake. β³
If you hand it a valid uuid, then that uuid 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 theOpen_vSwitchtable. Except for records in theQoSorQueuetables, records that are not reachable from theOpen_vSwitchtable are automatically deleted from the database. π This deletion happens immediately, without waiting for additionalovs-vsctlcommands or other database activity. So acreatecommand must generally be accompanied by additional commands within the sameovs-vsctlinvocation to add a chain of references to the newly created record from the top-levelOpen_vSwitchrecord. 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-existsis specified, each record must exist. π--all destroy tableβ nukes all records from the table. Everything. Gone. π
Caution (ovs-vsctl as example): Thedestroycommand is only useful for records in theQoSorQueuetables. Records in other tables are automatically deleted from the database when they become unreachable from theOpen_vSwitchtable. This means that deleting the last reference to a record is sufficient for deleting the record itself. For records in these tables,destroyis silently ignored. See the EXAMPLES section below for more information.
wait-until table record [column[:key]=value]...β the "bestie I'll wait, you go ahead" command π«Ά. It waits until table contains a record named record whose column equals value, or β if you specified key β whose column contains a key with that specified value. This command supports the same operators and semantics described for thefindcommand above. So like, same rules, different day. β¨
If you give it zero column[:key]=value arguments, it just waits until record exists, that's it. If you give it more than one, it waits until all of them are satisfied. It's an all-or-nothing girlie. π
Caution (ovs-vsctl as example): Usuallywait-untilshould be placed at the beginning of a set ofovs-vsctlcommands. For example,wait-until bridge br0 -- get bridge br0 datapath_idwaits until a bridge namedbr0is created, then prints itsdatapath_idcolumn β whereasget bridge br0 datapath_id -- wait-until bridge br0will abort if no bridge namedbr0exists whenovs-vsctlinitially connects to the database. Order matters, bestie. π
Also consider specifying --timeout=0 along with --wait-until, to prevent ovs-vsctl from terminating after waiting only at most 5 seconds. Clock's ticking. β°
comment [arg]...β this command has no effect on behavior whatsoever, but any database log record created by the command will include the command and its arguments. It's basically a little note-to-self in the logs. π
π REMOTE CONNECTIVITY COMMANDS
get-connectionβ prints the configured connection(s). Simple as that. πdel-connectionβ deletes the configured connection(s). Bye bye. π[--inactivity-probe=msecs] set-connection target...β sets the configured manager target or targets. Use--inactivity-probe=msecsto override the default idle connection inactivity probe time. And use0to disable inactivity probes entirely. π¦
π SSL/TLS CONFIGURATION COMMANDS
get-sslβ prints the SSL/TLS configuration. β¨del-sslβ deletes the current SSL/TLS configuration. πΈ[--bootstrap] set-ssl private-key certificate ca-cert [ssl-protocol-list [ssl-cipher-list [ssl-ciphersuites]]]β sets the SSL/TLS configuration. All those nested optional bits are exactly as written, bestie β nest responsibly. π
π SYNCHRONIZATION COMMANDS
syncβ okay so ordinarily,--wait=sbonly waits for changes made by the currentovn-ic-nbctlinvocation to take effect. Which means if none of the commands you handed toovn-ic-nbctlactually change the database, then the command doesn't wait at all. Zero patience. π΄
With the sync command, though? ovn-ic-nbctl waits even for earlier changes to the database to propagate down to the southbound database, according to the argument of --wait. So it's giving "I'll wait for the whole timeline to catch up." β³β¨
β¨ OPTIONS β¨
Okay bestie, this is the part where you get to tell ovn-ic-nbctl how to behave. Buckle up. π
--no-wait,--wait=none,--wait=sbβ these three control whether and howovn-ic-nbctlwaits for the OVN system to become up-to-date with the changes you just made in anovn-ic-nbctlinvocation. π
By default, or if you pass --no-wait or --wait=none, ovn-ic-nbctl dips immediately after confirming that changes have been committed to the Interconnect northbound database β no waiting, no lingering, she's got places to be. β¨
With --wait=sb, before ovn-ic-nbctl exits, it waits for ovn-ics to bring the Interconnect southbound database up-to-date with the Interconnect northbound database updates. patient queen behavior.
Ordinarily, --wait=sb only waits for changes by the current ovn-ic-nbctl invocation to take effect. Which means β plot twist π β if none of the commands you handed to ovn-ic-nbctl actually change the database, then the command doesn't wait at all. Zero. Nada. Use the sync command to override this behavior. π«Ά
--dbdatabase β the OVSDB database remote to contact. If theOVN_IC_NB_DBenvironment variable is set, its value is used as the default. Otherwise, the default isunix:/ovn_ic_nb_db.sockβ but lowkey, that 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-ic-nbctlwill avoid servers other than the cluster leader. This ensures that any data thatovn-ic-nbctlreads and reports is up-to-date. fresh data only, no cap. With--no-leader-only,ovn-ic-nbctlwill 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 inovsdb(7)for more information. π
πΈ LOGGING OPTIONS πΈ
This is where you decide how chatty she gets. vibe check your verbosity.
-v[spec],--verbose=[spec]β sets logging levels. Without any spec, sets the log level for every module and destination todbg. 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/listcommand onovs-appctl(8), limits the log level change to the specified module. syslog,console, orfile, to limit the log level change to only to the system log, to the console, or to a file, respectively. (If--detachis specified, the daemon closes its standard file descriptors, so logging to the console will have no effect. π)off,emer,err,warn,info, ordbg, to control the log level. Messages of the given severity or higher will be logged, and messages of lower severity will be filtered out.offfilters out all messages. Seeovs-appctl(8)for a definition of each log level.
- A valid module name, as displayed by the
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. maximum chaos, slay.-vPATTERN:destination:pattern,--verbose=PATTERN:destination:patternβ sets the log pattern for destination to pattern. Refer toovs-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 ofkern,user,mail,daemon,auth,syslog,lpr,news,uucp,clock,ftp,ntp,audit,alert,clock2,local0,local1,local2,local3,local4,local5,local6orlocal7. If this option is not specified,daemonis used as the default for the local system syslog andlocal0is used while sending a message to the target provided via the--syslog-targetoption. π--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. π« no hostnames bestie, numbers only.--syslog-method=methodβ specify method as how syslog messages should be sent to syslog daemon. The following forms are supported:libc, to use the libcsyslog()function. Downside of using this options is that libc adds a fixed prefix to every message before it is actually sent to the syslog daemon over/dev/logUNIX domain socket. πunix:file, to use a UNIX domain socket directly. It is possible to specify arbitrary message format with this option. However,rsyslogd8.9 and older versions use a hard coded parser function anyway that limits UNIX domain socket use. If you want to use arbitrary message format with olderrsyslogdversions, then use a 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 olderrsyslogd. 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, accidentaliptablesrules 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. Yes bestie, your tables can be cute or machine-readable, you choose π
-fformat,--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.
-dformat,--data=format β Sets the formatting for cells within output tables unless the table format is set tojson, in which casejsonformatting is always used when formatting cells. The following types of format are available:string(default) β The simple format described in the Database Values section ofovs-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. bye bye header row π«Ά--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.
Real talk: this option does not affect JSON in tables, which is always printed compactly. She's got her own rules, periodt β¨
--bareβ Equivalent to--format=list --data=bare --no-headings.
π PKI Options π
PKI configuration is required to use SSL/TLS for the connection to the database. No certs, no secure vibes, bestie π
-pprivkey.pem,--private-key=privkey.pem β Specifies a PEM file containing the private key used as identity for outgoing SSL/TLS connections.-ccert.pem,--certificate=cert.pem β Specifies a PEM file containing a certificate that certifies the private key specified on-por--private-keyto be trustworthy. The certificate must be signed by the certificate authority (CA) that the peer in SSL/TLS connections will use to verify it.-Ccacert.pem,--ca-cert=cacert.pem β Specifies a PEM file containing the CA certificate for verifying certificates presented to this program by SSL/TLS peers. (This may be the same certificate that SSL/TLS peers use to verify the certificate specified on-cor--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/TLS peers. This introduces a security risk, because it means that certificates cannot be verified to be those of known trusted hosts. Do not do this casually bestie, I'm begging π--ssl-server-name=servername β Specifies the server name to use for TLS Server Name Indication (SNI). By default, the hostname from the connection string is used for SNI. This option allows overriding the SNI hostname, which is useful when connecting through proxies or service meshes where the connection endpoint differs from the intended server name.--bootstrap-ca-cert=cacert.pem β When cacert.pem exists, this option has the same effect as-Cor--ca-cert. If it does not exist, then the executable will attempt to obtain the CA certificate from the SSL/TLS peer on its first SSL/TLS 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/TLS connections must be authenticated by a certificate signed by the CA certificate thus obtained.
Warning: this option exposes the SSL/TLS 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/TLS peer sends its CA certificate as part of the SSL/TLS certificate chain. SSL/TLS protocols do not require the server to send the CA certificate.
This option is mutually exclusive with -C and --ca-cert. Pick one, you cannot have both π«
β¨ Other Options β¨
-h,--helpβ Prints a brief help message to the console.-V,--versionβ Prints version information to the console.
And that's the whole page, bestie!! π¦ You just read an entire manual page and honestly? main character energy π Go forth and configure OVN with confidence, iykyk π
This icon of a page comes to you from OVN 26.09.1, filed under ovn-ic-nbctl in section ovn-ic-nbctl(8). Slay π
πΈ
π¦ where this page comes from
- fedora 44: ovn 26.09.0-33.fc44 Β· Apache-2.0 AND LGPL-2.1-only AND SISSL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms