Baodong Li [Tue, 8 Oct 2013 15:19:32 +0000 (15:19 +0000)]
Detect and process live-migration in Cisco plugin
With Cisco/Nexus plugin, migration is not fully supported. Logic to detect
port binding change needs to be added in update_port(), and provisioning of
nexus switch(es) should be done accordingly
added test code for update_port() in the model layer and the db layer
Brian Haley [Fri, 27 Sep 2013 14:57:40 +0000 (10:57 -0400)]
Spawn arping in thread to speed-up floating IP
Change _send_gratuitous_arp_packet() to spawn a thread to call
arping after a floating IP is assigned. This way it doesn't
stall _process_routers() from returning quickly due to calling
pool.waitall().
The code currently raises when it's not able to find the port to be
deleted on the backend. This might happen, for instance, when the
port is manually removed or, in some cases, if port creation failed
in the first place.
There's little sense in raising when a resource to be removed is not
found; therefore this patch replaces the raise statement with a log
statement.
When recycling an IP, allocation pools are loaded with an inner
join with ip avaiblity ranges. However, if the pool is exhausted,
there will be no availability ranges and the query will return
no results because of the inner join. It will therefore be
impossible to reuse IP addresses once the pool has been exhausted.
This patch tries to reload allocation pools without joining on
IP avaiability ranges if the first query did not return any result.
Replacing an inner join with an outer join will not be possible
as postgresql backend does not support 'SELECT ... FOR UPDATE' with
outer joins (for more info see bug 1215350).
The patch also contains unit tests for verifying IP are recycled
correctly even when the pool is exhausted.
Joe Gordon [Tue, 15 Oct 2013 01:46:14 +0000 (18:46 -0700)]
Set wsgi logger to use __name__
Although underneath this is the eventlet.wsgi.server server, Other
OpenStack projects, don't use that logger instead they use there own.
This will also mean the wsgi server will stop logging on just the
warning level. We want wsgi server to at least log on info level
so it will log when a request is processed and what the return code is.
The SystemExit exception should be logged in dhcp-agent, the
operator may miss the useful exception messages to debug.
* Add error log for SystemExit in dhcp-agent.
* Add addCleanup(mock.patch.stopall) in setup()
* Remove teardown()
* Add unit test for None and nonexistent interface_driver.
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.
mathieu-rohon [Wed, 9 Oct 2013 09:13:04 +0000 (11:13 +0200)]
use proxy mode on vxlan interface only when l2-population is activated
the proxy mode was set by default on every vxlan interfaces
which leads to inaccessibility between VM that are not hosted
on the same host in a vxlan network
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.