John Schwarz [Tue, 5 Jan 2016 15:21:30 +0000 (17:21 +0200)]
DVR: when updating port's fixed_ips, update arp
Currently, when updating a port's fixed_ips, the l3 agents fail to
update the arp tables of this change, which can lead to east-west
connectivity issues when a router is connected to more than one tenant
network.
Hynek Mlnarik [Tue, 12 Jan 2016 08:10:25 +0000 (09:10 +0100)]
Log INFO message when setting admin state up flag to False for OVS port
Disabling admin state can cause confusion in OVS agent logs as to why
VLAN 4095 is set to a particular port. This commit adds an extra INFO
log message when admin state is disabled. There is no log emitted
upon enabling admin state as there is already a detailed log entry
logged in treat_devices_added_or_updated() function.
Oleg Bondarev [Wed, 9 Dec 2015 14:58:14 +0000 (17:58 +0300)]
Remove duplicate for check_ports_exist_on_l3agent
This removes check_ports_on_host_and_subnet which mostly duplicates what
check_ports_exist_on_l3agent is doing.
Also rename check_ports_exist_on_l3agent to check_dvr_serviceable_ports_on_host
for more clarity.
Currently 'flows' is being checked for empty list in
a non standard way 'if flows == []:'. This patch
simplifies logic so that above check is unnecessary.
This patch simplifies the process for validating the request body for
POST and PUT requests and preparing it for dispatching to plugins.
In particular it removes the need for parsing the URL to find the
resource identifier, and instead leverages Pecan's routing engine
to extract it. As a result the attribute population hook now simply
deals with request body validation, and has been renamed accordingly.
The logic for loading the current state of the object from the plugin
in order to enforce authZ policy on PUT requests has been moved to
the appropriate hook, PolicyEnforcementHook.
The logic for managing plural/singular names for resource has also been
improved, and two helper functions to retrieve a resource's attributes
have been added to neutron.api.v2.attributes
The logic for aborting requests with unsupported HTTP methods has also
been moved to the REST controllers. It used to be in PolicyEnforcementHook,
which was probably not the right thing to do.
This patch also unskips a functional test concerning ownership checks,
and add functional tests for verifying correct request processing.
Unit tests for the newly added helper functions are also provided.
Kevin Benton [Thu, 7 Jan 2016 23:40:27 +0000 (15:40 -0800)]
make floating IP specification test robust to races
The get_unused_ip function returns an address that isn't in use on
the network at the time it's called. However, by the time the caller
uses it, it may have been allocated to another concurrent test if
the network is shared or external.
The test_create_floatingip_with_specified_ip_address test creates
a floating IP with an unused IP on the external network, which has
lots of activity on it from other tests so it would occasionally
have its address taken by another test.
This patch just catches the in use error and tries again with a
new IP.
Kevin Benton [Thu, 24 Dec 2015 08:29:08 +0000 (00:29 -0800)]
Ensure agent binding modules are loaded
This patch ensures that models_v2 and the router db module
import the agent binding modules so their models are defined
in the sqlalchemy metadata. Otherwise, using an agentless
core/L3 plugin may result in a failure to initialize if nothing
imported the agent module.
Akihiro Motoki [Fri, 8 Jan 2016 18:35:05 +0000 (03:35 +0900)]
Make neutron-debug command follow cliff command convention
In the guideline of cliff command, developers implementing
commands should override take_action() rather than run().
The similar effort is being done in neutronclient side and
this fix is required to complete the effort.
Logger definition in each command class is no longer needed.
This commit also drops them.
Rename _get_vm_port_hostid in dvr to reflect the right functionality
_get_vm_port_hostid returns the host id associated with the
dvr service ports. It not only returns the VM port hostid, but
also returns the host id associated with LBaaS vip port and
dhcp.
So to be in sync with other function names let us rename the
function to _get_dvr_service_port_hostid.
Kevin Benton [Fri, 8 Jan 2016 01:27:52 +0000 (17:27 -0800)]
Move notifications before DB retry decorator
This patch moves the start notifications emitted in the API
layer ('network.create.start', etc) to before the DB retry
decorator. This prevents benign retry events from resending
notifications onto the message bus.
Carl Baldwin [Tue, 22 Dec 2015 18:19:15 +0000 (11:19 -0700)]
Create a routing table manager
The routing table manager maps address scope ids to routing tables.
It uses the rt_tables file specific to each namespace to maintain the
mapping so that id can simply be used as the table name when running
iproute2 commands. This will be useful when debugging.
Shih-Hao Li [Wed, 30 Dec 2015 19:43:23 +0000 (11:43 -0800)]
Fix uuid passing in disable_isolated_metadata_proxy
In DhcpAgent, when enable_isolated_metadata_proxy() spawns
a metadata proxy agent for a network, it will pass router_id
instead of network_id if metadata network is enabled and
a router port is connected to this network.
Later, MetadataDriver will register this uuid (i.e. router_id)
with monitor for the new metadata proxy process.
But when disable_isolated_metadata_proxy() destroys a metadata
proxy agent for a network, it always passes network_id as the uuid.
Thus MetadataDriver can not find the matching process. So the
corresponding metadata proxy agent can not be destroyed.
Moshe Levi [Tue, 8 Dec 2015 11:11:33 +0000 (13:11 +0200)]
SR-IOV: Fix macvtap assigned vf check when kernel < 3.13
when creating macvtap passthrough to SR-IOV VF in Kernel >= 3.13 an
upper_macvtap symbolic link is created. For Kernel < 3.13 the only
way to know it is by parsing the ip link show output and look for
macvtap[0-9]+@<vf ifname>.
This patch used the ip link show command to detects
macvtap assigned vf so that detection of macvtap assigned vf
will work on all kernels
Yu Fukuyama [Tue, 22 Dec 2015 05:17:30 +0000 (05:17 +0000)]
Fix meter label rule creation
In the case of outbound traffic, set remote_ip to dst.
In the case of inbound traffic, set remote_ip to src.
Change-Id: I7f27b93efa67baf3efccaa94f6a1337d6886e230
Closes-Bug: #1528137
DocImpact: Clarify remote_ip_prefix description of metering label rule in API site
Assaf Muller [Mon, 4 Jan 2016 22:49:09 +0000 (17:49 -0500)]
Remove l2pop _get_port_infos method
It's a method called 'get_port_infos' that returned
4 values, most of which were not a function of the port.
What the method did or its naming was very unclear to me
so I broke it up according to its usage.
Martin Hickey [Tue, 15 Dec 2015 17:42:39 +0000 (17:42 +0000)]
Add test for Neutron object versions
Adds a test to Neutron to check object versions for any changes
to objects. It prompts the developer to update the version of the
changed object. It uses oslo.versionedobjects.
Change-Id: I99454b28ae0b5fa663354eeccdf709d4030a280b Co-Authored-By: Ryan Rossiter <rlrossit@us.ibm.com>
Mathieu Rohon [Wed, 4 Nov 2015 17:49:40 +0000 (17:49 +0000)]
Avoid duplicating tenant check when creating resources
The check of the tenant done in the method _get_tenant_id_for_create()
is already did by the Neutron Controller in prepare_request_body(),
with a call to attributes.populate_tenant_id().
Moreover, when the Controller processes a "create" requests, it
will add the 'tenant_id' to the resource dict.
Thus, _get_tenant_id_for_create() can be deleted.
Calls to this method are replaced by the res['tenant_id'].
Changes have to be done in UT to explicitly add the tenant_id while
creating resources, since the UT framework is bypassing the controller code
that automatically adds the tenant_id to the resource.
Sławek Kapłoński [Thu, 26 Nov 2015 22:31:11 +0000 (23:31 +0100)]
Add extension_manager and support for extensions in linuxbridge agent
There is extensions mechanism for l2 agents already but it was
implemented only for openvswitch l2 agent. This patch adds support for
such extensions also for linuxbridge agent.
This patch also adds support for network_update events received by the
agent via RPC. It is required because sometimes when a network is
updated (for example with a QoS policy is attached to it) all ports that
belong to the network should also be updated.