neutron/neutron/plugins/linuxbridge
Andreas Scheuring a8b300ac6d lb: avoid doing nova VIF work plumbing tap to qbr
neutron should rely on nova doing the job instead of trying to 'fix' it.
'Fixing' it introduces race conditions between lb agent and nova VIF
driver. Particularly, lb agent can scan for new tap devices in the
middle of nova plumbing qbr-tap setup, and attempt to do it on its own.
So if agent is more lucky to plug the tap device into the bridge, nova
may fail to do the same, getting the following error:

libvirtError: Unable to add bridge brqxxx-xx port tapxxx-xx: Device or
resource busy

This also requires a change in how the port admin_state_up is implemented
by setting the tap device's link state instead of moving it in or out
of the bridge.

Conflicts:
	neutron/common/constants.py
	neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py
	neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py

Co-Authored-By: Sean M. Collins <sean@coreitpro.com>
Co-Authored-By: Darragh O'Reilly <darragh.oreilly@hp.com>
Co-Authored-By: Andreas Scheuring <andreas.scheuring@de.ibm.com>
Closes-Bug: #1312016
(cherry picked from commit f42ea67995)
(cherry picked from commit eb61b837f7)

===

Also squashed the following follow up fix:

lb: Correct String formatting to get rid of logged ValueError

The following error is caused by a missing String formatting in the
linuxbridge agent:
"ValueError: unsupported format character 'a' (0x61) at index 90
Logged from file linuxbridge_neutron_agent.py, line 447"

In addition a duplicated word in the log text has been fixed.

Change-Id: I587f1165fc7084dc9c4806149b65652f6e27b14e
(cherry picked from commit 1f86d8687b)

===

Also squashed in:

Only ensure admin state on ports that exist

The linux bridge agent was calling ensure_port_admin state
unconditionally on ports in treat_devices_added_or_updated.
This would cause it to throw an error on interfaces that
didn't exist so it would restart the entire processing loop.

If another port was being updated in the same loop before this
one, that port would experience a port status life-cycle of
DOWN->BUILD->ACTIVE->BUILD->ACTIVE
                   ^ <--- Exception in unrelated port causes cycle
                          to start over again.

This causes the bug below because the first active transition will
cause Nova to boot the VM. At this point tempest tests expect the
ports that belong to the VM to be in the ACTIVE state so it filters
Neutron port list calls with "status=ACTIVE". Therefore tempest would
not get any ports back and assume there was some kind of error with
the port and bail.

This patch just makes sure the admin state call is skipped if the port
doesn't exist and it includes a basic unit test to prevent a regression.

Conflicts:
	neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py

Closes-Bug: #1523638
Change-Id: I5330c6111cbb20bf45aec9ade7e30d34e8dd16ca
(cherry picked from commit 96c67e22f9)

Change-Id: I02971103407b4ec11a65218e9ef7e2708915d938
2016-03-24 21:25:34 +00:00
..
agent lb: avoid doing nova VIF work plumbing tap to qbr 2016-03-24 21:25:34 +00:00
common Add ARP spoofing protection for LinuxBridge agent 2015-09-03 10:39:47 -07:00
db Empty files should not contain copyright or license 2014-10-20 00:50:32 +00:00
README remove linuxbridge plugin 2014-10-01 18:08:25 +00:00
__init__.py Rename Quantum to Neutron 2013-07-06 15:02:43 -04:00

README

# -- Background

The Neutron Linux Bridge plugin has removed from the tree in Juno.  You must 
migrate to ML2 using the script in: neutron/db/migration/migrate_to_ml2.py

# -- Agent configuration

- Edit the configuration file:
  etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini

- Copy neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
  and etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini
  to the compute node.

- Copy the neutron.conf file to the compute node

  Note: debug and logging information should be updated in etc/neutron.conf

- On each compute node, the network_interface_mappings must be
  configured in linuxbridge_conf.ini to map each physical network name
  to the physical interface connecting the node to that physical
  network. Entries are of the form
  "<physical_network>:<physical_interface>". For example, one compute
  node may use the following physical_inteface_mappings entries:

  [LINUX_BRIDGE]
  physical_interface_mappings = physnet1:eth1,physnet2:eth2,physnet3:eth3

  while another might use:

  [LINUX_BRIDGE]
  physical_interface_mappings = physnet1:em3,physnet2:em2,physnet3:em1


$ Run the following:
  python linuxbridge_neutron_agent.py --config-file neutron.conf
                                      --config-file linuxbridge_conf.ini

  Note that the the user running the agent must have sudo priviliges
  to run various networking commands. Also, the agent can be
  configured to use neutron-rootwrap, limiting what commands it can
  run via sudo. See http://wiki.openstack.org/Packager/Rootwrap for
  details on rootwrap.

  As an alternative to coping the agent python file, if neutron is
  installed on the compute node, the agent can be run as
  bin/neutron-linuxbridge-agent.