Database commands


Database commands create, list and modify the contents of ovsdb tables.PicOS OVS support the following tables, as:

Bridge table

Configure a bridge within an Open vSwitch. Record bridge configurations by _uuid in bridge tables.

Controller table

Configure an OpenFlow controller, record controller infos by _uuid in controller table.

Interface table

Configure a network device attached to a port, record interface configurations by _uuid in interface table.

Mirror table

Configure a mirror port to a bridge, record mirror configurations by _uuid in mirror table.

Open_vSwitch table

The global configurations for ovs-vswitchd, record configurations by _uuid.

Pica8 table

Pica_match_mode table

Port table

Configure bridge ports, record port configurations by _uuid in port table.

QoS table

Configure quality-of-service for a port, record QoS configurations by _uuid in QoS table.

Queue table

Configure one queue within a QoS, record by _uuid in queue table.

SSL table

sFlow table

Configure an sFlow exporter attached to a bridge, record by _uuid in sFlow table.

NetFlow table

Configure a NetFlow attached to a bridge, records by _uuid in NetFlow table.

ovs-vsctl [--OPTION] list <table> [record]

List the [record] record if special [record], otherwise, list all records in <table>.
The [record] mean _uuid or special name
Examples:

 

admin@XorPlus$ovs-vsctl list port te-1/1/1
_uuid               : e16c6743-999e-49af-8c0a-bc27eb897924
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [d8674864-22f1-41eb-8ece-ce35d90c5a64]
lacp                : []
mac                 : []
name                : "te-1/1/1"
other_config        : {}
qos                 : []
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []

 

admin@XorPlus$ovs-vsctl list bridge
_uuid               : 2fa9c8d9-055e-4c2a-b5e4-2f22505cbda6
controller          : [07e2aaf5-fca3-4f77-93fe-e726d58637b9]
datapath_id         : "5e3e00e09500169a"
datapath_type       : "pica8"
external_ids        : {}
fail_mode           : []
flood_vlans         : []
flow_tables         : {}
ipfix               : []
lldp_enable         : false
mirrors             : []
name                : "br0"
netflow             : []
other_config        : {}
ports               : [3b4d71fc-eaad-4b01-9b95-be56239f3253, 630fb94c-4a7c-42f7-a195-49fd9f525177, e16c6743-999e-49af-8c0a-bc27eb897924, f73b04e1-23bb-4b19-ab71-b25afa155968]
protocols           : ["OpenFlow13"]
sflow               : []
status              : {}
stp_enable          : false

 

admin@XorPlus$ovs-vsctl list Pica8
_uuid               : 8570c5d9-b22d-40ed-9e84-1c7e3b0e1dfd
combinate_actions_enable: false
cos_map_enable      : true
egress_mode_enable  : false
egress_mode_table   : 0
flow_counter_mode   : []
hardware_type       : "P5401"
l2_l3_buffer_mode   : []
l2_l3_preference    : false
l2_mode_enable      : false
l2_mode_table       : 0
l2gre_key_length    : []
l3_ecmp_max_ports   : 0
l3_mode_enable      : false
l3_mode_table       : 0
lag_advance_hash_mapping_fields: []
loopback_enable     : false
match_mode          : []
port_mode           : max
proxy_arp_subnet    : []
proxy_icmpv6_subnet : []
udf_mode            : []
xovs_crossflow_ports: ["te-1/1/1", "te-1/1/2", "te-1/1/3", "te-1/1/4"]
xovs_openflow_ports : []
xovs_vlans          : ["1", "100-110"]

 

ovs-vsctl [--OPTION] find <table> <condition> [condition…]

List records satisfying <condition> in <table>.
The <condition> represent a column equels value or not. If the value is specified, the operations can be support: "=", "!=", "<", ">", "<=", ">=", "\{=\}", "\{!=}", "{<}", "{>}", "{<=}" and "{>=}".
Example:

ovs-vsctl find bridge datapath_id=5e3e089e01616580 name=br0

ovs-vsctl [--OPTION] get <table> <record > <column> [:key]

Print values of column in <record> in <table>. <table> mean table name, and <record> mean _uuid.
Example:(print the value of datapath_id in the _uuid=80984dfb-5f63-45c8-bd3f-6bda918ffc75 in bridge table.)

ovs-vsctl get bridge 80984dfb-5f63-45c8-bd3f-6bda918ffc75 datapath_id

ovs-vsctl [--OPTION] set <table> <record > <column> [:key] <=value>

Set or change the column values in <record> in <table>.
Example: (change the value of trunks in ge-1/1/2 in port table.)

root@PicOS-OVS$ovs-vsctl list port ge-1/1/2
_uuid : 6e7b862a-6503-4f1b-982d-b33b65e3dc01
bond_downdelay : 0
bond_fake_iface : false
bond_mode : []
bond_updelay : 0
external_ids : {}
fake_bridge : false
interfaces : [f1b5568f-bd6f-480d-a9ca-636486f387c2]
lacp : []
mac : []
name : "ge-1/1/2"
other_config : {}
qos : []
statistics : {}
status : {}
tag : 1
trunks : [2000, 4094]
root@PicOS-OVS$ovs-vsctl set port 6e7b862a-6503-4f1b-982d-b33b65e3dc01 trunks=100,200
root@PicOS-OVS$ovs-vsctl list port ge-1/1/2
_uuid : 6e7b862a-6503-4f1b-982d-b33b65e3dc01
bond_downdelay : 0
bond_fake_iface : false
bond_mode : []
bond_updelay : 0
external_ids : {}
fake_bridge : false
interfaces : [f1b5568f-bd6f-480d-a9ca-636486f387c2]
lacp : []
mac : []
name : "ge-1/1/2"
other_config : {}
qos : []
statistics : {}
status : {}
tag : 1
trunks : [100, 200]
vlan_mode : trunk

ovs-vsctl [--OPTION] destroy <table> <record>

Deletes<record> from <table>.

ovs-vsctl [--OPTION] add <table> <record > <column> [key=] <value>

Add the column values in <record> in <table>.
Example: (add the value of trunks in ge-1/1/2 in port table.)

root@PicOS-OVS$ovs-vsctl get port ge-1/1/2 trunks
[100, 200]
root@PicOS-OVS$
root@PicOS-OVS$ovs-vsctl add port ge-1/1/2 trunks 100,300
root@PicOS-OVS$ovs-vsctl get port ge-1/1/2 trunks
[100, 200, 300]

ovs-vsctl [--OPTION] remove <table> <record > <column> [key=] <value>

Remove the column value in <record> in <table>.
Example: (remove the value of trunks in ge-1/1/2 in port table.)

root@PicOS-OVS$ovs-vsctl get port ge-1/1/2 trunks 
[100, 200, 300]
root@PicOS-OVS$ovs-vsctl remove port ge-1/1/2 trunks trunks 100 
root@PicOS-OVS$
root@PicOS-OVS$ovs-vsctl get port ge-1/1/2 trunks
[200, 300]

ovs-vsctl [--OPTION] clear <table> <record > <column>

Clear all values from column in <record> in <table>.
Example:
Clear all values of trunks in ge-1/1/2 in port table.

root@PicOS-OVS$ovs-vsctl get port ge-1/1/2 trunks
[200, 300]
root@PicOS-OVS$ovs-vsctl clear port ge-1/1/2 trunks 
[]
root@PicOS-OVS$

Copyright © 2024 Pica8 Inc. All Rights Reserved.