Support for Open vSwitch - module with basic Open vSwitch commands.
Suitable for setting up Openstack Neutron.
Jiri Kotlin <jiri.kotlin@ultimum.io>
Creates a new bridge.
br -- string bridge name
may_exist -- bool if False - attempting to create a bridge that exists returns False.
parent -- string name of the parent bridge (if the bridge shall be created as a fake bridge). If specified, vlan must also be specified.
versionadded: (..) -- 3006.0:
vlan -- int VLAN ID of the bridge (if the bridge shall be created as a fake bridge). If specified, parent must also be specified.
versionadded: -- 3006.0:
True on success, else False.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.bridge_create br0
Deletes bridge and all of its ports.
br -- A string - bridge name
if_exists -- Bool, if False - attempting to delete a bridge that does not exist returns False.
True on success, else False.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.bridge_delete br0
Tests whether bridge exists as a real or fake bridge.
True if Bridge exists, else False.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.bridge_exists br0
Lists all existing real and fake bridges.
List of bridges (or empty list), False on failure.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.bridge_list
New in version 3006.0.
Returns the parent bridge of a bridge.
br -- string bridge name
Name of the parent bridge. This is the same as the bridge name if the bridge is not a fake bridge. If the bridge does not exist, False is returned.
CLI Example:
salt '*' openvswitch.bridge_to_parent br0
New in version 3006.0.
Returns the VLAN ID of a bridge.
br -- string bridge name
VLAN ID of the bridge. The VLAN ID is 0 if the bridge is not a fake bridge. If the bridge does not exist, False is returned.
CLI Example:
salt '*' openvswitch.bridge_to_parent br0
New in version 3006.0.
Gets a column's value for a specific record.
table -- string name of the database table
record -- string identifier of the record
column -- string name of the column
if_exists -- boolean if True, it is not an error if the record does not exist.
The column's value.
CLI Example:
salt '*' openvswitch.db_get Port br0 vlan_mode
New in version 3006.0.
Sets a column's value for a specific record.
table -- string name of the database table
record -- string identifier of the record
column -- string name of the column
value -- string the value to be set
if_exists -- boolean if True, it is not an error if the record does not exist.
None on success and an error message on failure.
CLI Example:
salt '*' openvswitch.db_set Interface br0 mac 02:03:04:05:06:07
Port's interface's optional parameters.
port -- A string - port name.
String containing optional parameters of port's interface, False on failure.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.interface_get_options tap0
Type of port's interface.
port -- A string - port name.
String - type of interface or empty string, False on failure.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.interface_get_type tap0
Creates on bridge a new port named port.
True on success, else False.
br -- A string - bridge name
port -- A string - port name
may_exist -- Bool, if False - attempting to create a port that exists returns False.
internal -- A boolean to create an internal interface if one does not exist.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.port_add br0 8080
Generic Routing Encapsulation - creates GRE tunnel between endpoints.
br -- A string - bridge name.
port -- A string - port name.
id -- An integer - unsigned 32-bit number, tunnel's key.
remote -- A string - remote endpoint's IP address.
True on success, else False.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.port_create_gre br0 gre1 5001 192.168.1.10
Isolate VM traffic using VLANs.
br -- A string - bridge name.
port -- A string - port name.
id -- An integer in the valid range 0 to 4095 (inclusive), name of VLAN.
internal -- A boolean to create an internal interface if one does not exist.
True on success, else False.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.port_create_vlan br0 tap0 100
Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints.
br -- A string - bridge name.
port -- A string - port name.
id -- An integer - unsigned 64-bit number, tunnel's key.
remote -- A string - remote endpoint's IP address.
dst_port -- An integer - port to use when creating tunnelport in the switch.
True on success, else False.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.port_create_vxlan br0 vx1 5001 192.168.1.10 8472
Lists tags of the port.
port -- A string - port name.
List of tags (or empty list), False on failure.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.port_get_tag tap0
Lists all of the ports within bridge.
br -- A string - bridge name.
List of bridges (or empty list), False on failure.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.port_list br0
Deletes port.
br -- A string - bridge name (If bridge is None, port is removed from whatever bridge contains it)
port -- A string - port name.
if_exists -- Bool, if False - attempting to delete a por that does not exist returns False. (Default True)
True on success, else False.
New in version 2016.3.0.
CLI Example:
salt '*' openvswitch.port_remove br0 8080