ovn-sbctl(8)
π ovn-sbctl(8) β OVN Manual π
β¨ NAME β¨
ovn-sbctl β Open Virtual Network southbound db management utility π«Ά
β¨ SYNOPSIS β¨
ovn-sbctl [options] command [arg...]
β¨ DESCRIPTION β¨
Okay bestie, so ovn-sbctl is the program that configures the OVN_Southbound database, and it does it by giving you a high-level interface to its configuration database. If you want the full, comprehensive tea on what the database schema actually looks like, go read ovn-sb(5). π
ovn-sbctl connects to an ovsdb-server process that maintains an OVN_Southbound configuration database. Through that connection it queries the database, and it might also apply changes to it β depends entirely on which commands you gave it. π
Here's the iconic part: ovn-sbctl can run any number of commands in a single run, and it implements all of them as a single atomic transaction against the database. One shot, one transaction. Periodt. β¨
The ovn-sbctl command line starts with global options (scroll down to OPTIONS for the whole list). After the global options come one or more commands. Each command should begin with -- all by itself as a command-line argument, so it's separated from the commands that follow it. (Fun fact: the -- before the first command is optional.) Then the command itself starts with any command-specific options, followed by the command name and whatever arguments it takes. πΈ
π¦ DAEMON MODE π¦
So when you invoke ovn-sbctl in the most ordinary, basic way? It connects to an OVSDB server hosting the southbound database, grabs a partial copy of the database (complete enough to do its job), sends a transaction request to the server, and then receives and processes the server's reply. For common interactive use this is genuinely fine. But if the database is large, that step where it retrieves a partial copy can take a long time, and that means the overall performance is lowkey bad. π
To fix that, ovn-sbctl offers a "daemon mode", where you first start ovn-sbctl running in the background and then use the daemon to execute your operations. Over several ovn-sbctl command invocations this performs better overall, because it retrieves a copy of the database only once at the beginning instead of once per program run. Iconic efficiency. π
Use the --detach option to start an ovn-sbctl daemon. With that option, ovn-sbctl prints the name of a control socket to stdout. Your client should save that name in the environment variable OVN_SB_DAEMON. Under the Bourne shell you might do it like this:
export OVN_SB_DAEMON=$(ovn-sbctl --pidfile --detach)
When OVN_SB_DAEMON is set, ovn-sbctl automatically and transparently uses the daemon to execute its commands. No extra steps, it just knows. πͺ
When the daemon is no longer needed, kill it and unset the environment variable, like:
kill $(cat $OVN_RUNDIR/ovn-sbctl.pid)
unset OVN_SB_DAEMON
When you're using daemon mode, there's an alternative to the OVN_SB_DAEMON environment variable: just specify a path for the Unix socket. When starting the ovn-sbctl daemon, specify the -u option with a full path to where the socket file should live. Here's an exmple:
ovn-sbctl --detach -u /tmp/mysock.ctl
Then to connect to the running daemon, use the -u option with the full path to the socket that got created when the daemon was started:
ovn-sbctl -u /tmp/mysock.ctl show
π Daemon Commands π
Daemon mode is internally implemented using the same mechanism that ovn-appctl uses. So you can also use ovn-appctl directly with these commands:
run [options] command [arg...] [-- [options] command [arg...] ...]β Instructs the daemon process to run one or moreovn-sbctlcommands described above, and reply with the results of running those commands. It accepts--timeout,--dry-run,--oneline, and the options described under Table Formatting Options, in addition to the the command-specific options. β¨exitβ Causesovn-sbctlto gracefully terminate. Bye bestie, slay your exit. π
π OPTIONS π
The options listed below affect the behavior of ovn-sbctl as a whole. Some individual commands also accept their own options, which are given just before the command name. And heads up: if the first command on the command line has options, then those options must be separated from the global options by --. π«Ά
ovn-sbctl also accepts options from the OVN_SBCTL_OPTIONS environment variable, in the same format as on the command line. Options from the command line override those in the environment. No cap. π
--dbdatabase β The OVSDB database remote to contact. If theOVN_SB_DBenvironment variable is set, its value is used as the default. Otherwise, the default isunix:/ovnsb_db.sock, but ngl this default is unlikely to be useful outside of single-machine OVN test environments. π--leader-only--no-leader-onlyβ By default, or with--leader-only, when the database server is a clustered database,ovn-sbctlwill avoid servers other than the cluster leader. This makes sure that any dataovn-sbctlreads and reports is up-to-date. With--no-leader-only,ovn-sbctlwill 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 info. π--shuffle-remotes--no-shuffle-remotesβ By default, or with--shuffle-remotes, when there are multiple remotes specified in the OVSDB connection string specified by--dbor theOVN_SB_DBenvironment variable, the order of the remotes will be shuffled before the client tries to connect. The remotes will be shuffled only once to a new order before the first connection attempt. The following retries, if any, will follow that same new order. The default behavior makes sure that clients of a clustered database can distribute evenly to all members of the cluster. With--no-shuffle-remotes,ovn-sbctlwill use the original order specified in the connection string to connect. This lets you specify the preferred order, which is particularly useful for testing. π§ͺ--no-syslogβ By default,ovn-sbctllogs its arguments and the details of any changes that it makes to the system log. This option disables that logging. It's equivalent to--verbose=sbctl:syslog:warn. π€«--onelineβ Modifies the output format so that the output for each command is printed on a single line. New-line characters that would otherwise separate lines are printed as\n, and any instances of\that would otherwise appear in the output are doubled. Prints a blank line for each command that has no output. Heads up though: this option does not affect the formatting of output from thelistorfindcommands; see Table Formatting Options below. π--dry-runβ Preventsovn-sbctlfrom actually modifying the database. Just looking, not touching. π-tsecs--timeout=secs β By default, or with a secs of0,ovn-sbctlwaits forever for a response from the database. This option limits runtime to approximately secs seconds. If the timeout expires,ovn-sbctlwill exit with aSIGALRMsignal. (A timeout would normally happen only if the database cannot be contacted, or if the system is overloaded.) β°
π§ Daemon Options π§
--pidfile[=pidfile]β Causes a file (by default,program.pid) to be created indicating the PID of the running process. If the pidfile argument is not specified, or if it does not begin with/, then it is created in .
If --pidfile is not specified, no pidfile is created.
--overwrite-pidfileβ By default, when--pidfileis specified and the specified pidfile already exists and is locked by a running process, the daemon refuses to start. Specify--overwrite-pidfileto cause it to instead overwrite the pidfile.
When --pidfile is not specified, this option has no effect.
--detachβ Runs this program as a background process. The process forks, and in the child it starts a new session, closes the standard file descriptors (which has the side effect of disabling logging to the console), and changes its current directory to the root (unless--no-chdiris specified). After the child completes its initialization, the parent exits. π--monitorβ Creates an additional process to monitor this program. If it dies due to a signal that indicates a programming error (SIGABRT,SIGALRM,SIGBUS,SIGFPE,SIGILL,SIGPIPE,SIGSEGV,SIGXCPU, orSIGXFSZ) then the monitor process starts a new copy of it. If the daemon dies or exits for another reason, the monitor process exits. π
This option is normally used with --detach, but it also functions without it.
--no-chdirβ By default, when--detachis specified, the daemon changes its current working directory to the root directory after it detaches. Otherwise, invoking the daemon from a carelessly chosen directory would prevent the administrator from unmounting the file system that holds that directory.
Specifying --no-chdir suppresses this behavior, preventing the daemon from changing its current working directory. This may be useful for collecting core files, since it is common behavior to write core dumps into the current working directory and the root directory is not a good directory to use. π
This option has no effect when --detach is not specified.
--no-self-confinementβ By default this daemon will try to self-confine itself to work with files under well-known directories determined at build time. It is better to stick with this default behavior and not to use this flag unless some other Access Control is used to confine daemon. Note that in contrast to other access control implementations that are typically enforced from kernel-space (e.g. DAC or MAC), self-confinement is imposed from the user-space daemon itself and hence should not be considered as a full confinement strategy, but instead should be viewed as an additional layer of security. π--user=user:groupβ okay so this one lets the program run as a different user that you name inuser:groupform, and in doing so it drops most of the root privileges π . You can also use the short formsuserand:groupβ with the current user or group assumed, respectively. Only daemons started by the root user accept this argument, iykyk.
On Linux, daemons get granted CAP_IPC_LOCK and CAP_NET_BIND_SERVICES before dropping root privileges. And daemons that interact with a datapath, like ovs-vswitchd, get three extra capabilities on top β namely CAP_NET_ADMIN, CAP_NET_BROADCAST and CAP_NET_RAW. Bestie, the capability change applies even if the new user is root. Periodt.
β¨ Logging options β¨
-v[spec],--verbose=[spec]β sets logging levels. Nospecat all? It sets the log level for every module and destination todbgπ. Otherwisespecis 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)β this limits the log level change to the specified module. syslog,console, orfileβ limits the log level change to only 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β controls the log level. Messages of the given severity or higher get logged, and messages of lower severity get 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π₯.-vPATTERN:destination:pattern,--verbose=PATTERN:destination:patternβ sets the log pattern fordestinationtopattern. Refer toovs-appctl(8)for a description of the valid syntax forpattern.-vFACILITY:facility,--verbose=FACILITY:facilityβ sets the RFC5424 facility of the log message π.facilitycan 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 isn't 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 π. Iffileis specified, then it's used as the exact name for the log file. The default log file name used iffileis omitted is/var/log/ovn/program.log.--syslog-target=host:portβ send syslog messages to UDP port onhost, in addition to the system syslog. The host must be a numerical IP address, not a hostname π.--syslog-method=methodβ specifymethodas how syslog messages should be sent to syslog daemon. The following forms are supported:libcβ uses the libcsyslog()function. The downside of this option is that libc adds a fixed prefix to every message before it's actually sent to the syslog daemon over/dev/logUNIX domain socket.unix:fileβ uses a UNIX domain socket directly. It's possible to specify an arbitrary message format with this option. However,rsyslogd 8.9and older versions use a hard coded parser function anyway, and that limits UNIX domain socket use. If you want to use an arbitrary message format with olderrsyslogdversions, then use a UDP socket to localhost IP address instead π«Ά.udp:ip:portβ uses a UDP socket. With this method it's possible to use an arbitrary message format even with olderrsyslogd. When sending syslog messages over a UDP socket, extra precaution needs to be taken into account β for example, the syslog daemon needs to be configured to listen on the specified UDP port, accidental iptables rules could be interfering with local syslog traffic, and there are some security considerations that apply to UDP sockets, but do not apply to UNIX domain sockets π.nullβ discards all messages logged to syslog.
The default is taken from the OVS_SYSLOG_METHOD environment variable; if it's unset, the default is libc.
π Table Formatting Options π
These options control the format of output from the list and find commands. Obsessed with a tidy table, fr fr.
-f format,--format=formatβ sets the type of table formatting. The following types offormatare available:tableβ 2-D text tables with aligned columns.list(default) β a list with one column per line and rows separated by a blank line.htmlβ HTML tables.csvβ comma-separated values as defined in RFC 4180.jsonβ JSON format as defined in RFC 4627. The output is a sequence of JSON objects, each of which corresponds to one table. Each JSON object has the following members with the noted values:captionβ the table's caption. This member is omitted if the table has no caption.headingsβ an array with one element per table column. Each array element is a string giving the corresponding column's heading.dataβ an array with one element per table row. Each element is also an array with one element per table column. The elements of this second-level array are the cells that constitute the table. Cells that represent OVSDB data or data types are expressed in the format described in the OVSDB specification; other cells are simply expressed as text strings.
-d format,--data=formatβ sets the formatting for cells within output tables, unless the table format is set tojson, in which casejsonformatting is always used when formatting cells. The following types offormatare 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.--prettyβ by default, JSON in output is printed as compactly as possible. This option causes JSON in output to be printed in a more readable fashion πΈ. Members of objects and elements of arrays are printed one per line, with indentation.
This option does not affect JSON in tables, which is always printed compactly.
--bareβ equivalent to--format=list --data=bare --no-headings.
π PKI Options π
PKI configuration is required to use SSL/TLS for the connection to the database. No PKI, no secure connection, bestie π .
-p privkey.pem,--private-key=privkey.pemβ specifies a PEM file containing the private key used as identity for outgoing SSL/TLS connections.-c cert.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.-C cacert.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.--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β whencacert.pemexists, 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's 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 β¨.
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. Be careful out there, bestie π.
bestie we're still finishing the thought from the option above β no new bullet, this is just the rest of that same vibe check. π
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. like, the protocol simply does not care. π
And heads up, this option is mutually exclusive with -C and --ca-cert β pick a lane, you literally cannot run both. π
π Other Options π
-h,--helpβ prints a brief help message to the console. cute, quick, iconic. β¨-V,--versionβ prints version information to the console. for when you need to know which slay we're on. π
π COMMANDS π
okay so this is the part you actually came for. the following sections describe the commands that ovn-sbctl supports. buckle up, we're going section by section and every single one is getting its moment. π
β¨ OVN_Southbound Commands β¨
These commands work with an OVN_Southbound database as a whole. the whole entire thing. main character energy. π
initβ Initializes the database, if it is empty. If the database has already been initialized, this command has no effect. (so like, no harm no foul if you run it twice, it just does nothing.) π«Ά[--filter=filter-rule[,filter-rule]...] showβ Prints a brief overview of the database contents. If--filteris specified, output is filtered according to the rules. Each filter-rule has the formtable-name(filter[|filter]...). If table-name is omitted, filtering is applied to theChassistable by default. A row is shown only if its printed representation (including all referenced rows) contains at least one of the specified filter substrings. lowkey a search engine for your database. π
π Chassis Commands π
These commands manipulate OVN_Southbound chassis. the physical (or virtual, no judgement) places where your stuff lives.
[--may-exist] chassis-add chassis encap-type encap-ipβ Creates a new chassis named chassis. encap-type is a comma-separated list of tunnel types. The chassis will have one encap entry for each specified tunnel type with encap-ip as the destination IP for each. π«
Without --may-exist, attempting to create a chassis that exists is an error. With --may-exist, this command does nothing if chassis already exists. so --may-exist is the "bestie, I know, it's fine" flag. π«Ά
[--if-exists] chassis-del chassisβ Deletes chassis and its encaps and gateway_ports. gone. deleted. not me being dramatic about it. π
Without --if-exists, attempting to delete a chassis that does not exist is an error. With --if-exists attempting to delete a chassis that does not exist has no effect. (yes, that's how it's phrased. yes, it's the same energy both times.) π
π§΅ Port Binding Commands π§΅
These commands manipulate OVN_Southbound port bindings. matching up your logical ports with the chassis that's hosting them, like a very serious group chat pairing. π
[--may-exist] lsp-bind logical-port chassisβ Binds the logical port named logical-port to chassis.
Without --may-exist, attempting to bind a logical port that has already been bound is an error. With --may-exist, this command does nothing if logical-port has already been bound to a chassis. π
[--if-exists] lsp-unbind logical-portβ Removes the binding of logical-port.
Without --if-exists, attempting to unbind a logical port that is not bound is an error. With --if-exists, attempting to unbind logical port that is not bound has no effect. βοΈ
π¦ Logical Flow Commands π¦
this is the section where the actual magic happens, ngl.
[--uuid] [--ovs[=remote]] [--stats] [--vflows] lflow-list [logical-datapath] [lflow...]
List logical flows. If logical-datapath is specified, only list flows for that logical datapath. The logical-datapath may be given as a UUID or as a datapath name (reporting an error if multiple datapaths have the same name). no cap, duplicate names will get you caught out. π
If at least one lflow is given, only matching logical flows, if any, are listed. Each lflow may be specified as a UUID or the first few characters of a UUID, optionally prefixed by 0x. (Because ovn-controller sets OpenFlow flow cookies to the first 32 bits of the corresponding logical flow's UUID, this makes it easy to look up the logical flow that generated a particular OpenFlow flow.) the pipeline is pipelining. β¨
If --uuid is specified, the output includes the first 32 bits of each logical flow's UUID. This makes it easier to find the OpenFlow flows that correspond to a given logical flow.
If --ovs is included, ovn-sbctl attempts to obtain and display the OpenFlow flows that correspond to each OVN logical flow. To do so, ovn-sbctl connects to remote (by default, unix:/br-int.mgmt) over OpenFlow and retrieves the flows. If remote is specified, it must be an active OpenFlow connection method described in ovsdb(7). Please see the discussion of the similar --ovs option in ovn-trace(8) for more information about the OpenFlow flow output. π
By default, OpenFlow flow output includes only match and actions. Add --stats to include all OpenFlow information, such as packet and byte counters, duration, and timeouts. numbers girlies, rise. π₯
If --vflows is included, other southbound database records directly used for generating OpenFlow flows are also listed. This includes: port-bindings, mac-bindings, multicast-groups, chassis. The --ovs and --stats can also be used in conjunction with --vflows. π«
[--uuid] dump-flows [logical-datapath]
Alias for lflow-list. same thing, different name, both iconic. π
count-flows [logical-datapath]
prints numbers of logical flows per table and per datapath. (yes it's lowercase, no I will not be capitalizing it, that's just how it is.) π
π‘ Remote Connectivity Commands π‘
These commands manipulate the connections column in the SB_Global table and rows in the Connection table. When ovsdb-server is configured to use the connections column for OVSDB connections, this allows the administrator to use ovn-sbctl to configure database connections. you, configuring connections, from a distance. very remote work era. π»
get-connectionβ Prints the configured connection(s). πdel-connectionβ Deletes the configured connection(s). bye bestie π[--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. Use0to disable inactivity probes. zero means "don't check on me", very relatable. π
π SSL/TLS Configuration Commands π
When ovsdb-server is configured to connect using SSL/TLS, the following parameters are required:
private-keyβ Specifies a PEM file containing the private key used for SSL/TLS connections. πcertificateβ Specifies a PEM file containing a certificate, signed by the certificate authority (CA) used by the connection peers, that certifies the private key, identifying a trustworthy peer. π«ca-certβ Specifies a PEM file containing the CA certificate used to verify that the connection peers are trustworthy. π€
These SSL/TLS settings apply to all SSL/TLS connections made by the southbound database server. all of them. every single one. no exceptions. periodt. π
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. so many nested optional brackets and honestly? she ate. π
ποΈ Database Commands ποΈ
These commands query and modify the contents of ovsdb tables. They are a slight abstraction of the ovsdb interface and as such they operate at a lower level than other ovn-sbctl commands. we're going under the hood, bestie, watch your head. π οΈ
π Identifying Tables, Records, and Columns π
Each of these commands has a table parameter to identify a table within the database. Many of them also take a record parameter that identifies a particular record within a table. The record parameter may be the UUID for a record, which may be abbreviated to its first 4 (or more) hex digits, as long as that is unique. Many tables offer additional ways to identify records. Some commands also take column parameters that identify a particular field within the records in a table.
For a list of tables and their columns, see ovn-sb(5) or see the table listing from the --help option. π
Record names must be specified in full and with correct capitalization, except that UUIDs may be abbreviated to their first 4 (or more) hex digits, as long as that is unique within the table. Names of tables and columns are not case-sensitive, and - and _ are treated interchangeably. Unique abbreviations of table and column names are acceptable, e.g. d or dhcp is sufficient to identify the DHCP_Options table. so yes, you can be lazy, but not sloppy. π
π 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. big numbers only. π’realβ A floating-point number. the vibes are floaty. πBooleanβ True or false, writtentrueorfalse, respectively. binary behaviour, honestly. π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@namedefined 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). π«
π§Ύ Database Command Syntax π§Ύ
[--if-exists] [--columns=column[,column]...] list table [record]...
list is the "show me EVERYTHING bestie" command π It lists the data in each record you name. Name zero records and it just lists all the records in table, because it has no chill and wants you to see it all.
If --columns is specified, only the columns you asked for get listed, in the exact order you specified. Otherwise every column shows up, sorted alphabetically by column name. (Alphabetical order, in this economy? iconic.)
Without --if-exists, it is an error if any specified record does not exist. With --if-exists, the command simply ignores any record that doesn't exist and produces no output for it. ghosting, but make it a feature π«Ά
[--columns=column[,column]...] find table [column[:key]=value]...
find is the search girlie π It 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.
Here are the operators you can drop in where the = sits in the syntax summary π
=!=<><=>=β Selects records in whichcolumn[:key]equals, does not equal, is less than, is greater than, is less than or equal to, or is greater than or equal tovalue, respectively.
So like, think of 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 an 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.) yes it's a whole thing, but it's a fair whole thing βοΈ
{=}{!=}β Test for set equality or inequality, respectively.{<=}β Selects records in whichcolumn[:key]is a subset ofvalue. For example,flood-vlans{<=}1,2selects records in which theflood-vlanscolumn is the empty set or contains1or2or both.{<}β Selects records in whichcolumn[:key]is a proper subset ofvalue. 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 incolumn[:key]is also invalue. (This is the same as{<=}.){not-in}β Selects records in which every element incolumn[:key]is not invalue.
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. So 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. no key, no entry, no exceptions, periodt π
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. So 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. different rules, different vibes β¨
Don't forget to escape<or>from interpretation by the shell. the shell will absolutely eat them otherwise and you'll be so confused π
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. yeah. known thing, we said what we said π«
[--if-exists] [--id=@name] get table record [column[:key]]...
get prints the value of each specified column in the given record in table. For map columns, a key may optionally be specified, in which case the value associated with key in the column is printed, instead of the entire map. one value, hold the whole map, thank you π
Without --if-exists, it is an error if record does not exist or, if key is specified, if key does not exist in record. With --if-exists, a missing record yields no output and a missing key prints a blank line. (a blank line. it's giving nothing, literally πΈ)
If @name is specified, then the UUID for record may be referred to by that name later in the same ovn-sbctl invocation in contexts where a UUID is expected. little nickname, huge payoff π
Both --id and the column arguments are optional, but usually at least one or the other should be specified. If both are omitted, then get has no effect except to verify that record exists in table. it's just there to check the vibe, basically π
--id and --if-exists cannot be used together.
[--if-exists] set table record column[:key]=value...
set sets the value of each specified column in the given record in table to value. For map columns, a key may optionally be specified, in which case the value associated with key in that column is changed (or added, if none exists), instead of the entire map. glow up, but for data π
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist. silently moving on. we respect it.
[--if-exists] add table record column [key=]value...
add adds the specified value or key-value pair to column in record in table. If column is a map, then key is required β otherwise it is prohibited. If key already exists in a map column, then the current value is not replaced (use the set command to replace an existing value). add is not a replacement girlie, she's an addition girlie π§
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.
[--if-exists] remove table record column value...
[--if-exists] remove table record column key...
[--if-exists] remove table record column key=value...
remove removes the specified values or key-value pairs from column in record in table.
- The first form applies to columns that are not maps: each specified
valueis removed from the column. - The second and third forms apply to map columns: if only a
keyis specified, then any key-value pair with the givenkeyis removed, regardless of its value; if avalueis given then a pair is removed only if bothkeyandvaluematch.
It is not an error if the column does not contain the specified key or value or pair. nothing to remove? nothing to stress about π¦
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.
[--if-exists] clear table record column...
clear sets each column in record in table to the empty set or empty map, as appropriate. This command applies only to columns that are allowed to be empty. permission to be empty: granted π
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.
[--id=(@name|uuid)] create table column[:key]=value...
create creates a new record in table and sets the initial values of each column. Columns not explicitly set will receive their default values. Outputs the UUID of the new row. β¨ new row, who dis β¨
If @name is specified, then the UUID for the new row may be referred to by that name elsewhere in the same ovn-sbctl invocation in contexts where a UUID is expected. Such references may precede or follow the create command. time is a flat circle, bestie β³
If a valid uuid is specified, then it is used as the UUID of the new row.
β οΈ Caution (ovs-vsctl as example) β οΈ
Records in the Open vSwitch database are significant only when they can be reached directly or indirectly from the Open_vSwitch table. Except for records in the QoS or Queue tables, records that are not reachable from the Open_vSwitch table are automatically deleted from the database. This deletion happens immediately, without waiting for additional ovs-vsctl commands or other database activity. Thus, a create command must generally be accompanied by additional commands within the same ovs-vsctl invocation to add a chain of references to the newly created record from the top-level Open_vSwitch record. The EXAMPLES section gives some examples that show how to do this.
fr fr do not create a record and walk away thinking you're done, because you are not done π
[--if-exists] destroy table record...
destroy deletes each specified record from table. Unless --if-exists is specified, each record must exist. no record, big error. it's giving strict π
--all destroy table
--all destroy deletes all records from the table. every single one. the whole roster. clean slate, main character reset button π₯π
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 theEXAMPLESsection below for more information.
wait-until β¨
wait-until table record [column[:key]=value]...
Bestie, this one is a waiting room π
it just sits there until table contains a record named record whose column equals value β or, if key is given, whose column contains a key with the specified value. Same operators, same semantics as the find command above, no cap. π«Ά
If you don't pass any column[:key]=value arguments, this command waits only until record exists. If you give it more than one such argument, it waits until all of them are satisfied. All of them. Every single one. It's giving perfectionist. π
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, it literally always does. π
Consider specifying --timeout=0 along with --wait-until, to prevent ovs-vsctl from terminating after waiting only at most 5 seconds. Yeah, it has a lil attention span by default. π
comment πΈ
comment [arg]...
This command has no effect on behavior, but any database log record created by the command will include the command and its arguments. It's literally just leaving a sticky note for the group chat. πβ¨
π ENVIRONMENT π
OVN_SB_DAEMONβ If set, this should name the Unix domain socket for anovn-sbctlserver process. See Daemon Mode, above, for more information. πOVN_SBCTL_OPTIONSβ If set, a set of options forovn-sbctlto apply automatically, in the same form as on the command line. It's the β¨auto-pilotβ¨ setting.OVN_SB_DBβ If set, the default database to contact when the--dboption is not used. Your lil default bestie. π
π EXIT STATUS π
0β Successful program execution. slay, we ate π1β Usage, syntax, or network error. it's giving chaos π
π¦ SEE ALSO π¦
Go read those too, iykyk. πβ¨
And that's a wrap on the whole page, bestie!! π«Άπ You read every single option, every caution, every vibe. Iconic behavior, truly main character energy. This was OVN 26.09.1, manual page ovn-sbctl β ovn-sbctl(8) β and yes the version and date footer is right there at the bottom where it always lives. Periodt. ππΈπ
π¦ 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