CiscoSystems/neutron — pull request #35 by signed8bit (2014-09-24 18:52:12+00:00)
Title: DE734: Instance not getting DHCP due to missing of vlan tag on openvswitch port

This is an adaptation of a patch sourced from AT&T to work with the current version of the OVS agent code (https://gist.githubusercontent.com/alanmeadows/fcfb6a4f9596fe37341c/raw/00df709b468fe65815bf6fc5e1623958f5642e4a/gistfile1.txt).

It scans for ports that have no VLAN tag but should and forces a resyc for said port. I based this check on checking the current tenant_network_type and execute when type is VLAN, VXLAN or GRE. I am not 100% sure if this is entirely correct so please verify. The problem with the original patch is that it assumed a network type that would have vlan tagging and if ran in a flat network, all ports would have a forced resync on each iteration of the RPC loop.

A valid test for this is to remove the vlan tag from an existing port.

ovs-vsctl show
ovs-vsctl remove Port tag 1

Where port name starts with "qg-", "qr-" or "tap". The port should be picked up and re-synced with the current vlan tag reappearing.

__Commit__

- Initial refactoring of a patch authored by AT&T
- Moved get_port_tag_dict to ovs_lib.py which seemed more appropriate.
- Now only examining a port to look for a tag on specific types of tenant networks.
- Added tenant_network_type to the initialization of OVSNeutronAgent
- Now checking for specific tenant network types before looking for vlan tags.
- Now setting self.tenant_network_type from the OVS config.
- Adjusted unit test.
- Adjusted log message when port in forced to resync.
- Clean up test values.
- Removed incorrect spacing.

Closes-rally-bug: DE734