Jakub Libosvar [Thu, 3 Oct 2013 17:45:09 +0000 (19:45 +0200)]
Removing rpc communication from db transaction
In a transaction context of ExtraRoute_db_mixin.update_router() was
called super method that uses subtransaction and communication with l3
agent. In case of agent's heartbeat happens while there is running
transaction, update heartbeat in agents table gets stuck in a deadlock.
Joe Mills [Thu, 3 Oct 2013 16:55:18 +0000 (01:55 +0900)]
Add port bindings to ports created in Midonet
Currently Midokura uses its own script (mm-ctl) to bind ports. However, support
for using this script is left out of the nova and neutron projects. This causes
confusion and makes deployments unnecessarily complicated for customers using
Havana. This fix is to change Neutron to properly set up port bindings to use
the "midonet" vif driver when creating a port. Corresponding changes will be
submitted to the devstack and Nova projects.
zhhuabj [Sat, 12 Oct 2013 09:31:38 +0000 (17:31 +0800)]
Updating address pairs with xml doesn't work
Below command can't work because list element
"allowed_address_pairs" hasn't been updated
into the varaiable "attr.PLURALS"
"neutron port-update <port-uuid> \
--allowed-address-pairs list=true type=dict \
ip_address=10.0.0.1 --request-format xml"
This change adds the ability to monitor the local ovsdb for
interface changes so that the l2 agent can avoid unnecessary
polling. Minimal changes are made to the agent so the risk
of breakage should be low. Future efforts to make the agent
entirely event-based may be able to use OvsdbMonitor as a
starting point.
By default polling minimization is not done, and can only be
enabled by setting 'minimize_polling = True' in the ovs
section of the l2 agent's config file.
Avoid suppressing underlying error when deploy.loadapp fails
Raise log level at the first load attempt. If there is a
fundamental problem with the environment, a Lookup error
is not helpful in troubleshooting the problem further.
Interacting with a long-running asynchronous process requires the
use of non-blocking io. This change adds a helper class that can
launch a long-running process and read stdout and stderr in a
non-blocking fashion via eventlet.
This functionality is intended to support monitoring ovsdb via
a long-running and root-privileged invocation of ovsdb-client.
The complexity of the system interaction in this patch suggested
the addition of a functional test that validated actual behaviour.
The test was added under the neutron/tests/functional path which
is now included in the testr search path.
This fix adds a "nexus_l3_enable" configuration boolean for the
Cisco Nexus plugin. When this config boolean is set to False (default),
then the Nexus switches are only used for L2 switching/segmentation, and
layer 3 functionality is deferred to the OVS subplugin / network
control node. If this config boolean is set to True, layer 3
functionality, e.g. switch virtual interfaces, are supported on
the Nexus switches. (Note that layer 3 functionality is not supported
on all versions/models Nexus switches.)
Some other things addressed with this fix:
- The l3_port_check keyword argument which is optionally passed to the
Cisco plugin's delete_port method was not being forwarded on to the
OVS (sub) plugin. This keyword argument needs to be forwarded to OVS
e.g. when the delete_port is being done in the context of a
router interface delete (whereby l3_port_check==False).
- UT test cases are added for new "nexus_l3_enable" config, which
exercise router interface add/delete.
- The Cisco test_network_plugin.py module is refactored/reorganized
in order to cleanly add a new router interface test class.
- The test_model_update_port_rollback test case was yielding a false
positive result (device_owner was not being passed to self.port).
Nachi Ueno [Fri, 11 Oct 2013 18:46:32 +0000 (11:46 -0700)]
Use L3 api from vpn ipsec driver via service plugin
VPNaaS and ML2 plugin won't work, because ML2 plugin
supports service version of L3.
In this commit, we modify ipsec driver to use L3 plugin.
This is also backward compatible change, because if L2 plugin
supports L3 get_service_plugin API returns L2 plugin.
ML2 plugin changes the port status to "build" when get_device_details
is called. For this reason, the port status must be updated once the
port details are processed.
Bob Kukura [Thu, 3 Oct 2013 16:25:24 +0000 (12:25 -0400)]
Fix auto-deletion of ports when deleting subnets in ML2
When a subnet is deleted, certain ports referencing it are
auto-deleted. The implementation of NeutronDBPluginV2.delete_subnet()
does this at the DB level, so ML2's mechanism drivers were not being
called.
Ml2Plugin.delete_subnet() is changed to not use the base class's
method, and to auto-delete ports by calling its own delete_port()
method outside of the transaction. A loop avoids race conditions with
ports being asynchronously added to the subnet.
The logic in Ml2Plugin.delete_network() is also fixed to properly
handle auto-deleting ports and subnets, and debug logging is added to
the various delete methods.
Kevin Benton [Wed, 9 Oct 2013 06:02:20 +0000 (23:02 -0700)]
BigSwitch: correct net to backend on floating IP disassociation
The corrects the network that is updated on the backendw when a
floating IP is disassociated. It was incorrectly sending the
tenant's network when the update is to the external network the
floating address belongs to.
Akihiro MOTOKI [Wed, 9 Oct 2013 10:50:35 +0000 (19:50 +0900)]
Fallback to Quota Conf Driver if Quotas table is not defined
commit de15e0b9c5 enabled Quota DB driver default considering
production environments, but it breaks plugins without per-tenant
quota extension. In these plugin quotas tables is not loaded.
This commit fallbacks to ConfDriver if Quota model is not loaded by
checking neutron.db.quota_db which defines Quota model is imported.
Zhongyue Luo [Wed, 25 Sep 2013 02:24:32 +0000 (10:24 +0800)]
Utilizes assertIn
Using assertTrue and the 'in' operator to test
if an element is in a sequence is too python2.4.
Our unit testing framework supports assertIn
which was created for these types of tests.
Zhongyue Luo [Fri, 6 Sep 2013 07:29:38 +0000 (15:29 +0800)]
Utilizes assertNotIn
Using assertTrue and the 'not in' operator to test
if an element is in a sequence is too python2.4.
Our unit testing framework supports assertNotIn
which was created for these types of tests.
Aaron Rosen [Tue, 8 Oct 2013 19:24:21 +0000 (12:24 -0700)]
Fix dhcp_release lease race condition
There is a possible race condition when delete or updating fixed_ips
on ports where an instance could renew its ip address again after
dhcp_release has already been executed. To fix this, the order of
reload_allocation and release_lease need to be switched. This way an
instance will not be able to renew it's ip address after it is
removed from the host file.
This patch adopts several measures to prevent _sync_routers_task
and _rpc_loop from hanging because of subprocess.Popen.communicate
not returning.
1) Perform a sleep everytime a command is completed, similarly to
what is done in openstack.common.processutils.execute
2) Disable by default GARP, as kernel crashes caused by arping
have been observed
3) Prevent a non-critical keyerror in _router_removed from triggering
again a full sync, which might put the system under significant load.
This patch also adds debug log statements aimed at improving the
ability of debugging similar failures.
Dave Cahill [Fri, 27 Sep 2013 10:44:00 +0000 (10:44 +0000)]
Disassociate floating IPs from port on terminate
Bugfix - floating IPs were left associated after VM
was terminated. Now call disassociate_floatingips
within delete_port as in other networking plugins.
Add L3NatDBIntTestCase suite to cover the
floating IP disassociation case, and fix all failing
tests from that suite.
Quota driver is now loaded in lazy mode, i.e. the driver is loaded
the first time the driver is accessed. This is to make unit tests
work. Some unit tests like extension test cases need to use Config
Quota driver (previous default) but QuotaEngine is initialized
when quota.py is imported. Thus the unit tests had no chance to
specify quota_driver.
Bob Kukura [Fri, 4 Oct 2013 20:17:37 +0000 (16:17 -0400)]
Change rpc_support_old_agents default to False
Changes the rpc_support_old_agents config variable default value to
False, so that the vlan_id field (redundant with the segmentation_id
field) is no longer included in RPC messages from the linuxbridge and
mlnx plugins to their corresponding L2 agents. This can be set to True
if needed to support L2 agents older than midway through the havana
cycle.
Add a route to reach the MD server when a subnet is created
When the first subnet is created, the dhcp port is created and
midonet plugin correctly adds the static route to reach the MD
server in create_port. When a second or following subnets are
created, a new ip is added to the dhcp port. This patch takes
care of adding the static route to correcly reach the MD server
in update_port. This fixes the problem of VMs not being able to
reach the MD if assigned to the second subnet