Kevin Benton [Tue, 4 Mar 2014 11:27:11 +0000 (03:27 -0800)]
Mock agent RPC for FWaaS tests to delete DB objs
This changes the firewall service unit tests to
mock the RPC calls from the firewall service to
the agent. This allows the tests to fake the
agent response RPC that removes the firewall
from the DB so the all of the other objects that
the firewall depends on can be deleted.
Maru Newby [Fri, 14 Mar 2014 22:14:09 +0000 (22:14 +0000)]
Stop removing ip allocations on port delete
The _delete_port() method was manually removing related
IPAllocation instances despite the existence of a perfectly
good cascade deletion relationship in the model. This patch
puts an end to that nonsense and the potential for deadlock that
it represented.
Dazhao [Wed, 13 Nov 2013 10:24:32 +0000 (18:24 +0800)]
Calculate stateless IPv6 address
In order to support stateless IPv6, neutron should calculate IPv6 address base
on IPv6 prefix and MAC address via EUI-64 specification. This change adds
common library to calculate IPv6 address.
Partially-implements bp ipv6-two-attributes Co-Authored-By: Xu Han Peng <xuhanp@cn.ibm.com>
Change-Id: I68ccbc42388ec760d6fead242e080822ca753913
Sean M. Collins [Thu, 30 Jan 2014 19:12:17 +0000 (14:12 -0500)]
Create new IPv6 attributes for Subnets
* Introduces two new optional attributes for Subnets:
* ipv6_ra_mode
* ipv6_address_mode
Both attributes accept the following values:
* dhcpv6-stateful
* dhcpv6-stateless
* slaac
In addition to these values, additional behaviors are specified for
when only one of the attributes is set. For example, a Neutron network
that uses a physical router as a gateway, that transmits ICMPv6 Router
Advertisement packets to configure hosts on the network will create
Neutron Subnets that have ipv6_ra_mode *not* set, and ipv6_address_mode
set to 'slaac' so that Neutron will calculate EUI64 addresses for
each port assigned to the subnet, and not spawn a Dnsmasq process.
These attributes maintain backwards compatability with the enable_dhcp
Subnet attribute, by requiring a subnet with these attributes to also
have enable_dhcp set to True.
DocImpact
Implements bp ipv6-two-attributes
Change-Id: I5b2313fff5dca1c16ff939fdc4397d7f95ba3ba5
NSX: Ensure gateway devices are usable after upgrade
The gateway device database migration upon an upgrade creates
gateway devices objects from references in network gateway
objects.
While these gateway devices are perfectly usable
in network gateways, they are not directly visible to tenants
and also cannot be updated to change details such as name,
connector type or ip as well as the client certificate.
This patch fixes the DB migration in order to ensure tenant
have access to gateway devices created after an upgrade.
This patch also modifies the l2 gateway nsxlib module to
ensure request bodies are correctly created even when not all
the attributes of a gateway device are specified.
Li Ma [Sun, 16 Mar 2014 11:32:22 +0000 (04:32 -0700)]
ML2 plugin involves in agent_scheduler migration
In agent_scheduler migration script which creates
network-dhcp-binding table and router-l3-binding table,
ML2 plugin should be included in the plugin list.
Akihiro Motoki [Fri, 7 Mar 2014 06:58:46 +0000 (15:58 +0900)]
Avoid long transaction in plugin.delete_ports()
db_plugin.delete_ports() called plugin.delete_port() under
a transaction. It leads to long transaction if plugin.delete_port
talks with external systems. This commit changes each delete_port
outside of a transaction to avoid longer transaction.
plugin.delete_ports is now called by release_dhcp_ports and
dhcp-agent ports can be deleted separately, so this changes
does not break the existing behavior.
delete_ports is renamed to delete_ports_by_device_id
to clarify the usage of this method.
NEC plugin already has this change and it is no longer needed.
_do_side_effect helper method in test_db_plugin is renamed
to more self-descriptive name.
The workflow of creating a firewall when a router without any i/f is present in that tenant
causes a KeyError on the FWAgent. The issue occurs as such routers are present in the list of
routers returned by get_routers() but are not populated in the router_info dict. Adding a check
before accessing the dict to prevent the exception. When an i/f is added to such routers -
_router_added processing in the l3agent will populate the router_info dict and the FWAgent
also picks this up in that context.
NSX: fix intermetting UT failure on vshield test_router_create
Logstash shows this happened twice during the past 24 hours.
Let's be proactive and see if we can mitigate the random failure
by raising the poll time.
mathieu-rohon [Fri, 14 Mar 2014 09:17:55 +0000 (10:17 +0100)]
Send fdb remove message when a port is migrated
the fdb_remove rpc message is sent when the status
of the port goes to BUILD, that is when the new host
send a get_device_details which means that it owns
the migrated port. The fdb_add message will be sent
as soon as the new host send update_device_up
Aaron Rosen [Fri, 21 Feb 2014 00:18:11 +0000 (16:18 -0800)]
Notify nova when ports are ready
The following patch adds a callback from neutron to nova that notifies nova
when a port for an instance is *ready to be used*. After nova receives this
event it will then start the instance in a hope that when it comes up
its networking should be in working order.
NOTE: *ready to be used* currently means that a plugin changes the status
in the db associated with a port from:
NO_VALUE/PORT_STATUS_DOWN/PORT_STATUS_ACTIVE to ACTIVE/ERROR.
Neutron will then signal nova: network_vif_plugged:<status> where status
will either be 'completed' or 'failed' given the neutron port status.
Neutron also notifies nova when a port goes from status:
PORT_STATUS_ACTIVE to PORT_STATUS_DOWN and sends nova a network_vif_unplugged
event.
Currently this patch breaks multiregion support (i.e previously you could
back multiple nova regions by one neutron server) though now since neutron
needs to notify nova we'll need to add a way to determine which region a
given port is in.
For now the work around for this would be to set: notify_nova_port_active=False
in neutron to prevent neutron from sending the notification and setting:
vif_plugging_is_fatal=False in nova.conf. Doing this will keep the current
interaction where an instance will be booted without waiting for the network
to be ready.
Kill 'Skipping unknown group key: firewall_driver' log trace
This is done by trying to import the option first. If this
does not work, emit a warning instead as in most cases this is
harmless for a number of reasons: a) the service might not
even need the opt; b) if things do break down the line, we'll
see bigger traces; c) it's not gonna be long for this legacy
quantum/neutron stuff to be removed altogether.
Sean M. Collins [Sun, 9 Mar 2014 02:11:23 +0000 (21:11 -0500)]
API layer documentation
* Discuss the WSGI layer of Neutron
* Describe the startup code that creates the WSGI application
* Briefly discuss the URL routing and resource creation
Kevin Benton [Mon, 10 Mar 2014 20:49:51 +0000 (20:49 +0000)]
Stop mock patches by default in base test class
Adds a mock.patch.stopall to the base unit test
case cleanup routines to stop patches by default
in unit tests. This behavior can be overwritten
by setting an attribute on the test class if
required.
Also removes the explicit stops in the Cisco n1kv,
VMware, and NEC unit tests to leverage the new
automatic cleanup.
Aaron Rosen [Wed, 5 Mar 2014 19:32:39 +0000 (11:32 -0800)]
Query for port before calling l3plugin.disassociate_floatingips()
The call to l3plugin.disassociate_floatingips() trigggers several events
that could cause a timeout to occur trying to query the db for the port
therefore this patch changes the code to query first for the port.
This patch amends a data model in order to allow user to specify
the same gateway device multiple times in a network gateway
specification.
The corresponding migration is also being amended with this
patch. This approach has been preferred to developing another
migration since the migration being amended is still the most
recent one for the NSX plugin.
Paul Michali [Mon, 17 Feb 2014 20:56:22 +0000 (15:56 -0500)]
VPNaaS Device Driver for Cisco CSR
This is the device driver for the vendor specific VPNaaS plugin. This
change relies on the service driver code (review 74144), which is also
out for review.
Note: Support for sharing of IKE/IPSec policies (which is currently
prevented by the service driver code), will be done as a later
enhancement.
Note: Needs Tempest tests updated/created to test this.
Note: To run, this needs an out-of-band Cisco CSR installed and
configured.
Note: This uses a newer version of requests library and a new httmock
library. Until these are approved (75296), the UT will be
renamed to prevent testing the REST client API to the CSR.
Jakub Libosvar [Tue, 11 Mar 2014 16:11:38 +0000 (17:11 +0100)]
Create agents table when ML2 core_plugin is used
In Icehouse agents table is not created when ml2 is used but later in
migration chain is added uniq constraint on this table. This patch makes
agents table created when ml2 plugin is used as core_plugin.
Sometimes a vm gets its tap interface unset and reset too fast to be caught in
an agent loop, and its vlan tag was not reset.
We now detect if an interface loses its vlan tag, and if it happens the
interface will be reconfigured.
Since the TAG ID is only available via the "Port" table (in the 'tag' column),
we couldn't reuse the get_vif_port_set() method's run_vsctl call which queries
the "Interface" table, and needed a specific run_vsct call to the "Port" table
in the new get_port_tag_dict() method.
Itsuro Oda [Wed, 5 Feb 2014 01:12:26 +0000 (10:12 +0900)]
Call target plugin out of DB transaction in the Metaplugin
Previously, there are cases that a target plugin is called
within a DB transaction in the metaplugin. This possibly causes
"DB lock timeout" error since a target plugin may take a long
time (ex. communicate to a controller).