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
Zhongyue Luo [Fri, 6 Sep 2013 08:00:59 +0000 (16:00 +0800)]
Utilize assertIsInstance
Using assertTrue and the 'isinstance' function to test
if an object is in an instance of some class is too python2.4.
Our unit testing framework supports assertIsInstance which was created
for these types of tests. Let's use assertIsInstance for these tests.
Zhongyue Luo [Fri, 6 Sep 2013 07:18:49 +0000 (15:18 +0800)]
Utilizes assertIsNone and assertIsNotNone
Using assertTrue and the 'is' operator to test if an element is None
is too python2.4. Our unit testing framework supports
assertIsNone and assertIsNotNone which were created
for these types of tests.
Ben Nemec [Tue, 1 Oct 2013 23:15:23 +0000 (23:15 +0000)]
Disable lazy translation
Late in the Havana cycle bug 1225099 was found in the lazy
translation code, and to be safe it was decided to disable lazy
translation for Havana. This change does that.
Cisco plugin should check for switch - vlan bindings
This commit fixes the issue where the Cisco plugin tries to create a
vlan twice on a switch if the first create is not bound to a port.
Also fixes an issue where the plugin tried to untrunk vlans from
a port for SVI interfaces.
Should not add metadata filter rules if disable metadata proxy
The metadata filter rules should not be added into iptables if Neutron
metadata proxy is disabled.
This patchset fixes this issue by adding a condition when adding metadata
filter rules to iptables.
Bob Kukura [Fri, 27 Sep 2013 21:54:45 +0000 (17:54 -0400)]
Fix auto-deletion of ports and subnets in ML2
When a network is deleted, certain ports and any subnets referencing
it are auto-deleted. The implementation of
NeutronDBPluginV2.delete_network() does this at the DB level, so ML2's
mechanism drivers were not being called.
Ml2Plugin.delete_network() is changed to not use the base class's
method, and to auto-delete ports and subnets by calling its own
delete_port() and delete_subnet() methods outside of the
transaction. A loop avoids race conditions with ports or subnets being
asynchronously added to the network.
In Havana, NVP configuration was simplified;
in the process a few options that existed
in Grizzly or older were deprecated. This
change removes those options from the Icehouse
tree.
Fix to enable delete of firewall in PENDING_CREATE state
Firewall will in PENDING_CREATE state if there is no underlying router in the
tenant. When the router and an associated i/f is created then with a sequence
of msgs it is set to ACTIVE state by the plugin. If a delete is triggered when
in PENDING_CREATE state in such a situation, the msg was ignored - fixing this to
account for the fact that a delete makes sense in this situation so the agent
sends the appropriate msg back to the plugin so it can delete it.