vtep-ctl(8)
π vtep-ctl(8) π
from the Open vSwitch Manual, bestie π«Ά β this is the VTEP database utility page, and we're doing a full vibe check on every option. No skipping, fr fr.
β¨ NAME β¨
vtep-ctl β utility for querying and configuring a VTEP database π
πΈ SYNOPSIS πΈ
vtep-ctl [options] -- [options] command [args] [-- [options] command
[args]]...
π¦ DESCRIPTION π¦
vtep-ctl configures a VTEP database. Peep vtep(5) for the comprehensive documentation of the database schema, bestie π.
It connects to an ovsdb-server process that maintains a VTEP configuration database. Over that connection, it queries the database and possibly applies changes to it, depending on the commands you supplied. iykyk β¨.
vtep-ctl can perform any number of commands in a single run, implemented as a single atomic transaction against the database. it's giving atomic slay π
.
The command line begins with global options (see OPTIONS below for details). Those global options are followed by one or more commands. Each command should begin with -- by itself as a command-line argument, to separate it from the following commands. (The -- before the first command is optional.) The command itself starts with command-specific options, if any, followed by the command name and any arguments. See EXAMPLES below for syntax examples π«Ά.
π OPTIONS π
These options affect how vtep-ctl behaves as a whole. Some individual commands also accept their own options, which are given just before the command name. If the first command on the command line has options, then those options must be separated from the global options by --. Noted π.
--db=serverβ sets server as the database server thatvtep-ctlcontacts to query or modify configuration. server may be an OVSDB active or passive connection method, as described inovsdb(7). The default isunix:/run/openvswitch/db.sock. default unlocked π.--no-syslogβ by default,vtep-ctllogs its arguments and the details of any changes that it makes to the system log. This option disables that logging. It is equivalent to--verbose=vtep_ctl:syslog:warn. quiet mode activated π€«.--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. It prints a blank line for each command that has no output. This option does not affect the formatting of output from thelistorfindcommands; see Table Formatting Options below. one line, one vibe β¨.--dry-runβ preventsvtep-ctlfrom actually modifying the database. look, don't touch π.-t secs,--timeout=secsβ by default, or with a secs value of0,vtep-ctlwaits forever for a response from the database. This option limits runtime to approximately secs seconds. If the timeout expires,vtep-ctlwill exit with aSIGALRMsignal. (A timeout would normally happen only if the database cannot be contacted, or if the system is overloaded.) timeout drama, but make it configurable β°.
π Table Formatting Options π
These options control the format of output from the list and find commands. table time π.
-f format,--format=formatβ sets the type of table formatting. The following types of format are available:tableβ 2-D text tables with aligned columns.list(default) β a list with one column per line and rows separated by a blank line.htmlβ HTML tables.csvβ comma-separated values as defined in RFC 4180.jsonβ JSON format as defined in RFC 4627. The output is a sequence of JSON objects, each of which corresponds to one table. Each JSON object has the following members with the noted values:captionβ the table's caption. This member is omitted if the table has no caption.headingsβ an array with one element per table column. Each array element is a string giving the corresponding column's heading.dataβ an array with one element per table row. Each element is also an array with one element per table column. The elements of this second-level array are the cells that constitute the table. Cells that represent OVSDB data or data types are expressed in the format described in the OVSDB specification; other cells are simply expressed as text strings.
-d format,--data=formatβ sets the formatting for cells within output tables unless the table format is set 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β suppresses the heading row that otherwise appears in the first row of table output. no header, no problem π.--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. pretty privilege, but for JSON β¨.--bareβ equivalent to--format=list --data=bare --no-headings. the shortcut icon π.--max-column-width=nβ for table output only, limits the width of any column in the output to n columns. Longer cell data is truncated to fit, as necessary. Columns are always wide enough to display the column names, if the heading row is printed. width check passed π.
π Public Key Infrastructure Options π
SSL/TLS besties, this is your section π .
-p privkey.pem,--private-key=privkey.pemβ specifies a PEM file containing the private key used asvtep-ctl's identity for outgoing SSL/TLS connections. identity, but cryptographic π .-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. trust chain realness π.-C cacert.pem,--ca-cert=cacert.pemβ specifies a PEM file containing the CA certificate thatvtep-ctlshould use to verify certificates presented to it 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.) CA vibes π§.-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. bestie, this is a security risk, do not ignore that π.--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. SNI glow-up π.--bootstrap-ca-cert=cacert.pemβ whencacert.pemexists, this option has the same effect as-Cor--ca-cert. If it does not exist, thenvtep-ctlwill 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. 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-Cand--ca-cert. bootstrap era, with a warning β οΈ.--peer-ca-cert=peer-cacert.pemβ specifies a PEM file that contains one or more additional certificates to send to SSL/TLS peers.peer-cacert.pemshould be the CA certificate used to signvtep-ctl's own certificate, that is, the certificate specified on-cor--certificate. Ifvtep-ctl's certificate is self-signed, then--certificateand--peer-ca-certshould specify the same file. This option is not useful in normal operation, because the SSL/TLS peer must already have the CA certificate for the peer to have any confidence invtep-ctl's identity. However, this offers a way for a new installation to bootstrap the CA certificate on its first SSL/TLS connection. peer pressure, but certificates π«Ά.-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 the system log, to the console, or to a file, respectively. (If--detachis specified,vtep-ctlcloses 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. logging lore unlocked π.
So basically the tea β is: no matter what log levels you set for file, logging to a file is not gonna happen unless --log-file is also specified (peep it down below π). Like, the vibe check fails otherwise.
And for compatibility with older OVS versions, any is accepted as a word β but it has no effect. It's giving legacy decoration, bestie π.
-v,--verboseβ sets the max logging verbosity level, and it's literally the same thing as--verbose=dbg. Short king, same energy β¨-vPATTERN:destination:pattern,--verbose=PATTERN:destination:patternβ sets the log pattern for destination to pattern. For the valid syntax of pattern, go peekovs-appctl(8)β it's the blueprint, iykyk π-vFACILITY:facility,--verbose=FACILITY:facilityβ sets the RFC5424 facility of the log message. facility can be one of:kern,user,mail,daemon,auth,syslog,lpr,news,uucp,clock,ftp,ntp,audit,alert,clock2,local0,local1,local2,local3,local4,local5,local6, orlocal7. If you don't specify it,daemonis the default for the local system syslog, andlocal0is used while sending a message to the target you gave via--syslog-target. Slay, defaults π¦--log-file[=file]β turns on logging to a file ποΈ. If file is given, that's used as the exact name of the log file. If file is omitted, the default log file name is/var/log/openvswitch/vtep-ctl.log. Very demure, very documented.--syslog-target=host:portβ sends syslog messages to UDP port on host, in addition to the system syslog. Heads up though: host must be a numerical IP address, not a hostname π no names allowed, only numbers.--syslog-method=methodβ tells it how syslog messages should be sent to the syslog daemon. These are the supported forms:libcβ use the libcsyslog()function. The downside (and it is a downside, ngl π) is that libc adds a fixed prefix to every message before it's actually sent to the syslog daemon over the/dev/logUNIX domain socket.unix:fileβ use a UNIX domain socket directly. With this one you can specify arbitrary message format β¨. However,rsyslogd8.9 and older versions use a hard coded parser function anyway, which limits UNIX domain socket use. So if you want arbitrary message format with olderrsyslogdversions, use a UDP socket to the localhost IP address instead. Workaround queen πudp:ip:portβ use a UDP socket. With this method you can use arbitrary message format even with olderrsyslogd. But 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. β οΈ read that again, bestie.nullβ discards all messages logged to syslog. Gone. Poof. π
The default is taken from the OVS_SYSLOG_METHOD environment variable; if it's unset, the default is libc.
-h,--helpβ prints a brief help message to the console. Your little onboarding tour π«Ά-V,--versionβ prints version information to the console. Receipts! π§Ύ
π COMMANDS π
The commands that vtep-ctl implements are described in the sections below. Buckle up, there's a lot π
πΈ Physical Switch Commands πΈ
These commands examine and manipulate physical switches.
[--may-exist] add-pspswitch β creates a new physical switch named pswitch. Initially the switch will have no ports. Empty. Fresh. Main character energy β¨ Without--may-exist, attempting to create a switch that exists is an error. With--may-exist, this command does nothing if pswitch already exists. Chillest behaviour ever.[--if-exists] del-pspswitch β deletes pswitch and all of its ports π«£ yeah, all of them. Without--if-exists, attempting to delete a switch that does not exist is an error. With--if-exists, attempting to delete a switch that does not exist has no effect. No drama, no error.list-psβ lists all existing physical switches on standard output, one per line. So organised π¦ps-existspswitch β tests whether pswitch exists. If so,vtep-ctlexits successfully with exit code0. If not,vtep-ctlexits unsuccessfully with exit code2. Two very different vibes.
π§ Port Commands π§
These commands examine and manipulate VTEP physical ports.
list-portspswitch β lists all of the ports within pswitch on standard output, one per line.[--may-exist] add-portpswitch port β creates on pswitch a new port named port from the network device of the same name. Without--may-exist, attempting to create a port that exists is an error. With--may-exist, this command does nothing if port already exists on pswitch.[--if-exists] del-port[pswitch] port β deletes port. If pswitch is omitted, port is removed from whatever switch contains it; if pswitch is specified, it must be the switch that contains port. No switching up the story π€ Without--if-exists, attempting to delete a port that does not exist is an error. With--if-exists, attempting to delete a port that does not exist has no effect.[--may-exist] add-lslswitch β wait no, that's the next section, hold on, don't scroll ahead π
π Logical Switch Commands π
These commands examine and manipulate logical switches.
[--may-exist] add-lslswitch β creates a new logical switch named lswitch. Initially the switch will have no locator bindings πβ Without--may-exist, attempting to create a switch that exists is an error. With--may-exist, this command does nothing if lswitch already exists.[--if-exists] del-lslswitch β deletes lswitch. Without--if-exists, attempting to delete a switch that does not exist is an error. With--if-exists, attempting to delete a switch that does not exist has no effect.list-lsβ lists all existing logical switches on standard output, one per line.ls-existslswitch β tests whether lswitch exists. If so,vtep-ctlexits successfully with exit code0. If not,vtep-ctlexits unsuccessfully with exit code2.bind-lspswitch port vlan lswitch β binds logical switch lswitch to the port/vlan combination on the physical switch pswitch. Matchmaker matchmaker πunbind-lspswitch port vlan β removes the logical switch binding from the port/vlan combination on the physical switch pswitch. Breaking up, but make it network config.list-bindingspswitch port β lists the logical switch bindings for port on the physical switch pswitch.set-replication-modelswitch replication-mode β sets logical switch lswitch replication mode to replication-mode; the only valid values for replication mode are"service_node"and"source_node". Okay so here's the whole lore π΅: for handling L2 broadcast, multicast and unknown unicast traffic, packets can be sent to all members of a logical switch referenced by a physical switch. There are different modes to replicate the packets. The default mode of replication is to send the traffic to a service node, which can be a hypervisor, server or appliance, and let the service node handle replication to other transport nodes (hypervisors or other VTEP physical switches). This mode is called service node replication. An alternate mode of replication, called source node replication, involves the source node sending to all other transport nodes. Hypervisors are always responsible for doing their own replication for locally attached VMs in both modes. Service node mode is the default if the replication mode is not explicitly set. Service node replication mode is considered a basic requirement because it only requires sending the packet to a single transport node. Understood the assignment πget-replication-modelswitch β gets logical switch lswitch replication mode. The only valid values for replication mode are"service_node"and"source_node". An empty reply for replication mode implies a default of"service_node". Silence = service node, periodt.
π¦ Logical Router Commands π¦
These commands examine and manipulate logical routers.
[--may-exist] add-lrlrouter β creates a new logical router named lrouter. Without--may-exist, attempting to create a router that exists is an error. With--may-exist, this command does nothing if lrouter already exists.[--if-exists] del-lrlrouter β deletes lrouter. Without--if-exists, attempting to delete a router that does not exist is an error. With--if-exists, attempting to delete a router that does not exist has no effect.list-lrβ lists all existing logical routers on standard output, one per line.lr-existslrouter β tests whether lrouter exists. If so,vtep-ctlexits successfully with exit code0. If not,vtep-ctlexits unsuccessfully with exit code2.
π Local MAC Binding Commands π
These commands examine and manipulate local MAC bindings for the logical switch. The local maps are written by the VTEP to refer to MACs it has learned on its physical ports. Very "I remember everyone's face" of it π§ β¨
add-ucast-locallswitch mac [encap] ip β maps the unicast Ethernet address mac to the physical location ip using encapsulation encap on lswitch. If encap is not specified, the default is"vxlan_over_ipv4". The local mappings are used by the VTEP to refer to MACs learned on its physical ports.del-ucast-locallswitch mac β removes the local unicast Ethernet address mac map from lswitch. The local mappings are used by the VTEP to refer to MACs learned on its physical ports.add-mcast-locallswitch mac [encap] ip β adds physical location ip using encapsulation encap to the local mac binding table for multicast Ethernet address mac on lswitch. If encap is not specified, the default is"vxlan_over_ipv4". The local mappings are used by the VTEP to refer to MACs learned on its physical ports.del-mcast-locallswitch mac [encap] ip β removes physical location ip using encapsulation encap from the local mac binding table for multicast Ethernet address mac on lswitch. If encap is not specified, the default is"vxlan_over_ipv4". The local mappings are used by the VTEP to refer to MACs learned on its physical ports.clear-local-macslswitch β clears the local MAC bindings for lswitch. Fresh slate π«list-local-macslswitch β lists the local MAC bindings for lswitch, one per line.
π¦ Remote MAC Binding Commands π¦
Okay bestie, these commands are all about the logical switchβs local and remote MAC bindings. The remote maps get written by the network virtualization controller to point at MACs it has learned. π
add-ucast-remote lswitch mac [encap] ipβ Maps the unicast Ethernet addressmacto the physical locationipusing encapsulationencaponlswitch. Ifencapis not specified, the default is"vxlan_over_ipv4". The remote mappings are used by the network virtualization platform to refer to MACs that it has learned.del-ucast-remote lswitch macβ Removes the remote unicast Ethernet addressmacmap fromlswitch. The remote mappings are used by the network virtualization platform to refer to MACs that it has learned.add-mcast-remote lswitch mac [encap] ipβ Adds physical locationipusing encapsulationencapto the remote mac binding table for multicast Ethernet addressmaconlswitch. Ifencapis not specified, the default is"vxlan_over_ipv4". The remote mappings are used by the network virtualization platform to refer to MACs that it has learned.del-mcast-remote lswitch mac [encap] ipβ Removes physical locationipusing encapsulationencapfrom the remote mac binding table for multicast Ethernet addressmaconlswitch. Ifencapis not specified, the default is"vxlan_over_ipv4". The remote mappings are used by the network virtualization platform to refer to MACs that it has learned.clear-remote-macs lswitchβ Clears the remote MAC bindings forlswitch.list-remote-macs lswitchβ Lists the remote MAC bindings forlswitch, one per line.
π«Ά Manager Connectivity π«Ά
These commands manipulate the managers column in the Global table and rows in the Managers table. When ovsdb-server is configured to use the managers column for OVSDB connections (as described in the startup scripts provided with Open vSwitch), this allows the administrator to use vtep-ctl to configure database connections. β¨
get-managerβ Prints the configured manager(s).del-managerβ Deletes the configured manager(s).set-manager target...β Sets the configured manager target or targets. Each target may be an OVSDB active or passive connection method, e.g.pssl:6640, as described inovsdb(7).
π 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 vtep-ctl commands. No cap. π«‘
π 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, and 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.
The following tables are currently defined:
Globalβ top-level configuration for a hardware VTEP. This table contains exactly one record, identified by specifying.as the record name.Managerβ configuration for an OVSDB connection. Records may be identified by target (e.g.tcp:1.2.3.4).Physical_Switchβ a physical switch that implements a VTEP. Records may be identified by physical switch name.Physical_Portβ a port within a physical switch.Logical_Binding_Statsβ reports statistics for the logical switch with which a VLAN on a physical port is associated.Logical_Switchβ a logical Ethernet switch. Records may be identified by logical switch name.Ucast_Macs_Localβ mapping of locally discovered unicast MAC addresses to tunnels.Ucast_Macs_Remoteβ mapping of remotely programmed unicast MAC addresses to tunnels.Mcast_Macs_Localβ mapping of locally discovered multicast MAC addresses to tunnels.Mcast_Macs_Remoteβ mapping of remotely programmed multicast MAC addresses to tunnels.Physical_Locator_Setβ a set of one or more physical locators.Physical_Locatorβ identifies an endpoint to which logical switch traffic may be encapsulated and forwarded. Records may be identified by physical locator name.
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. man or m is sufficient to identify the Manager table.
π Database Values π
Each column in the database accepts a fixed type of data. The currently defined basic types, and their representations, are:
integerβ a decimal integer in the range-2**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@namedefined by agetorcreatecommand within the samevtep-ctlinvocation.
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. For a column accepting a set of integers, database commands accept a range. A range is represented by two integers separated by -. A range is inclusive. A range has a maximum size of 4096 elements. If more elements are needed, they can be specified in separate ranges.
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 bestie, use quotes to prevent the shell from expandingother-config={0=x,1=y}intoother-config=0=x other-config=1=y, which may not have the desired effect.
π Database Command Syntax π
[--if-exists] [--columns=column[,column]...] list table [record]...β Lists the data in each specified record. If no records are specified, lists all the records intable.
If --columns is specified, only the requested columns are listed, in the specified order. Otherwise, all columns are listed, in alphabetical order by column name.
Without --if-exists, it is an error if any specified record does not exist. With --if-exists, the command ignores any record that does not exist, without producing any output.
[--columns=column[,column]...] find table [column[:key]=value]...β Lists the data in each record intablewhosecolumnequalsvalueor, ifkeyis specified, whosecolumncontains akeywith the specifiedvalue.
The following operators may be used where = is written 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.
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 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.)
{=},{!=}β 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. 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.
okay so about the set operators, bestie: 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 an mtu key whose value is not 1500 and those that lack an mtu key. π
And don't forget to escape < or > from interpretation by the shell β the shell will absolutely try to eat them. π
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.
β οΈ Not me warning you: the UUIDs shown for rows created in the same vtep-ctl invocation will be wrong. π
[--if-exists] [--id=@name] get table record [column[:key]]...β Prints the value of each specified column in the givenrecordintable. For map columns, akeymay optionally be specified, in which case the value associated withkeyin the column is printed, instead of the entire map.
Without --if-exists, it is an error if record does not exist or key is specified, if key does not exist in record. With --if-exists, a missing record yields no output and a missing key prints a blank line.
If @name is specified, then the UUID for record may be referred to by that name later in the same vtep-ctl invocation in contexts where a UUID is expected.
Both --id and the column arguments are optional, but usually at least one or the other should be specified. If both are omitted, then get has no effect except to verify that record exists in table.
π--idand--if-existscannot be used together.
[--if-exists] set table record column[:key]=value...β Sets the value of each specified column in the givenrecordintabletovalue. For map columns, akeymay optionally be specified, in which case the value associated withkeyin that column is changed (or added, if none exists), instead of the entire map.
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.
[--if-exists] add table record column [key=]value...β Adds the specified value or key-value pair tocolumninrecordintable. Ifcolumnis a map, thenkeyis required, otherwise it is prohibited. Ifkeyalready exists in a map column, then the current value is not replaced (use thesetcommand to replace an existing value). π«Ά
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.
[--if-exists] remove table record column value...[--if-exists] remove table record column key...[--if-exists] remove table record column key=value...β Removes the specified values or key-value pairs fromcolumninrecordintable. The first form applies to columns that are not maps: each specified value is removed from the column. The second and third forms apply to map columns: if only akeyis 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.
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.
[--if-exists] clear table record column...β Sets each column inrecordintableto the empty set or empty map, as appropriate. This command applies only to columns that are allowed to be empty.
Without --if-exists, it is an error if record does not exist. With --if-exists, this command does nothing if record does not exist.
[--id=(@name | uuid] create table column[:key]=value...β Creates a new record intableand sets the initial values of each column. Columns not explicitly set will receive their default values. Outputs the UUID of the new row. β¨
If @name is specified, then the UUID for the new row may be referred to by that name elsewhere in the same vtep-ctl invocation in contexts where a UUID is expected. Such references may precede or follow the create command.
If a valid uuid is specified, then it is used as the UUID of the new row.
Caution (ovs-vsctl as example) Records in the Open vSwitch database are significant only when they can be reached directly or indirectly from 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. Thus, 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. TheEXAMPLESsection gives some examples that show how to do this.
[--if-exists] destroy table record...β Deletes each specifiedrecordfromtable. Unless--if-existsis specified, each record must exist.--all destroy tableβ Deletes all records from thetable.
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 table record [column[:key]=value]...β Waits untiltablecontains a record namedrecordwhosecolumnequalsvalueor, ifkeyis specified, whosecolumncontains akeywith the specifiedvalue. This command supports the same operators and semantics described for thefindcommand above. πΈ
If no column[:key]=value arguments are given, this command waits only until record exists. If more than one such argument is given, the command waits until all of them are satisfied.
Caution (ovs-vsctl as example) 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.
Consider specifying --timeout=0 along with --wait-until, to prevent vtep-ctl from terminating after waiting only at most 5 seconds.
comment [arg]...β This command has no effect on behavior, but any database log record created by the command will include the command and its arguments.
π¦ EXIT STATUS π¦
0β Successful program execution. slay. β¨1β Usage, syntax, or configuration file error. π2β Theswitchargument tops-existsspecified the name of a physical switch that does not exist. π
π SEE ALSO π
ovsdb-server(1), vtep(5). π«Ά
okay that's the whole page, bestie! π Source/version/date vibes: Open vSwitch, March 2013, page vtep-ctl(8). π
π¦ where this page comes from
- arch rolling: openvswitch 4.0.0-1 Β· Apache-2.0
- Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms