Kevin Benton [Wed, 17 Sep 2014 03:36:42 +0000 (20:36 -0700)]
Set floating IP port status to "N/A"
The status of the port associated with a floating IP
would always show as DOWN. This caused confusion to
operators that weren't aware that this is expected behavior
since the port is only used for an IP allocation.
This commit sets the port status to "N/A" to reflect the fact
that the port associated with a floating IP has no operational
status.
Maru Newby [Fri, 27 Mar 2015 17:39:41 +0000 (17:39 +0000)]
Remove neutron.tests.sub_base
Change Ifca5615680217818b8c5e8fc2dee5d089fbd9532 was intended to
remove the neutron.tests.sub_base module, but a bad rebase means that
it was left in the tree.
Miguel Angel Ajo [Tue, 24 Mar 2015 13:10:37 +0000 (13:10 +0000)]
Enable Process Monitor by default.
Process monitor is enabled by default by this patch,
with a default 60 second monitoring interval, this
interval was calculated early in the development
process to scale to 1000s of processes with light load.
We believe it's important to have it enabled to get
user feedback as we release kilo.
Process monitor is sucessfully enabled and backported
to Red Hat D/S distributions from icehouse to juno
without any issue.
Specific process monitor functional tests provide
coverage, also keepalived checks that it can be
properly respawned.
We should follow up with dhcp and l3 agent functional
testing for killing and checking their processes
correctly respawned. Normal process start/stop is
already validated by other functional tests and tempest.
Kevin Benton [Fri, 27 Mar 2015 02:52:23 +0000 (19:52 -0700)]
Don't eagerly load ranges from IPAllocationPool
The subnet object eagerly loads the IPAllocationPools
associated with it. Each of these was eagerly loading
the IPAvailabilityRange objects associated with it.
On a large subnet with lots of churn, this could be
thousands of records. All of these records were being
loaded for every call to get_subnet, which means all
get_subnets, get_networks, and so-on. icky
This patch changes the relationship between IPAllocationPool
and available_ranges to a 'select' load, so they won't be
loaded until referenced. On my test system with a subnet
that contained 10k ports, this changed the subnet-show time
from 4.7 seconds to 0.56 seconds.
There is no performance downside to this in the upstream
code. At the time of this patch, there were no references
to 'available_ranges' on an IPAllocationPool result. The
logic that deals with the available ranges queries them
explicitly using join statements.
Itsuro Oda [Thu, 8 Jan 2015 23:47:56 +0000 (08:47 +0900)]
Enable services on agents with admin_state_up False
Previously when admin_state_up of an agent is turned to False,
all services on it will be disabled.
This fix makes existing services on agents with admin_state_up
False keep available.
To keep current behavior available the following configuration
parameter added.
* enable_services_on_agents_with_admin_state_down
If the parameter is True, existing services on agents with admin_state_up
False keep available. No more service will be scheduled to the agent
automatically. But adding a service to the agent manually is available.
i.e. admin_state_up: False means to stop automatic scheduling under the
parameter is True.
The default of the parameter is False (current behavior).
Maru Newby [Mon, 23 Mar 2015 23:18:44 +0000 (23:18 +0000)]
Simplify base test cases
Previous changes (Ifa270536481fcb19c476c9c62d89e6c5cae36ca1 and
I44251db399cd73390a9d1931a7f253662002ba10) separated out test setup
that had to import Neutron to allow the api tests to run. The api
tests previously imported Tempest, and errors would result if both
Neutron and Tempest were imported in the same test run. Now that the
api tests do not import Tempest, the base test cases can be simplified
by reversing the referenced changes.
A dependent change to neutron-fwaas removes reference to testlib
plugin: I0f2098cfd380fb6978d643cfd09bcc5cf8ddbdb9
Ilya Sokolov [Tue, 23 Dec 2014 13:22:20 +0000 (13:22 +0000)]
Send only one rule in queue on rule create/delete
Now we send all labels and rules per rule create/delete
and rebuild whole iptables chains.
In this patch we send only affected rule and create/
delete only this rule from iptables.
John Schwarz [Tue, 14 Oct 2014 11:09:14 +0000 (14:09 +0300)]
Add full-stack tests framework
This patch introduces the full-stack tests framework, as specified in
the blueprint. In short, this adds the neutron.tests.fullstack module,
which supports test-managed neutron daemons. Currently only
neutron-server is supported and follow-up patches will support for
multiple agents.
Miguel Angel Ajo [Tue, 24 Mar 2015 13:07:37 +0000 (13:07 +0000)]
Stop any spawned ProcessMonitor at test cleanup
Base test class adds a cleanup fixture to stop any
spawned process monitor via unit or functional tests,
which otherwise would keep running after the tests already
finished, and execution functions go unpatched.
Without this patch unit tests will randomly fail
when we enable process monitor by default at change:
I85fe31bee30714148168a293eea29fa0a37f9701
Assaf Muller [Tue, 24 Mar 2015 23:56:37 +0000 (19:56 -0400)]
Use router state in get_ha_device_name and ha_network_added
get_ha_device_name and ha_network_added were moved from the
agent to the router class, but they're not using the router
state. Rather, they're accepting arguments that they don't
need.
rajeev [Fri, 6 Mar 2015 15:02:30 +0000 (10:02 -0500)]
If configured, set the MTU for fpr/rfp intefaces
if network_device_mtu parameter is configured, set the MTU for
fpr and rfp interfaces to the value specified by the parameter
at the time of creation of these interfaces.
Enhanced DVR functional test to verify MTU gets
set for the fpr/rfp interfaces.
Adelina Tuvenie [Tue, 24 Mar 2015 18:29:17 +0000 (11:29 -0700)]
OVS agent support on Hyper-V
This patch abstracts away platform specific differences in
agent/linux/utils.py and agent/linux/polling.py in order for
OVS neutron agent to work on Hyper-V.
agent.linux.utils uses fcntl that is not available on Windows and
also uses rootwrap which is no necessary on Windows.
ovsdb_monitor.SimpleInterfaceMonitor works only on GNU/Linux because
agent.linux.async_process uses platfom specific components like the
kill command.
Adelina Tuvenie [Tue, 24 Mar 2015 16:29:45 +0000 (09:29 -0700)]
Moves ovs_lib to agent/common
This patch moves ovs_lib from agent/linux to agent/common
since it will be used by ovs_neutron_agent on both Linux
and Windows platforms. To provide compatibility with out of
tree code, a placeholder has been left in agent/linux.
Sandhya Dasu [Thu, 5 Feb 2015 17:21:05 +0000 (12:21 -0500)]
Cisco UCS Manager ML2 Mechanism Driver
Introduces a ML2 based Mechanism Driver for Cisco UCS Manager. The vendor
specific driver code referenced by this MD resides in stackforge repo
networking-cisco. This MD did not exist in the Neutron tree before so no files
have to be removed as part of this change.
Assaf Muller [Wed, 25 Mar 2015 00:27:29 +0000 (20:27 -0400)]
Rename/move/remove HaRouter methods
All of the methods that use verify_ha are now part of the HaRouter
class. The check has outlived its usefulness and may die
a peaceful yet horrifying death. At its point of death,
verify_ha is akin to a guy walking down the street and yelling:
'Am I me? Am I me?' - Yes, you're you, shut up. An HA router
is an HA router, there's no point in the class checking if
it's indeed an HA router.
* keepalived_manager._get_full_config_file_path was being used
outside of the keepalived_manager, removed the leading underscore
* _ha_get_existing_cidrs doesn't need an 'ha' prefix, it's already
a part of the HA router class. This patch renames the method to
a more descriptive name
* HARouter._get_ipv6_lladdr had nothing to do with HA routers, nor
did it use the HARouter state. Moved it to ip_lib
Darragh O'Reilly [Tue, 17 Mar 2015 16:03:51 +0000 (16:03 +0000)]
lb-agent: use 'replace' instead of 'add' with 'bridge fdb'
l2pop on the linuxbridge agent can fail to add permanent entries
because the 'bridge fdb add' command fails if a temporary entry
exists. This patch uses 'replace' which always works.
YAMAMOTO Takashi [Tue, 27 Jan 2015 06:32:19 +0000 (15:32 +0900)]
Fix a usage error of joinedload + filter in l3 scheduler
This commit fixes admin_state_up filtering in
get_l3_agents_hosting_routers. Also, adapt its callers
which rely on the current broken implementation.
Details:
With the current coding, joinedload() produces a JOIN and
the following filter() on the columns from the joined table
would create another JOIN of the same table. (As t1 in the
following example). It doesn't seem to be the intended
behaviour. As a consequence the filter (WHERE clause in
the following examples) doesn't work as expected.
Queries before this fix looked like the following,
where t1 and t2 are Agent and RouterL3AgentBinding respectively:
SELECT t2.aaa, t1_1.bbb, ...
FROM t1, t2 LEFT OUTER JOIN t1 AS t1_1 ON t1_1.ccc = t2.ddd
WHERE t1.eee = ...;
After the fix, it would be:
SELECT t2.aaa, t1.bbb, ...
FROM t2 JOIN t1 ON t1.ccc = t2.ddd
WHERE t1.eee = ...;
Assaf Muller [Tue, 24 Mar 2015 23:45:11 +0000 (19:45 -0400)]
Move process_ha_router_added/removed from HA agent to router
* Move process_ha_router_added/removed from ha.py to
ha_router.py, rename them initialize and terminate
* Remove _process_ha_router (Spawns/disables keepalived) from
process_router (Called when adding/updating and deleting
a router), move its content to process_router for add/update
and terminate for delete
* Rename ha_router.spawn_keepalived to enable_keepalived
(Consistent with disable_keepalived and process_manager
semantics)
Adelina Tuvenie [Tue, 24 Mar 2015 10:06:21 +0000 (03:06 -0700)]
Add eventlet monkey_patch helper
Eventlet monkey patching the os and thread modules causes subprocess.Popen
to fail on Windows when using pipes due to missing non-blocking IO support.
There is an reported bug on eventlet [1] with this issue. The solution
for this issue is to not monkey_patch os and thread.
This change is needed in order to run ovs_neutron_agent on Windows platforms.
John Davidge [Mon, 23 Mar 2015 19:00:14 +0000 (19:00 +0000)]
Add the default_ipv6_subnet_pool config option
This config option will allow an admin to set the default subnet-pool
to be used for automatic subnet CIDR allocation in the case of subnet-create
being called without a CIDR or subnet-pool ID.
This also paves the way for enabling IPv6 Prefix Delegation in PD-capable
environments.
Darragh O'Reilly [Wed, 18 Mar 2015 20:45:10 +0000 (20:45 +0000)]
Fix port status not being updated properly
This problem was introduced by hierarchical port bindings and
affected ports bound on linuxbridge hosts as that agent only
passes the first 11 chars of the port_id to the plugin.
Cedric Brandily [Thu, 19 Mar 2015 14:18:03 +0000 (14:18 +0000)]
Transform BaseLinuxTestCase methods in helpers
This change transforms BaseLinuxTestCase[1] methods into helpers. They
are not removed but transformed into wrappers to helpers methods to
reduce change size. A follow-up change will remove them and adapt
testcases currently using them.
Kobi Samoray [Tue, 3 Mar 2015 09:44:18 +0000 (11:44 +0200)]
VMWare NSXv: Metadata default gateway param
Add a default gateway parameter for metadata access from remote
network.
This parameter is necessary when NSXv metadata proxy is on a different
cluster than the management VM and network, and hence requires routing.
Fix intermittent failure in TestNetworksFailover UT
Ensure that the periodic check does not get in the way of method
calls being tested, by stopping the periodic task from running.
This patch moves the mock for the periodic check into the
setup_coreplugin call so it gets called by unit tests that
use the core plugin.
The previous location after the construction of the API router was
too late because the core plugin was already constructed by the
neutron manager. This led to random failures because the periodic
tasks leaked by all of the unit tests would occasionally preempt
test_reschedule_network_from_down_agent in automatically removing
a network from an agent.
Kevin Fox [Wed, 18 Feb 2015 22:01:49 +0000 (14:01 -0800)]
Fixes floating IP regression with multiple routers
During the refactor here:
Change-Id: I09e8a694cdff7f64a642a39b45cbd12422132806
Too much code was removed and caused floating ips to get miss assigned when
multiple routers with external networks in the same tenant are present. The
first router in the tenant was always being chosen. This patch adds back
some of the original code as well as a unit test.
Kevin Benton [Sat, 21 Mar 2015 00:40:43 +0000 (17:40 -0700)]
Add no_delete flag to UT router context manager
Adds a no_delete flag to the router context manager in
the unit tests to allow specific tests to avoid executing
all of the cleanup logic for floating IPs and interfaces
just to exit the test.
Ultimately, this should become the default once we are
comfortable that there is adequate explicit unit tests
for the deletion logic.
Send notification to controller about HA router state change
The L3 agent gets keepalived state change notifications via
a unix domain socket. These events are now batched and
send out as a single RPC to the server. In case the same
router got updated multiple times during the batch period,
only the latest state is sent.