This Page

The quantum.plugins.openvswitch.agent.ovs_quantum_agent Module

class quantum.plugins.openvswitch.agent.ovs_quantum_agent.LocalVLANMapping(vlan, network_type, physical_network, segmentation_id, vif_ports=None)
class quantum.plugins.openvswitch.agent.ovs_quantum_agent.OVSPluginApi(topic)

Bases: quantum.agent.rpc.PluginApi, quantum.agent.securitygroups_rpc.SecurityGroupServerRpcApiMixin

class quantum.plugins.openvswitch.agent.ovs_quantum_agent.OVSQuantumAgent(integ_br, tun_br, local_ip, bridge_mappings, root_helper, polling_interval, enable_tunneling)

Bases: quantum.agent.securitygroups_rpc.SecurityGroupAgentRpcCallbackMixin

Implements OVS-based tunneling, VLANs and flat networks.

Two local bridges are created: an integration bridge (defaults to ‘br-int’) and a tunneling bridge (defaults to ‘br-tun’). An additional bridge is created for each physical network interface used for VLANs and/or flat networks.

All VM VIFs are plugged into the integration bridge. VM VIFs on a given virtual network share a common “local” VLAN (i.e. not propagated externally). The VLAN id of this local VLAN is mapped to the physical networking details realizing that virtual network.

For virtual networks realized as GRE tunnels, a Logical Switch (LS) identifier and is used to differentiate tenant traffic on inter-HV tunnels. A mesh of tunnels is created to other Hypervisors in the cloud. These tunnels originate and terminate on the tunneling bridge of each hypervisor. Port patching is done to connect local VLANs on the integration bridge to inter-hypervisor tunnels on the tunnel bridge.

For each virtual networks realized as a VLANs or flat network, a veth is used to connect the local VLAN on the integration bridge with the physical network bridge, with flow rules adding, modifying, or stripping VLAN tags as necessary.

MAX_VLAN_TAG = 4094
MIN_VLAN_TAG = 1
RPC_API_VERSION = '1.1'
create_rpc_dispatcher()

Get the rpc dispatcher for this manager.

If a manager would like to set an rpc API version, or support more than one class as the target of rpc messages, override this method.

daemon_loop()
get_net_uuid(vif_id)
network_delete(context, **kwargs)
port_bound(port, net_uuid, network_type, physical_network, segmentation_id)

Bind port to net_uuid/lsw_id and install flow for inbound traffic to vm.

Parameters:
  • port – a ovslib.VifPort object.
  • net_uuid – the net_uuid this port is to be associated with.
  • network_type – the network type (‘gre’, ‘vlan’, ‘flat’, ‘local’)
  • physical_network – the physical network for ‘vlan’ or ‘flat’
  • segmentation_id – the VID for ‘vlan’ or tunnel ID for ‘tunnel’
port_dead(port)

Once a port has no binding, put it on the “dead vlan”.

Parameters:port – a ovs_lib.VifPort object.
port_unbound(vif_id, net_uuid=None)

Unbind port.

Removes corresponding local vlan mapping object if this is its last VIF.

Parameters:
  • vif_id – the id of the vif
  • net_uuid – the net_uuid this port is associated with.
port_update(context, **kwargs)
process_ancillary_network_ports(port_info)
process_network_ports(port_info)
provision_local_vlan(net_uuid, network_type, physical_network, segmentation_id)

Provisions a local VLAN.

Parameters:
  • net_uuid – the uuid of the network associated with this vlan.
  • network_type – the network type (‘gre’, ‘vlan’, ‘flat’, ‘local’)
  • physical_network – the physical network for ‘vlan’ or ‘flat’
  • segmentation_id – the VID for ‘vlan’ or tunnel ID for ‘tunnel’
reclaim_local_vlan(net_uuid, lvm)

Reclaim a local VLAN.

Parameters:
  • net_uuid – the network uuid associated with this vlan.
  • lvm – a LocalVLANMapping object that tracks (vlan, lsw_id, vif_ids) mapping.
rpc_loop()
setup_ancillary_bridges(integ_br, tun_br)

Setup ancillary bridges - for example br-ex.

setup_integration_br(bridge_name)

Setup the integration bridge.

Create patch ports and remove all existing flows.

Parameters:bridge_name – the name of the integration bridge.
Returns:the integration bridge
setup_physical_bridges(bridge_mappings)

Setup the physical network bridges.

Creates physical network bridges and links them to the integration bridge using veths.

Parameters:bridge_mappings – map physical network names to bridge names.
setup_rpc(integ_br)
setup_tunnel_br(tun_br)

Setup the tunnel bridge.

Creates tunnel bridge, and links it to the integration bridge using a patch port.

Parameters:tun_br – the name of the tunnel bridge.
treat_ancillary_devices_added(devices)
treat_ancillary_devices_removed(devices)
treat_devices_added(devices)
treat_devices_removed(devices)
treat_vif_port(vif_port, port_id, network_id, network_type, physical_network, segmentation_id, admin_state_up)
tunnel_sync()
tunnel_update(context, **kwargs)
update_ancillary_ports(registered_ports)
update_ports(registered_ports)
class quantum.plugins.openvswitch.agent.ovs_quantum_agent.OVSSecurityGroupAgent(context, plugin_rpc, root_helper)

Bases: quantum.agent.securitygroups_rpc.SecurityGroupAgentRpcMixin

class quantum.plugins.openvswitch.agent.ovs_quantum_agent.Port(p)

Bases: object

Represents a quantum port.

Class stores port data in a ORM-free way, so attributres are still available even if a row has been deleted.

quantum.plugins.openvswitch.agent.ovs_quantum_agent.create_agent_config_map(config)

Create a map of agent config parameters.

Parameters:config – an instance of cfg.CONF
Returns:a map of agent configuration parameters
quantum.plugins.openvswitch.agent.ovs_quantum_agent.main()