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.
Roey Chen [Wed, 18 Mar 2015 18:00:30 +0000 (11:00 -0700)]
Allow plugin to specify security-group rules ids upon creation
This patch enables plugin to specify the security-group rules ids,
it is optional and defaults to current behavior.
This approach is already used with network creation, where a plugin can
specify the network uuid.
Terry Wilson [Thu, 22 Jan 2015 11:39:57 +0000 (05:39 -0600)]
Add native OVSDB implementation of OVSDB API
This patch adds a native OVSDB protocol version of the new OVSDB
API. As such, it does not require using sudo/rootwrap but instead
uses the OVS IDL Python library that ships with openvswitch.
Break coupling between ML2 and L3 during delete operation
This is an initial attempt at breaking out the L3 logic from the ML2
framework as much as possible. This patch takes care of the notification
to the L3 agent(s), after a port has been deleted. Both base L3 and
L3+DVR operations are affected.
Gal Sagie [Wed, 18 Mar 2015 06:36:29 +0000 (08:36 +0200)]
Validate when DVR enabled, l2_pop is also enabled
The agent should fail to start when
enable_distributed_routing = True and l2_population = False
otherwise the router won't behave as expected.
All the cross subnet traffic (between VMs of the same tenant)
in DVR is now handled locally on the compute node using the router namespace.
A Linux namespace is created for every virtual router,
on each compute node that hosts VMs that are connected to that router.
The local DVR performs the routing and replaces the source MAC address and
the destination MAC address for every packet leaving the compute node.
In order to do that correctly, the router must be populated with
all the L2 addresses of the attached networks
Ryan Tidwell [Thu, 15 Jan 2015 21:17:17 +0000 (13:17 -0800)]
Basic subnetpool CRUD
Enable creating, reading, updating, and deleting subnet pools via REST API.
Includes required changes to REST, model, alembic migrations, and unit tests.
Subnet pools carry a list of IPv4 or IPv6 prefixes from which a subnet can be
allocated. This will enable tenants to request a subnet from a pool rather
than being forced to explicitly provide their own CIDR's for their subnets.
This change simply enables managing the lifecycle of a subnet pool and does
not yet enable allocation of subnet prefixes from a pool.
Subnet pools can have their prefix bounds (min, max, default), name, and
prefix list updated. Changes to prefix bounds do not alter existing
allocations and will not be blocked by existing allocations. Prefix lists can
only be appended to. Prefixes cannot be removed from the pool once added.
Assaf Muller [Mon, 22 Dec 2014 15:01:37 +0000 (17:01 +0200)]
Allow to request metadata proxy only from internal interfaces
Currently the metadata service can be requested on 169.254.169.254:80
from all interfaces including external interfaces. This change updates
PREROUTING rules to allow request on 169.254.169.254:80 only from
internal interfaces.
Assaf Muller [Thu, 12 Mar 2015 23:50:43 +0000 (19:50 -0400)]
Replace keepalived notifier bash script with Python ip monitor
Previously L3 HA generated a bash script and copied it to a per-router
configuration directory that was visible to that router's keepalived
instance. This patch changes the in-line generated Bash script to a
Python script that can be maintained in the repository.
The bash script was used as a keepalived notifier script, that was invoked
by keepalived whenever a state transition occured. These notifier scripts
may be invoked by keepalived out of order in case it transitions quickly
twice. For example, if the master failed and two slaves fight for the new
master role. One will transition to master, and the other will often
transition to master and then immidiately back to standby. In this case,
the transition scripts were often fired out of order, resulting in the
wrong state being reported.
The proposed approach is to get rid of the keepalived notifier scripts
entirely. Instead, monitor IP changes on the HA device. If the omnipresent
IP address was configured on the HA device, it means that we're looking
at a master instance. If it was deleted, the router transition to standby
or fault.
In order to keep the L3 agent CPU usage down, it will spawn a process
per HA router. That process will start the ip address monitor.
Whenever it gets an IP address change event, it will notify the L3 agent
via a unix domain socket.
Terry Wilson [Wed, 18 Mar 2015 22:13:53 +0000 (17:13 -0500)]
Add sanity check for OVSDB native support
This check has specific warnings about the need to install the
python-openvswitch package to use OVSDB native. If an unknown
Exception is thrown when doing a simple get_bridges() call, it will
also fail, logging the exception.
Fei Long Wang [Mon, 16 Feb 2015 11:58:45 +0000 (00:58 +1300)]
Fix metering agent failure when chain missing
The metering agent will fail if one of the iptables chains
is missing, which will cause errors extracting data from
all the other chains. Add a simple try/except to let the
loop continue.
Fix broken link, add missing header, and remove new contributions
from the list. This table should just capture the progress status
of existing plugins and drivers at the time the decomp was conceived.
Pritesh Kothari [Mon, 23 Feb 2015 17:52:28 +0000 (09:52 -0800)]
Adding VLAN Transparency support for ML2 along with REST API changes
* Exposing vlan transparency attributes via the network api
calls so POST and GET operations can be performed.
* Tied in the vlan transparency attribute with create network
call and use the config default.
* Update the unit test to cover vlan tranparency.
* Add support for ml2 to take advantage of vlan transparency
attribute.
Shivakumar M [Tue, 25 Nov 2014 08:46:07 +0000 (00:46 -0800)]
DHCP Service LoadBalancing Scheduler
In this blueprint, we also propose to write a generic scheduler
framework which can be used to schedule a new resource on
selected least loaded agents.
Currently dhcp_load_type will be fetched from neutron.conf file
and corresponding load is obtained by the agent report state.
The obtained load will be populated in the "load" column of the
agents table.
During scheduling, agent will be selected based on sorting all
the agents of particular type based on load column.
Example dhcp_load_type is networks
DocImpact
Implements: blueprint dhcpservice-loadbalancing
Change-Id: I5ec8adf0c4336f885d603662223caa7694708876
Author: Shivakumar M <shiva.kum.m@hp.com> Co-Authored-By: Praveen Kumar SM <praveen-sm.kumar@hp.com> Co-Authored-By: Benjamin GRASSART <benjamin.grassart@thalesgroup.com> Co-Authored-By: Sourabh Patwardhan <sopatwar@cisco.com>
Kevin Benton [Wed, 18 Mar 2015 15:14:09 +0000 (08:14 -0700)]
Make DHCP tests cleanup neutron manager reference
The DHCP scheduler unit tests occasionally call methods
on the core plugin via the neutron manager (e.g. in report_state).
However, they weren't calling the normal unit test cleanup routines
for tests that call the core plugin so they were leaving stale
references in the manager.
This patch uses the setup_coreplugin helper that sets up the
configuration for the core plugin and adds the cleanup call
to ensure that the neutron manager is cleaned up at the end
of each test.
Dane LeBlanc [Mon, 16 Mar 2015 16:27:34 +0000 (12:27 -0400)]
Include IPv6 SLAAC addresses implicitly for port update
(Patch set #4 for the multiple-ipv6-prefixes blueprint)
This change adds functional code and UT for port-update
handling changes as described in the Neutron blueprint
'multiple-ipv6-prefixes'.
Whenever a port is updated on a network that includes one
or more auto-address subnets (e.g. SLAAC or DHCPv6-stateless),
then any addresses that the port previously had for those
subnets needs to be implicitly retained for the update
operation. This patch set adds this implicit retention
of the auto-addresses for port update operation.
Boris Pavlovic [Sat, 14 Mar 2015 13:15:42 +0000 (16:15 +0300)]
Run more Rally benchmark on every patch
* Since 24 Nov 2014 we added a lot of Neutron benchmarks
Running more Neutron related benchmarks in Neutron gate allows
to avoid performance regressions and races.
* Neutron benchmarks are described here:
https://github.com/stackforge/rally/blob/master/rally/benchmark/scenarios/neutron/network.py
It's quite simple code be free to take a look.
* All changes in concurrency and times are related to optimization
of duration/usefulness
* To get description of benchmarks use:
rally info find NeutronNetworks.create_and_update_networks
New benchmarks:
- NeutronNetworks.create_and_update_networks
- NeutronNetworks.create_and_delete_networks
- NeutronNetworks.create_and_update_subnets
- NeutronNetworks.create_and_delete_subnets
- NeutronNetworks.create_and_update_routers
- NeutronNetworks.create_and_delete_routers
- NeutronNetworks.create_and_list_routers
- NeutronNetworks.create_and_update_ports
- NeutronNetworks.create_and_delete_ports
- NeutronNetworks.create_and_list_ports
- Quotas.neutron_update
related bug: #bug 1419723
Change-Id: Ie3c84e057fc96c0f35ad77b7297c564442ebcf10
Angela Smith [Tue, 10 Feb 2015 23:38:37 +0000 (15:38 -0800)]
Add ML2 VLAN mechanism driver for Brocade MLX and ICX switches.
This thin driver will introduce VLAN support on Brocade MLX and ICX
switches. Vendor specific driver implementation will reside in a
separate repository.
Dane LeBlanc [Mon, 16 Mar 2015 14:23:26 +0000 (10:23 -0400)]
Include IPv6 SLAAC addresses implicitly for port create
(Patch set #1 for the multiple-ipv6-prefixes blueprint)
This patch set resolves an issue whereby auto-address subnets
are not being included implicitly for port create operations
that include a fixed_ips list.
Assaf Muller [Mon, 16 Mar 2015 19:43:24 +0000 (15:43 -0400)]
Don't delete HA router primary VIP on agent restarts
An HA router's primary VIP was being deleted from the router
namespace when the L3 agent is restarted. Make sure that
doesn't happen and change the functional test to make sure
the bug stays squashed.
Carl Baldwin [Thu, 13 Nov 2014 19:27:27 +0000 (12:27 -0700)]
Introduce External IPAM Interface
This introduces an interface for an external IPAM driver. Neutron needs to be
modified to make calls using it for its IPAM needs. Additionally, the default
IPAM interface must be written to implement this interface.