Akihiro Motoki [Tue, 19 Aug 2014 12:16:19 +0000 (21:16 +0900)]
Make DvrServerRpcCallback a separate callback class
RPC has a version of itself. In Neutron a plugin implements
several RPC interface, so a single RPC version doesn't work.
In Mixin callback class approach, RPC versioning depends on
each plugin implementation and it makes harder to maintain
RPC version appropriately. This patch series replaces mixin
RPC callback of server side with a separate class.
This commit handles server-side callback of DVR ML2 RPC interface.
Akihiro Motoki [Mon, 18 Aug 2014 19:14:31 +0000 (04:14 +0900)]
Make DhcpRpcCallback a separate callback class
RPC has a version of itself. In Neutron a plugin implements
several RPC interface, so a single RPC version doesn't work.
In Mixin callback class approach, RPC versioning depends on
each plugin implementation and it makes harder to maintain
RPC version appropriately. This patch series replaces mixin
RPC callback of server side with a separate class.
This commit handles server-side callback of dhcp-agent RPC interface.
DHCP-agent server-side callback class is moved from db/ to
api/rpc/handlers because it doesn't involve any db operations
and defining all RPC interfaces in a single place sounds reasonable.
Note that moving other DHCP-agent related RPC interface class
to api/rpc/handlers can be done in a separate patch as this patch
focuses on reorganizing the server-side RPC callback class.
Maru Newby [Thu, 28 Aug 2014 09:17:45 +0000 (11:17 +0200)]
Use lockutils module for tox functional env
A previous change (I4d6076e5f7586a11ea5381f18774d4bab57b0081) added
lockutils to only the dsvm-functional tox env. It also needs to be
added to the functional tox env.
Do not use auto_schedule_routers to add router to agent
auto_schedule_routers makes a number of DB calls that are
unnecessary as they are already made during the validation
phase of add_router_to_l3_agent. Once the validation is
done, the only business left is to create the binding: this
is what this patch does.
Maru Newby [Wed, 27 Aug 2014 15:33:29 +0000 (17:33 +0200)]
Fix func job hook script permission problems
- The hook script is the wrong place to unstack since
it needs to run as the stack user with sudo privileges and those
permissions are removed as part of the devstack-vm-gate.sh script.
- The functional job gate hook script needs to use sudo to
install the test-only rootwrap filter.
Eugene Nikanorov [Tue, 19 Aug 2014 19:01:11 +0000 (23:01 +0400)]
Fix l3 agent scheduling logic to avoid unwanted failures
In case router is being added to l3 agent which is already hosting
the router it is fine to let such a request to succeed.
This patch also adds a check for unnecessary scheduling that might happen
twice in described case and lead to unwanted messages in the logs.
This was discussed in review [1], and was deferred until the time was ripe
for the appropriate fix. As suggested and reported, auto_schedule_routers
is too affected by this error.
This patch takes care of the issue, in a similar way.
Akihiro Motoki [Mon, 18 Aug 2014 18:49:30 +0000 (03:49 +0900)]
Make L3RpcCallback a separate callback class
RPC has a version of itself. In Neutron a plugin implements
several RPC interface, so a single RPC version doesn't work.
In Mixin callback class approach, RPC versioning depends on
each plugin implementation and it makes harder to maintain
RPC version appropriately. This patch series replaces mixin
RPC callback of server side with a separate class.
This commit handles server-side callback of L3-agent RPC interface.
L3-agent server-side callback class is moved from db/ to
api/rpc/handlers because it doesn't involve any db operations
and defining all RPC interfaces in a single place sounds reasonable.
Note that moving other L3-agent related RPC interface class
to api/rpc/handlers will be done in a separate patch as this patch
focuses on reorganizing the server-side RPC callback class.
This method is more complicated than it needs
to be, and it makes it difficult to target
fixes for it.
Furthermore, this method calls into
auto_schedule_routers, which duplicates some
of the DB calls already made in the above
mentioned method. This refactoring
is done in preparation of the performance
improvement.
Henry Gessau [Sun, 27 Jul 2014 02:05:02 +0000 (22:05 -0400)]
Predictable iptables chains output order
This fixes the iptables unit tests that break with a randomized PYTHONHASHSEED
(see the bug report).
The chains for iptables are stored as sets to avoid duplicates. When they are
output by iptables_manager their order can therefore be unpredictable. This was
found hash seed 1016732220.
To fix this we:
- Sort the chains output by iptables_manager
- Update the unit tests to check for sorted chains
When multiple tables are processed, they can be processed in any order or
dumped in any order. Found with hash seed 3728666619.
To fix this we:
- Traverse the tables in sorted order for dumping
- Fix tests to allow for tables to be processed in any order
Note: There are several other unrelated unit tests that also break with a
randomized PYTHONHASHSEED, but they are not addressed here. They will be
addressed in separate patches.
This patch fixes a small glitch in the healing script.
If the script detects that a foreign key must be removed,
and the columns that it references must be removed as well,
then the foreign key removal would fail as the column would
not exist anymore.
This patch simply ensures foreign key are dropped before all
the remaining table/column operations. New foreign keys are
instead added after all table/column operations are completed.
Currently, DVR router namespaces are created only
when there is a valid VM port on the compute
node, or for the gateway-port on the service node.
But when an LBaaS VIP port is created the l3 agent
does not create a DVR namespace to service the VIP port.
This fix enables DVR namespaces to be created to
service the LBaaS VIP port.
Also, this fix enables L2 Agent running in DVR
mode, to add-in OVS rules to enable packets to
be routed to such LBaaS VIP Ports which are
resident on DVR routed interfaces.
Therefore, with this fix both East-West and
North-South traffic will be serviced by DVR
for LBaas VIP Ports.
Michael Smith [Mon, 25 Aug 2014 17:33:40 +0000 (10:33 -0700)]
ext-gw update on dvr router improperly handled by l3-agent
The recently added external_gateway method does not check
the agent mode or host binding before adding an external
gateway to a particular node/agent. This fix adds the
required checks in the update path.
Fix for floatingip-delete not removing fip_gw port
fip_agent_gateway_port is created dynamically on a
compute node where FIP namespace is created. When
floatingip-disassociate is called this 'port' is
deleted.
But when we call floatingip-delete this port is
not deleted.
Saksham Varma [Thu, 14 Aug 2014 21:39:20 +0000 (14:39 -0700)]
Increase the default poll duration for Cisco n1kv
Increase the poll duration for Cisco N1Kv, from 10s to 60s and also
clean up the /etc/neutron/plugins/cisco/cisco_plugins.ini file. The
current poll duration of 10s causes that VSM to unnecessarily taking
frequent CPU cycles, resulting in the failure of other tasks in scale
configurations.
The current timeout fails during functional testing with
slightly higher load. Increasing it will lower the timeout
chances during high load conditions. Changed from 5 seconds
to respawn_interval/2. DEFAULT_OVSDBMON_RESPAWN = 30 , so
the default timeout will be 15 seconds.
Jakub Libosvar [Tue, 22 Jul 2014 08:45:52 +0000 (10:45 +0200)]
Change autogenerate to be unconditional
Template for generating db migration scripts are now not run according
to used plugins. Target environment is set to use all available models
but also used plugins are kept for backward compatibility.
Part of this patch is script that will drop unused tables to avoid
generating the drop in future migration scripts.
Set firewall state to CREATED when dealing with DVR
When DVR is enabled as a default option for creating routers, firewall
resources will need to have a new initial state, so that reconciliation
can be done once all L3 agents have processed the firewall rules.
The new state has been introduced to preserve API bw compatibility
with centralized routers.
Chirag Shahani [Fri, 8 Aug 2014 02:04:34 +0000 (19:04 -0700)]
Add template attr. for subnet, router create in Nuage plugin
subnet create and router create commands now gives the ability
to the user to create subnets and routers via neutron cli with
additional attributes nuage_subnet_template and nuage_router_template
respectively. The instantiated subnet and router inherits the properties
of the template that was mentioned in the additional parameters.
Assaf Muller [Tue, 5 Aug 2014 20:12:55 +0000 (23:12 +0300)]
Implement ip_lib.device_exists_with_ip_mac
ip_lib.device_exists simply checks that a device is in an
(optional) namespace. This patch adds
ip_lib.device_exists_with_ip_mac, which also verifies that
the device is configured with the given IP and MAC addresses.
The new function is used in functional tests in a patch
further down the dependency chain.
Added functional tests for ip_lib.device_exists,
ip_lib.device_exists_with_ip_mac.
Maru Newby [Tue, 25 Mar 2014 10:54:04 +0000 (03:54 -0700)]
Refactor plugin setup helpers out of test.base
Helper methods for plugin and notification setup were previously
defined on neutron.tests.base.BaseTestCase. The imports required to
support these helpers were preventing the api tests from consuming
tempest due to configuration conflicts that resulted between neutron
and tempest. This change moves the helpers to a new module in
tests/unit so that BaseTestCase can be safely used across all types of
tests.
Eugene Nikanorov [Fri, 22 Aug 2014 12:29:49 +0000 (16:29 +0400)]
Raise proper exception in case duplicate ipv6 address is allocated
In case neutron tries to generate ipv6 address for slaac subnet,
it doesn't check that generated ip is unique and throws DB exception
that results in 500 HTTP error.
Setting the mysql_engine when creating a table is not needed
anymore as this is automatically done by an event listener
added with commit 466e89970f11918a809aafe8a048d138d4664299
Evgeny Fedoruk [Tue, 12 Aug 2014 11:13:24 +0000 (04:13 -0700)]
Removing sorted() function from assertEqual()
Removing unnecessary sorted() function from assertEqual() function
calls in functions used for sorting and pagination testing
Using sorted() breaks sorting tests objective which is to test sorting.
This is causing every unit test using this functions
(_test_list_with_sort, _test_list_with_pagination, _test_list_with_pagination_reverse)
for sorting tests to always succeed
Switched the parameters for assertEqual() function within the fixed code to meet
its signature - assertEqual(self, expected, observed, message='')
Test neutron.tests.unit.vmware.vshield.test_lbaas_plugin.TestLoadbalancerPlugin.test_list_vips
was succeeding because of this bug, although it should fail. It failed after the bug was fix.
Test was fixed.
Maru Newby [Sat, 23 Aug 2014 06:21:07 +0000 (23:21 -0700)]
Add hook scripts for the functional infra job
Infra jobs support hooks to customize behavior. This change adds
scripts that are intended to be called by the neutron-dsvm-functional
jobs as hooks. Defining hook behavior in-tree instead of directly in
the job definition has the advantage of allowing changes in hook
behavior to be tested before merge.
The gate_hook.sh script added by this change installs a rootwrap
filter to allow functional tests to destroy python processes that
they have spawned. The tests use the python executable provided by
their tox env, and the default rootwrap configuration does not
support killing processes launched by non-system python executables.
This change will have to merge to master and stable/icehouse before
the supporting infra config change can be merged: