The following sections describe the commands that ovn-nbctl supports.
GeneralCommandsinit Initializes the database, if it is empty. If the database has already been initialized, this
command has no effect.
show[switch|router]
Prints a brief overview of the database contents. If switch is provided, only records related to
that logical switch are shown. If router is provided, only records related to that logical router
are shown.
LogicalSwitchCommandsls-add Creates a new, unnamed logical switch, which initially has no ports. The switch does not have a
name, other commands must refer to this switch by its UUID.
[--may-exist | --add-duplicate] ls-addswitch
Creates a new logical switch named switch, which initially has no ports.
The OVN northbound database schema does not require logical switch names to be unique, but the
whole point to the names is to provide an easy way for humans to refer to the switches, making
duplicate names unhelpful. Thus, without any options, this command regards it as an error if
switch is a duplicate name. With --may-exist, adding a duplicate name succeeds but does not create
a new logical switch. With --add-duplicate, the command really creates a new logical switch with a
duplicate name. It is an error to specify both options. If there are multiple logical switches
with a duplicate name, configure the logical switches using the UUID instead of the switch name.
[--if-exists] ls-delswitch
Deletes switch. It is an error if switch does not exist, unless --if-exists is specified.
ls-list
Lists all existing switches on standard output, one per line.
ACLCommands
These commands operates on ACL objects for a given entity. The entity can be either a logical switch or a
port group. The entity can be specified as uuid or name. The --type option can be used to specify the
type of the entity, in case both a logical switch and a port groups exist with the same name specified
for entity. type must be either switch or port-group.
[--type={switch | port-group}] [--log] [--meter=meter] [--severity=severity] [--name=name]
[--label=label] [--sample-new=sample] [--sample-est=sample] [--may-exist] [--apply-after-lb]
[--tier] acl-addentitydirectionprioritymatchverdict
Adds the specified ACL to entity. direction must be either from-lport or to-lport. priority
must be between 0 and 32767, inclusive. A full description of the fields are in ovn-nb(5).
If --may-exist is specified, adding a duplicated ACL succeeds but the ACL is not really
created. Without --may-exist, adding a duplicated ACL results in error.
The --log option enables packet logging for the ACL. The options --severity and --name
specify a severity and name, respectively, for log entries (and also enable logging). The
severity must be one of alert, warning, notice, info, or debug. If a severity is not
specified, the default is info. The --meter=meter option is used to rate-limit packet
logging. The meter argument names a meter configured by meter-add.
The --sample-new (and optionally --sample-est) enable ACL sampling. A valid uuid of a row
of the Sample table must be provided.
The --apply-after-lb option sets apply-after-lb=true in the options column of the ACL
table. As the option name suggests, the ACL will be applied after the logical switch load
balancer stage.
The --tier option sets the ACL’s tier to the specified value. For more information about
ACL tiers, see the documentation for the ovn-nb(5) database.
[--type={switch | port-group}] [--tier] acl-delentity [direction [prioritymatch]]
Deletes ACLs from entity. If only entity is supplied, all the ACLs from the entity are
deleted. If direction is also specified, then all the flows in that direction will be
deleted from the entity. If all the fields are given, then a single flow that matches all
the fields will be deleted.
If the --tier option is provided, then only ACLs of the given tier value will be deleted,
in addition to whatever other criteria have been provided.
[--type={switch | port-group}] acl-listentity
Lists the ACLs on entity.
LogicalSwitchQoSRuleCommands
[--may-exist] qos-addswitchdirectionprioritymatch [mark=mark] [dscp=dscp] [rate=rate [burst=burst]]
Adds QoS marking and metering rules to switch. direction must be either from-lport or to-lport.
priority must be between 0 and 32767, inclusive.
If dscp=dscp is specified, then matching packets will have DSCP marking applied. dscp must be
between 0 and 63, inclusive. If rate=rate is specified then matching packets will have metering
applied at rate kbps. If metering is configured, then burst=burst specifies the burst rate limit
in kilobits. dscp and/or rate are required arguments. If mark=mark is specified, then matching
packets will be marked (through pkt.mark). mark must be a positive integer.
If --may-exist is specified, adding a duplicated QoS rule succeeds but the QoS rule is not really
created. Without --may-exist, adding a duplicated QoS rule results in error.
qos-delswitch [direction [prioritymatch]]
Deletes QoS rules from switch. If only switch is supplied, all the QoS rules from the logical
switch are deleted. If direction is also specified, then all the flows in that direction will be
deleted from the logical switch. If all the fields are supplied, then a single flow that matches
the given fields will be deleted.
If switch and uuid are supplied, then the QoS rule with specified uuid is deleted.
qos-listswitch
Lists the QoS rules on switch.
MeterCommandsmeter-addnameactionrateunit [burst]
Adds the specified meter. name must be a unique name to identify this meter. The action argument
specifies what should happen when this meter is exceeded. The only supported action is drop.
The unit specifies the unit for the rate argument; valid values are kbps and pktps for kilobits
per second and packets per second, respectively. The burst option configures the maximum burst
allowed for the band in kilobits or packets depending on whether the unit chosen was kbps or
pktps, respectively. If a burst is not supplied, the switch is free to select some reasonable
value depending on its configuration.
ovn-nbctl only supports adding a meter with a single band, but the other commands support meters
with multiple bands.
Names that start with "__" (two underscores) are reserved for internal use by OVN, so ovn-nbctl
does not allow adding them.
meter-del [name]
Deletes meters. By default, all meters are deleted. If name is supplied, only the meter with that
name will be deleted.
meter-list
Lists all meters.
LogicalSwitchPortCommands
[--may-exist] lsp-addswitchport
Creates on lswitch a new logical switch port named port.
It is an error if a logical port named port already exists, unless --may-exist is specified.
Regardless of --may-exist, it is an error if the existing port is in some logical switch other
than switch or if it has a parent port.
[--may-exist] lsp-addswitchportparenttag_request
Creates on switch a logical switch port named port that is a child of parent that is identified
with VLAN ID tag_request, which must be between 0 and 4095, inclusive. If tag_request is 0,
ovn-northd generates a tag that is unique in the scope of parent. This is useful in cases such as
virtualized container environments where Open vSwitch does not have a direct connection to the
container’s port and it must be shared with the virtual machine’s port.
It is an error if a logical port named port already exists, unless --may-exist is specified.
Regardless of --may-exist, it is an error if the existing port is not in switch or if it does not
have the specified parent and tag_request.
[--if-exists] lsp-delport
Deletes port. It is an error if port does not exist, unless --if-exists is specified.
lsp-listswitch
Lists all the logical switch ports within switch on standard output, one per line.
lsp-get-parentport
If set, get the parent port of port. If not set, print nothing.
lsp-get-tagport
If set, get the tag for port traffic. If not set, print nothing.
lsp-set-addressesport [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.
unknown
OVN delivers unicast Ethernet packets whose destination MAC address is not in any logical
port’s addresses column to ports with address unknown.
dynamic
Use this keyword to make ovn-northd generate a globally unique MAC address and choose an
unused IPv4 address with the logical port’s subnet and store them in the port’s
dynamic_addresses column.
router Accepted only when the type of the logical switch port is router. This indicates that the
Ethernet, IPv4, and IPv6 addresses for this logical switch port should be obtained from the
connected logical router port, as specified by router-port in lsp-set-options.
Multiple addresses may be set. If no address argument is given, port will have no addresses
associated with it.
lsp-get-addressesport
Lists all the addresses associated with port on standard output, one per line.
lsp-set-port-securityport [addrs]...
Sets the port security addresses associated with port to addrs. Multiple sets of addresses may be
set by using multiple addrs arguments. If no addrs argument is given, port will not have port
security enabled.
Port security limits the addresses from which a logical port may send packets and to which it may
receive packets. See the ovn-nb(5) documentation for the port_security column in the
Logical_Switch_Port table for details.
lsp-get-port-securityport
Lists all the port security addresses associated with port on standard output, one per line.
lsp-get-upport
Prints the state of port, either up or down.
lsp-set-enabledportstate
Set the administrative state of port, either enabled or disabled. When a port is disabled, no
traffic is allowed into or out of the port.
lsp-get-enabledport
Prints the administrative state of port, either enabled or disabled.
lsp-set-typeporttype [peer=peer]
Set the type for the logical port. The type must be one of the following:
(emptystring)
A VM (or VIF) interface.
router A connection to a logical router.
switch A connection to another logical switch. The optional argument peer identifies a logical
switch port that connects to this one.
All logical switch ports of that type have implicit ’unknown’ addresses and FDB learning
enabled (unless port security is set). This comes with all the positive and negative sides
of the ’unknown’ address. Static addresses-to-port mappings don’t need to be maintained on
each node and only the actually used mappings are learned, but at a cost of broadcasting
packets for which the destination address is not learned yet.
FDB learning will also cause not learned yet packets to be sent to controller from each
switch-switch connection they traverse. This should be taken into consideration while
planning to have many directly connected switches within a single availability zone.
localnet
A connection to a locally accessible network from each ovn-controller instance. A logical
switch can only have a single localnet port attached. This is used to model direct
connectivity to an existing network.
localport
A connection to a local VIF. Traffic that arrives on a localport is never forwarded over a
tunnel to another chassis. These ports are present on every chassis and have the same
address in all of them. This is used to model connectivity to local services that run on
every hypervisor.
l2gateway
A connection to a physical network.
vtep A port to a logical switch on a VTEP gateway.
lsp-get-typeport
Get the type for the logical port.
lsp-set-optionsport [key=value]...
Set type-specific key-value options for the logical port.
lsp-get-optionsport
Get the type-specific options for the logical port.
lsp-set-dhcpv4-optionsportdhcp_options
Set the DHCPv4 options for the logical port. The dhcp_options is a UUID referring to a set of DHCP
options in the DHCP_Options table.
lsp-get-dhcpv4-optionsport
Get the configured DHCPv4 options for the logical port.
lsp-set-dhcpv6-optionsportdhcp_options
Set the DHCPv6 options for the logical port. The dhcp_options is a UUID referring to a set of DHCP
options in the DHCP_Options table.
lsp-get-dhcpv6-optionsport
Get the configured DHCPv6 options for the logical port.
lsp-get-lsport
Get the logical switch which the port belongs to.
lsp-attach-mirrorportm
Attaches the mirror m to the logical port port.
lsp-detach-mirrorportm
Detaches the mirror m from the logical port port.
ForwardingGroupCommands
[--liveness]fwd-group-addgroupswitchvipvmacports
Creates a new forwarding group named group as the name with the provided vip and vmac. vip should
be a virtual IP address and vmac should be a virtual MAC address to access the forwarding group.
ports are the logical switch port names that are put in the forwarding group. Example for ports is
lsp1 lsp2 ... Traffic destined to virtual IP of the forwarding group will be load balanced to all
the child ports.
When --liveness is specified then child ports are expected to be bound to external devices like
routers. BFD should be configured between hypervisors and the external devices. The child port
selection will become dependent on BFD status with its external device.
[--if-exists] fwd-group-delgroup
Deletes group. It is an error if group does not exist, unless --if-exists is specified.
fwd-group-list [switch]
Lists all existing forwarding groups, If switch is specified then only the forwarding groups
configured for switch will be listed.
LogicalRouterCommandslr-add Creates a new, unnamed logical router, which initially has no ports. The router does not have a
name, other commands must refer to this router by its UUID.
[--may-exist | --add-duplicate] lr-addrouter
Creates a new logical router named router, which initially has no ports.
The OVN northbound database schema does not require logical router names to be unique, but the
whole point to the names is to provide an easy way for humans to refer to the routers, making
duplicate names unhelpful. Thus, without any options, this command regards it as an error if
router is a duplicate name. With --may-exist, adding a duplicate name succeeds but does not create
a new logical router. With --add-duplicate, the command really creates a new logical router with a
duplicate name. It is an error to specify both options. If there are multiple logical routers with
a duplicate name, configure the logical routers using the UUID instead of the router name.
[--if-exists] lr-delrouter
Deletes router. It is an error if router does not exist, unless --if-exists is specified.
lr-list
Lists all existing routers on standard output, one per line.
LogicalRouterPortCommands
[--may-exist] lrp-addrouterportmac [network]... [peer=peer]
Creates on router a new logical router port named port with Ethernet address mac and IP
address/netmask for each network.
The optional argument peer identifies a logical router port that connects to this one. The
following example adds a router port with an IPv4 and IPv6 address with peer lr1:
lrp-addlr0lrp000:11:22:33:44:55192.168.0.1/242001:db8::1/64peer=lr1
It is an error if a logical router port named port already exists, unless --may-exist is
specified. Regardless of --may-exist, it is an error if the existing router port is in some
logical router other than router.
[--if-exists] lrp-delport
Deletes port. It is an error if port does not exist, unless --if-exists is specified.
lrp-listrouter
Lists all the logical router ports within router on standard output, one per line.
lrp-set-enabledportstate
Set the administrative state of port, either enabled or disabled. When a port is disabled, no
traffic is allowed into or out of the port.
lrp-get-enabledport
Prints the administrative state of port, either enabled or disabled.
lrp-set-gateway-chassisportchassis [priority]
Set gateway chassis for port. chassis is the name of the chassis. This creates a gateway chassis
entry in Gateway_Chassis table. It won’t check if chassis really exists in OVN_Southbound
database. Priority will be set to 0 if priority is not provided by user. priority must be between
0 and 32767, inclusive.
lrp-del-gateway-chassisportchassis
Deletes gateway chassis from port. It is an error if gateway chassis with chassis for port does
not exist.
lrp-get-gateway-chassisport
Lists all the gateway chassis with priority within port on standard output, one per line, ordered
based on priority.
LogicalRouterStaticRouteCommands
[--may-exist] [--policy=POLICY] [--ecmp] [--ecmp-symmetric-reply] [--bfd[=UUID]] lr-route-addrouterprefixnexthop [port]
Adds the specified route to router. prefix describes an IPv4 or IPv6 prefix for this route, such
as 192.168.100.0/24. nexthop specifies the gateway to use for this route, which should be the IP
address of one of router logical router ports or the IP address of a logical port. If port is
specified, packets that match this route will be sent out that port. When port is omitted, OVN
infers the output port based on nexthop. Nexthop can be set to discard for dropping packets which
match the given route.
--policy describes the policy used to make routing decisions. This should be one of "dst-ip" or
"src-ip". If not specified, the default is "dst-ip".
The --ecmp option allows for multiple routes with the same prefixPOLICY but different nexthop and
port to be added.
The --ecmp-symmetric-reply option makes it so that traffic that arrives over an ECMP route will
have its reply traffic sent out over that same route. Setting --ecmp-symmetric-reply implies
--ecmp so it is not necessary to set both.
--bfd option is used to link a BFD session to the OVN route. If the BFD session UUID is provided,
it will be used for the OVN route otherwise the next-hop will be used to perform a lookup in the
OVN BFD table. If the lookup fails and port is specified, a new entry in the BFD table will be
created using the nexthop as dst_ip and port as logical_port.
It is an error if a route with prefix and POLICY already exists, unless --may-exist, --ecmp, or
--ecmp-symmetric-reply is specified. If --may-exist is specified but not --ecmp or
--ecmp-symmetric-reply, the existed route will be updated with the new nexthop and port. If --ecmp
or --ecmp-symmetric-reply is specified, a new route will be added, regardless of the existed
route., which is useful when adding ECMP routes, i.e. routes with same POLICY and prefix but
different nexthop and port.
[--if-exists] [--policy=POLICY] lr-route-delrouter [prefix [nexthop [port]]]
Deletes routes from router. If only router is supplied, all the routes from the logical router are
deleted. If POLICY, prefix, nexthop and/or port are also specified, then all the routes that match
the conditions will be deleted from the logical router.
It is an error if there is no matching route entry, unless --if-exists is specified.
lr-route-listrouter
Lists the routes on router.
LogicalRouterPolicyCommands
[--may-exist] [--bfd] lr-policy-addrouterprioritymatchaction [nexthop[,nexthop,...]] [optionskey=value]]
Add Policy to router which provides a way to configure permit/deny and reroute policies on the
router. Permit/deny policies are similar to OVN ACLs, but exist on the logical-router. Reroute
policies are needed for service-insertion and service-chaining. nexthop is an optional parameter.
It needs to be provided only when action is reroute. Multiple nexthops can be specified for ECMP
routing. A policy is uniquely identified by priority and match. Multiple policies can have the
same priority. options sets the router policy options as key-value pair. The supported option is :
pkt_mark.
If --may-exist is specified, adding a duplicated routing policy with the same priority and match
string is not really created. Without --may-exist, adding a duplicated routing policy results in
error.
--bfd option is used to link a BFD session to the OVN reroute policy. OVN will look for an already
running BFD session using next-hop as lookup key in the BFD table. If the lookup fails, a new
entry in the BFD table will be created using the nexthop as dst_ip.
The following example shows a policy to lr1, which will drop packets from192.168.100.0/24.
lr-policy-addlr1100ip4.src==192.168.100.0/24drop.
lr-policy-addlr1100ip4.src==192.168.100.0/24allowpkt_mark=100 .
[--if-exists] lr-policy-delrouter [{priority|uuid}[match]]
Deletes polices from router. If only router is supplied, all the polices from the logical router
are deleted. If priority and/or match are also specified, then all the polices that match the
conditions will be deleted from the logical router.
If router and uuid are supplied, then the policy with specified uuid is deleted. It is an error if
uuid does not exist, unless --if-exists is specified.
lr-policy-listrouter
Lists the polices on router.
NATCommands
[--may-exist] [--stateless] [--gateway-port=GATEWAY_PORT] [-portrange] [--match=MATCH]
[--priority=PRIORITY] lr-nat-addroutertypeexternal_iplogical_ip [logical_portexternal_mac]
[external_port_range]
Adds the specified NAT to router. The type must be one of snat, dnat, or dnat_and_snat. The
external_ip is an IPv4 address. The logical_ip is an IPv4 network (e.g 192.168.1.0/24) or an IPv4
address. The logical_port and external_mac are only accepted when router is a distributed router
(rather than a gateway router) and type is dnat_and_snat. The logical_port is the name of an
existing logical switch port where the logical_ip resides. The external_mac is an Ethernet
address.
When --stateless is specified then it implies that we will be not use connection tracker, i.e
internal ip and external ip are 1:1 mapped. This implies that --stateless is applicable only to
dnat_and_snat type NAT rules. An external ip with --stateless NAT cannot be shared with any other
NAT rule.
--gateway-port option allows specifying the distributed gateway port of router where the NAT rule
needs to be applied. GATEWAY_PORT should reference a Logical_Router_Port row that is a distributed
gateway port of router. When router has multiple distributed gateway ports and the gateway port
for this NAT can’t be inferred from the external_ip, it is an error to not specify the
GATEWAY_PORT.
If the --portrange option is specified, then a range of ports may be specified in the
external_port_range part of the lr-nat-add command. If this option is omitted, then an external
port range may not be specified. The format of the port range is port_low-port_high, where
port_low is a lower number than port_high. When the packet is NATted, a random port from the range
will be selected as the source port. The range for the external_port_range is 1-65535.
The --match allows to specify the extra match condition. The extra match is for more fine-grained
control over the NAT rule.
The --priority option allows to specify order of NAT rule evaluation. Priority must be between 0
and 32767, inclusive and can be only specified together with --match.
When type is dnat, the externally visible IP address external_ip is DNATted to the IP address
logical_ip in the logical space.
When type is snat, IP packets with their source IP address that either matches the IP address in
logical_ip or is in the network provided by logical_ip is SNATed into the IP address in
external_ip.
When type is dnat_and_snat, the externally visible IP address external_ip is DNATted to the IP
address logical_ip in the logical space. In addition, IP packets with the source IP address that
matches logical_ip is SNATed into the IP address in external_ip.
When the logical_port and external_mac are specified, the NAT rule will be programmed on the
chassis where the logical_port resides. This includes ARP replies for the external_ip, which
return the value of external_mac. All packets transmitted with source IP address equal to
external_ip will be sent using the external_mac.
It is an error if a NAT already exists with the same values of router, type, external_ip,
logical_ip and GATEWAY_PORT (in case of multiple distributed gateway ports), unless --may-exist is
specified. When --may-exist, logical_port, and external_mac are all specified, the existing values
of logical_port and external_mac are overwritten.
[--if-exists] lr-nat-delrouter [type [ip] [gateway_port]]
Deletes NATs from router. If only router is supplied, all the NATs from the logical router are
deleted. If type is also specified, then all the NATs that match the type will be deleted from the
logical router. If ip is also specified without specifying gateway_port, then all the NATs that
match the type and ip will be deleted from the logical router. If gateway_port is specified
without specifying ip, then all the NATs that match the type and gateway_port will be deleted from
the logical router. If all the fields are given, then a single NAT rule that matches all the
fields will be deleted. When type is snat, the ip should be logical_ip. When type is dnat or
dnat_and_snat, the ip should be external_ip.
It is an error if both ip and gateway_port are specified and there is no matching NAT entry,
unless --if-exists is specified.
lr-nat-listrouter
Lists the NATs on router.
LoadBalancerCommands
[--may-exist | --add-duplicate | --reject | --event] lb-addlbvipips [protocol]
Creates a new load balancer named lb with the provided vip and ips or adds the vip to an existing
lb. vip should be a virtual IP address (or an IP address and a port number with : as a separator).
Examples for vip are 192.168.1.4, fd0f::1, and 192.168.1.5:8080. ips should be comma separated IP
endpoints (or comma separated IP addresses and port numbers with : as a separator). ips must be
the same address family as vip. Examples for ips are 10.0.0.1,10.0.0.2or
[fdef::1]:8800,[fdef::2]:8800.
The optional argument protocol must be either tcp, udp or sctp. This argument is useful when a
port number is provided as part of the vip. If the protocol is unspecified and a port number is
provided as part of the vip, OVN assumes the protocol to be tcp.
It is an error if the vip already exists in the load balancer named lb, unless --may-exist is
specified. With --add-duplicate, the command really creates a new load balancer with a duplicate
name.
If the load balancer is created with --reject option and it has no active backends, a TCP reset
segment (for tcp) or an ICMP port unreachable packet (for all other kind of traffic) will be sent
whenever an incoming packet is received for this load-balancer. Please note using --reject option
will disable empty_lb SB controller event for this load balancer.
If the load balancer is created with --event option and it has no active backends, whenever the lb
receives traffic, the event is reported in the Controller_Event table in the SB db. Please note
--event option can’t be specified with --reject one.
The following example adds a load balancer.
lb-addlb030.0.0.10:80192.168.10.10:80,192.168.10.20:80,192.168.10.30:80udp
[--if-exists] lb-dellb [vip]
Deletes lb or the vip from lb. If vip is supplied, only the vip will be deleted from the lb. If
only the lb is supplied, the lb will be deleted. It is an error if vip does not already exist in
lb, unless --if-exists is specified.
lb-list [lb]
Lists the LBs. If lb is also specified, then only the specified lb will be listed.
[--may-exist] ls-lb-addswitchlb
Adds the specified lb to switch. It is an error if a load balancer named lb already exists in the
switch, unless --may-exist is specified.
[--if-exists] ls-lb-delswitch [lb]
Removes lb from switch. If only switch is supplied, all the LBs from the logical switch are
removed. If lb is also specified, then only the lb will be removed from the logical switch. It is
an error if lb does not exist in the switch, unless --if-exists is specified.
ls-lb-listswitch
Lists the LBs for the given switch.
[--may-exist] lr-lb-addrouterlb
Adds the specified lb to router. It is an error if a load balancer named lb already exists in the
router, unless --may-exist is specified.
[--if-exists] lr-lb-delrouter [lb]
Removes lb from router. If only router is supplied, all the LBs from the logical router are
removed. If lb is also specified, then only the lb will be removed from the logical router. It is
an error if lb does not exist in the router, unless --if-exists is specified.
lr-lb-listrouter
Lists the LBs for the given router.
DHCPOptionscommandsdhcp-options-createcidr [key=value]
Creates a new DHCP Options entry in the DHCP_Options table with the specified cidr and optional
external-ids.
dhcp-options-list
Lists the DHCP Options entries.
dhcp-options-deldhcp-option
Deletes the DHCP Options entry referred by dhcp-option UUID.
dhcp-options-set-optionsdhcp-option [key=value]...
Set the DHCP Options for the dhcp-option UUID.
dhcp-options-get-optionsdhcp-option
Lists the DHCP Options for the dhcp-option UUID.
PortGroupcommandspg-addgroup [port]...
Creates a new port group in the Port_Group table named group with optional ports added to the
group.
pg-set-portsgroupport...
Sets ports on the port group named group. It is an error if group does not exist.
pg-delgroup
Deletes port group group. It is an error if group does not exist.
HAChassisGroupcommandsha-chassis-group-addgroup
Creates a new HA chassis group in the HA_Chassis_Group table named group.
ha-chassis-group-delgroup
Deletes the HA chassis group group. It is an error if group does not exist.
ha-chassis-group-list [ha-chassis-group]
Lists all HA chassis groups along with the HAchassis if any associated with it. If ha-chassis-group is also specified, then only the specified ha-chassis-group will be listed.
ha-chassis-group-add-chassisgroupchassispriority
Adds a new HA chassis chassis to the HA Chassis group group with the specified priority. If the
chassis already exists, then the priority is updated. The chassis should be the name of the
chassis in the OVN_Southbound.
ha-chassis-group-remove-chassisgroupchassis
Removes the HA chassis chassis from the HA chassis group group. It is an error if chassis does not
exist.
ControlPlaneProtectionPolicycommands
These commands manage meters configured in Copp table linking them to logical datapaths through copp
column in Logical_Switch or Logical_Router tables. Protocol packets for which CoPP is enforced when
sending packets to ovn-controller (if configured):
• ARP
• ND_NS
• ND_NA
• ND_RA
• ND
• DNS
• IGMP
• packets that require ARP resolution before forwarding
• packets that require ND_NS before forwarding
• packets that need to be replied to with ICMP Errors
• packets that need to be replied to with TCP RST
• packets that need to be replied to with DHCP_OPTS
• packets that trigger a reject action
• packets that trigger a SCTP abort action
• controller_events
• BFD
copp-addnameprotometer
Adds the control proto to meter mapping to the control plane protection policy name. If no
policy exists yet, it creates one. If a mapping already existed for proto, this will
overwrite it.
copp-delname [proto]
Removes the control proto mapping for the name control plane protection policy. If proto is
not specified, the whole control plane protection policy is destroyed.
copp-listname
Display the current control plane protection policy for name.
ls-copp-addnameswitch
Adds the control plane protection policy name to the logical switch switch.
lr-copp-addnamerouter
Adds the control plane protection policy name to the logical router router.
Mirrorcommandsmirror-addmtype [index] filterdest
Creates a new mirror in the Mirror table with the name m with the below mandatory arguments.
type specifies the mirror type - gre , erspan or local.
index specifies the tunnel index value (which is an integer) if the type is gre or erspan.
filter specifies the mirror source selection. Can be from-lport, to-lport or both.
dest specifies the mirror destination IP (v4 or v6) if the type is gre or erspan. For a type of
local, this field defines a local interface on the OVS integration bridge to be used as the mirror
destination. The interface must possess external-ids:mirror-id that matches this string.
mirror-delm
Deletes the mirror m.
mirror-list
Lists the mirrors.
SynchronizationCommands
sync Ordinarily, --wait=sb or --wait=hv only waits for changes by the current ovn-nbctl invocation to
take effect. This means that, if none of the commands supplied to ovn-nbctl change the database,
then the command does not wait at all. With the sync command, however, ovn-nbctl waits even for
earlier changes to the database to propagate down to the southbound database or all of the OVN
chassis, according to the argument to --wait.
RemoteConnectivityCommands
These commands manipulate the connections column in the NB_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-nbctl to configure database connections.
get-connection
Prints the configured connection(s).
del-connection
Deletes the configured connection(s).
[--inactivity-probe=msecs] set-connectiontarget...
Sets the configured manager target or targets. Use --inactivity-probe=msecs to override the
default idle connection inactivity probe time. Use 0 to disable inactivity probes.
SSL/TLSConfigurationCommandsget-ssl
Prints the SSL/TLS configuration.
del-ssl
Deletes the current SSL/TLS configuration.
[--bootstrap] set-sslprivate-keycertificateca-cert [ssl-protocol-list [ssl-cipher-list [ssl-ciphersuites]]]
Sets the SSL/TLS configuration.
DatabaseCommands
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-nbctl commands.
IdentifyingTables,Records,andColumns
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-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. d or dhcp is sufficient to identify the DHCP_Options
table.
DatabaseValues
Each column in the database accepts a fixed type of data. The currently defined basic types, and their
representations, are:
integer
A decimal integer in the range -2**63 to 2**63-1, inclusive.
real A floating-point number.
Boolean
True or false, written true or false, respectively.
string An arbitrary Unicode string, except that null bytes are not allowed. Quotes are optional
for most strings that begin with an English letter or underscore and consist only of
letters, underscores, hyphens, and periods. However, true and false and strings that match
the syntax of UUIDs (see below) must be enclosed in double quotes to distinguish them from
other basic types. When double quotes are used, the syntax is that of strings in JSON, e.g.
backslashes may be used to escape special characters. The empty string must be represented
as a pair of double quotes ("").
UUID Either a universally unique identifier in the style of RFC 4122, e.g.
f81d4fae-7dec-11d0-a765-00a0c91e6bf6, or an @name defined by a get or create command within
the same ovs-vsctl invocation.
Multiple values in a single column may be separated by spaces or a single comma. When multiple values are
present, duplicates are not allowed, and order is not important. Conversely, some database columns can
have an empty set of values, represented as [], and square brackets may optionally enclose other non-
empty sets or single values as well.
A few database columns are ``maps’’ of key-value pairs, where the key and the value are each some fixed
database type. These are specified in the form key=value, where key and value follow the syntax for the
column’s key type and value type, respectively. When multiple pairs are present (separated by spaces or a
comma), duplicate keys are not allowed, and again the order is not important. Duplicate values are
allowed. An empty map is represented as {}. Curly braces may optionally enclose non-empty maps as well
(but use quotes to prevent the shell from expanding other-config={0=x,1=y} into other-config=0=xother-config=1=y, which may not have the desired effect).
DatabaseCommandSyntax
[--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.
[--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,2 selects records in which the flood-vlans column is the empty set
or contains 1 or 2 or both.
{<} Selects records in which column[:key] is a proper subset of value. For example,
flood-vlans{<}1,2 selects records in which the flood-vlans column is the empty set
or contains 1 or 2 but not both.
{>=}{>}
Same as {<=} and {<}, respectively, except that the relationship is reversed. For
example, flood-vlans{>=}1,2 selects records in which the flood-vlans column contains
both 1 and 2.
The following operators are available only in Open vSwitch 2.16 and later:
{in} Selects records in which every element in column[:key] is also in value. (This is
the same as {<=}.)
{not-in}
Selects records in which every element in column[:key] is not in value.
For arithmetic operators (=!=<><=>=), when key is specified but a particular record’s
column does not contain key, the record is always omitted from the results. Thus, the
condition other-config:mtu!=1500 matches records that have a mtu key whose value is not
1500, but not those that lack an mtu key.
For the set operators, when key is specified but a particular record’s column does not
contain key, the comparison is done against an empty set. Thus, the condition
other-config:mtu{!=}1500 matches records that have a mtu key whose value is not 1500 and
those that lack an mtu key.
Don’t forget to escape < or > from interpretation by the shell.
If --columns is specified, only the requested columns are listed, in the specified order.
Otherwise all columns are listed, in alphabetical order by column name.
The UUIDs shown for rows created in the same ovs-vsctl invocation will be wrong.
[--if-exists] [--id=@name] gettablerecord [column[:key]]...
Prints the value of each specified column in the given record in table. For map columns, a
key may optionally be specified, in which case the value associated with key in the column
is printed, instead of the entire map.
Without --if-exists, it is an error if record does not exist or key is specified, if key
does not exist in record. With --if-exists, a missing record yields no output and a missing
key prints a blank line.
If @name is specified, then the UUID for record may be referred to by that name later in
the same ovs-vsctl invocation in contexts where a UUID is expected.
Both --id and the column arguments are optional, but usually at least one or the other
should be specified. If both are omitted, then get has no effect except to verify that
record exists in table.
--id and --if-exists cannot be used together.
[--if-exists] settablerecordcolumn[:key]=value...
Sets the value of each specified column in the given record in table to value. For map
columns, a key may optionally be specified, in which case the value associated with key in
that column is changed (or added, if none exists), instead of the entire map.
Without --if-exists, it is an error if record does not exist. With --if-exists, this
command does nothing if record does not exist.
[--if-exists] addtablerecordcolumn [key=]value...
Adds the specified value or key-value pair to column in record in table. If column is a
map, then key is required, otherwise it is prohibited. If key already exists in a map
column, then the current value is not replaced (use the set command to replace an existing
value).
Without --if-exists, it is an error if record does not exist. With --if-exists, this
command does nothing if record does not exist.
[--if-exists] removetablerecordcolumnvalue...
[--if-exists] removetablerecordcolumnkey...
[--if-exists] removetablerecordcolumnkey=value... Removes the specified values or key-
value pairs from column in record in table. The first form applies to columns that are not
maps: each specified value is removed from the column. The second and third forms apply to
map columns: if only a key is specified, then any key-value pair with the given key is
removed, regardless of its value; if a value is given then a pair is removed only if both
key and value match.
It is not an error if the column does not contain the specified key or value or pair.
Without --if-exists, it is an error if record does not exist. With --if-exists, this
command does nothing if record does not exist.
[--if-exists] cleartablerecordcolumn...
Sets each column in record in table to the empty set or empty map, as appropriate. This
command applies only to columns that are allowed to be empty.
Without --if-exists, it is an error if record does not exist. With --if-exists, this
command does nothing if record does not exist.
[--id=(@name|uuid)] createtablecolumn[:key]=value...
Creates a new record in table and sets the initial values of each column. Columns not
explicitly set will receive their default values. Outputs the UUID of the new row.
If @name is specified, then the UUID for the new row may be referred to by that name
elsewhere in the same \*(PN invocation in contexts where a UUID is expected. Such
references may precede or follow the create command.
If a valid uuid is specified, then it is used as the UUID of the new row.
Caution (ovs-vsctl as example)
Records in the Open vSwitch database are significant only when they can be reached
directly or indirectly from the Open_vSwitch table. Except for records in the QoS or
Queue tables, records that are not reachable from the Open_vSwitch table are
automatically deleted from the database. This deletion happens immediately, without
waiting for additional ovs-vsctl commands or other database activity. Thus, a create
command must generally be accompanied by additional commands withinthesameovs-vsctlinvocation to add a chain of references to the newly created record from
the top-level Open_vSwitch record. The EXAMPLES section gives some examples that
show how to do this.
[--if-exists] destroytablerecord...
Deletes each specified record from table. Unless --if-exists is specified, each records
must exist.
--alldestroytable
Deletes all records from the table.
Caution (ovs-vsctl as example)
The destroy command is only useful for records in the QoS or Queue tables. Records
in other tables are automatically deleted from the database when they become
unreachable from the Open_vSwitch table. This means that deleting the last reference
to a record is sufficient for deleting the record itself. For records in these
tables, destroy is silently ignored. See the EXAMPLES section below for more
information.
wait-untiltablerecord [column[:key]=value]...
Waits until table contains a record named record whose column equals value or, if key is
specified, whose column contains a key with the specified value. This command supports the
same operators and semantics described for the find command above.
If no column[:key]=value arguments are given, this command waits only until record exists.
If more than one such argument is given, the command waits until all of them are satisfied.
Caution (ovs-vsctl as example)
Usually wait-until should be placed at the beginning of a set of ovs-vsctl commands.
For example, wait-untilbridgebr0--getbridgebr0datapath_id waits until a
bridge named br0 is created, then prints its datapath_id column, whereas getbridgebr0datapath_id--wait-untilbridgebr0 will abort if no bridge named br0 exists
when ovs-vsctl initially connects to the database.
Consider specifying --timeout=0 along with --wait-until, to prevent ovs-vsctl from
terminating after waiting only at most 5 seconds.
comment [arg]...
This command has no effect on behavior, but any database log record created by the command
will include the command and its arguments.