In sync_routers L3-RPC method l3-agent sends router_ids but the
server side expected router_id. This commit fixes the server side
to accept router_ids, and drops "fullsync" arg from the agent side
(fullsync is not used anywhere and it does not affect RPC signature).
This change allows l3-agent to sync only the specified routers
instead of all routers.
As a result of the above change, auto_schedule_routers() and
list_active_sync_routers_on_active_l3_agent() in L3 scheduler
needs to handle a list of router IDs. This commit changes L3 scheduler
to accept a list of router IDs in the above two methods.
Also fixes the argument order of fullsync and router_ids in get_routers
in L3PluginApi. L3-agent main code expects router_ids as the second arg.
This commit adds unit tests for packet-filter in NEC Plugin.
This commit refactors packet-filter in NEC Plugin.
- Put packet-filter classes and methods into nec/packet_filter.py (a) and
nec/db/packetfilter.py (b), NEC Plugin specific codes are in (a)
- Change stateless methods to class methods in extenstions/packetfilter.py
- Add 'convert_to' option to the attribute map of packet-filter to convert
some string parameter to int at the api layer
Also, this commit includes the following changes in packet-filter.
- Fix attribute map of packet-filter; set in_port to allow_put=False
- Add new methods to update attribute map properly
- Make packet-filters ignore status of associated resource (network)
Enable policy control over external_gateway_info sub-attributes
Part 2 of blueprint l3-ext-gw-modes
This patch extends the logic for building policy rule matches in order to
include sub-attributes as well. This logic will be leveraged by the
ext-gw-mode api extension.
This patch add the type_driver GRE to enable the creation of GRE
tunnels with the OVS agent.
No Endpoints ID are managed. Only Endpoint IP are stored in DB,
and this IP is proposed as an endpoint ID for the OVS agent.
It also fixes the bug 1201471.
Introduce a looping call for performing synchronization with
neutron server.
The sync will be performed only if router changes are notified
via rpc. Only affected routers will be synchronized.
Changes will be implemented by the l3 agent spawning a
distinct greenthread for each router - iptables will
be executed only once using iptables_manager.defer_apply_on.
This patch will prevent the occurence of the following issues:
- Out-of-order rpc message processing
- Long processing time for router changes due to serial execution
- Occasional and expected RPC blocks for long periods
- Unnecessary processing of multiple requests
Fix random OverflowError exceptions in gate-neutron-python26 tests
These errors seem to be linked to the NEC plugin and http connections
not being stubbed out correctly. This patch ensures do_request is
stubbed out prior to the tests execution; this should be enough
to prevent timeouts from occurring again. Stubbing out the call has
no effect on the coverage of the agent scheduler tests for the NEC
plugin.
Kevin Benton [Wed, 10 Jul 2013 23:28:12 +0000 (16:28 -0700)]
Prevent possible server list damage in BigSwitch plugin
The old failover logic for the BigSwitch plugin modified a
list of controllers as it tested them. If the code for one
thread unexpectedly raised an exception or died, the global
server list could lose a server permanently.
This patch addresses that by flagging servers as failed instead
so the global server list is never modified.
Kyle Mestery [Fri, 14 Jun 2013 14:25:08 +0000 (14:25 +0000)]
Modify the OVS agent to support multiple tunnel_types concurrently.
This change modifies the "tunnel_type" configuration option to be a ListOpt
instead of a StrOpt. This is intended to allow the agent to work in an ML2
environment where multiple, disparate "tunnel_types" are supported at the
same time. For now, the agent will enforce a single "tunnel_type".
This commit refactors the base class of unit tests for NEC Plugin to
make writing new tests easier.
Add fake OFC Manager and change unit tests which use OFC Manager mock
to using this fake. With this fake, we don't need to set return_value
and side_effect to the mock instance of OFC Manager in each test case.
This fake keeps all resources on OFC, and returns existence of
resources properly. This fake is attached to OFC Manager mock instance
by setting all side_effects. We can also set it to raise an exception.
Make NEC Plugin configurable in each test case. Now we can configure
NEC Plugin by setting string in class value "_nec_ini" which will be
written into a temporal file and loaded by NEC plugin.
Move setup for callbacks into NecPluginV2TestCase() so that other unit
tests can use callbacks.
Kevin Benton [Wed, 10 Jul 2013 23:49:31 +0000 (16:49 -0700)]
Add option to ignore backend HTTP error in BigSwitch plugin
This patch fixes the way the BigSwitch plugin ignores 404
errors from the backend controller by allowing HTTP codes
to be selectively ignored on REST calls. This prevents
unnecessary exception handling and failover logic in calls
where 404 codes are acceptable.
Firstly, we update the oslo.config dep to 1.2.0a3 because of the issue
with namespace packages (bug #1194742).
But the main issue here is that if you currently do:
$> pip install -r quantum/requirements.txt
then you end up with the oslo.config 1.1.1 code installed. This is
because oslo.config>=1.1.0 gets pulled in as a transitive dep and pip
gets confused. You can reproduce with e.g.
This is because of a bug with pip where it sees oslo.config-1.2.0a3 and
oslo.config as two unrelated things. It should strip the version part of
the egg= fragment before using it as a package name, but it doesn't.
However, we can simply use the -f/--find-links pip option in our
requirements.txt to add the tarball URL to the list of URLs considered
and also add the oslo.config>=1.2.0a3 dependency:
This is actually exactly the semantics we want and we go to great
lengths in pbr to get these semantics while using a single tarball URL.
The only downside to this --find-links strategy is that we gain an extra
line in our requirements.txt ... but it does work around the pip bug.
Carl Baldwin [Thu, 11 Jul 2013 18:17:40 +0000 (18:17 +0000)]
Quiet down a large log file heavy hitter.
This line of code serialized the python structure for the device and throws it
at the log file. The string is about 90K characters, isn't very useful and we
found that it takes a very large amount of space in the log file causing them
to grow very quickly and fill our log disk. This change extracts the device
name (e.g. "tapcdc07af9-8a") and uses that in the log message.
Dirk Mueller [Mon, 24 Jun 2013 18:56:32 +0000 (20:56 +0200)]
Be compatible with oslo.config 1.2.0a3+
The private API of oslo.config changed, and the Cisco
options parsing code was using it.
Use an explicit MultiConfigParser instance for parsing
the config files.
Define the Mechanism Driver interface for create/update/delete
operations on networks and ports. For each of these event, the
Mechanism Driver provides one method that is called within the
database transaction of the ml2 plugin method, and one that is called
after the transaction is completed.
Support for mechanism drivers is still a work-in-progress, and the
interface is subject to change in future versions before the release
of Havana. However this initial version should be sufficient to enable
others to start defining their own mechanism drivers.
Previously neutron would raise a 500 error if the dscp value was greater
than 63. This patch adds validation to neutron so that a clear error
message is returned if the value is greater than 63.
When we run "tox -e cover" to generate coverage report, testr will make
"cover" directory which contains the same html in "covhtml" made by
"./run_test.sh --coverage". So, make git ignore this directory.
Aaron Rosen [Sun, 12 May 2013 21:53:18 +0000 (14:53 -0700)]
Improve DHCP agent performance
Previously when starting the dhcp agent the sync_state() process would
be extremely expensive as it would query quantum server for each network.
In order to improve performance a get_active_networks_info() was added
so this information could be retrieved in one query rather than doing a
query for each active network.
The second part of this patch optimizes the logic to avoid calling
get_dhcp_port(). Previously, this method was called once for each network
which makes a call to get_subnets() and get_ports() unnecessarily as
the dhcp agent can determine itself if it needs to update a port or create a
port for dhcp.
This patch also threads the inital sync process and maintains backwards
compatibility with the previous rpc api.
There was also a trivial change to the nvp_plugin where filters are assumed to
be a dict.
Allow gateway address to be unset for an existing subnet
Validation of the gateway IP address was taken place even
if the gateway IP was set to None; this was causing an
AddrFormatError exception to be raised by method
'_validate_gw_out_of_pools'. With this change we skip
the validation in case the gateway is set to None.
Jason Dillaman [Tue, 9 Jul 2013 14:22:05 +0000 (10:22 -0400)]
Ensure that the neutron server is properly monkey patched
The legacy 'quantum-server' script will apply the eventlet
monkey patch whereas the new 'neutron-server' entry point
does not. This prevents the server from properly handling
the REST interface.
Bob Melander [Fri, 5 Jul 2013 13:53:49 +0000 (15:53 +0200)]
Allow router route update in XML.
Fixes: bug 1198188
Router updates of routes in XML format fails.
This patch fixes that problem. It also executes
unit tests for XML-based requests to update
router routes.
Brian Haley [Thu, 14 Mar 2013 14:35:49 +0000 (10:35 -0400)]
Preserve packet:byte counts in iptables_manager.
Ported the nova iptables manager code to neutron, so that we
use iptables-save/restore with the -c flag to save/restore
the chains and rules with their packet:byte counts. All other
changes were ported as well to keep the code as similar as
possible between the two, although they will be different as
I had to fix other bugs found during testing.
Updated tests accordingly to account for new calls and
input/output changes in formatting.
Changed iptables_firewall code to add iptables rules in the same
order that iptables-save will print them: source/dest, protocol,
sport, dport, target; else iptables_manager won't be able
to find them to preserve their [packet:byte] counts.
Tweaked other rules accordingly as necessary.
Fixed a bug introduced in an earlier version of this patch where
_modify_rules() sometimes wouldn't match an existing rule correctly
if not top=true.