Henry Gessau [Sat, 31 Jan 2015 17:57:49 +0000 (12:57 -0500)]
Move NCS mech driver to its new home
The NCS driver is scheduled for decomposition, and in the targetted vendor repo
the files are in a new location in the tree. Before we can decompose the driver
we must move it to its new location in the neutron tree.
A future patch will decompose (thin) the driver and add requirements.txt.
Terry Wilson [Thu, 22 Jan 2015 10:07:50 +0000 (04:07 -0600)]
Use ovsdb-api neutral column/value mappings
The format ('column:field', 'value') for map-type ovsdb values is
ovs-vsctl-specific. The updated implementation-neutral way to do
this is ('column', {'field': 'value'}).
Yoni Shafrir [Wed, 4 Feb 2015 05:42:13 +0000 (07:42 +0200)]
Remove use of keepalived 'vrrp_sync_group' as it is unused
Now keepalived configuration wraps the VRRP instances with a
'vrrp_sync_group'. The VRRP sync group functionality is only
relevant when more then one VR instance is contained in it.
In that case the VRs in the group will have the same state.
Our use of keepalived uses a single instance per router.
This patch simply removes the 'vrrp_sync_group'.
In this patch VR instances are used on their own and they now
hold the 'notify_scripts'.
Note that the same VRRP functionality is preserved with this
patch.
Another motiviation for this patch, aside from removing
useless configuration, is to lay the foundation for a future
patch that will the related bug by adding 'track_script'
that are not supported with 'vrrp_sync_group'.
Russell Bryant [Fri, 23 Jan 2015 19:48:07 +0000 (14:48 -0500)]
Scope dvr rpc api using a messaging namespace
This patch does a couple of things. First it adds docstrings to the
client/server pair of the rpc interface used by the ovs agent
to make dvr related calls back into the Neutron server. The docs
tell you where the other side of the interface is found in the code,
and where docs are that give more info on the rules for changing them.
The second thing done in this patch is to scope this interface using a
messaging namespace. Right now some plugins expose several interfaces
via the default namespace. This effectively means they are a single
API and should be managed with a single version stream. It's much
more managable to just treat these as separate interfaces and this
change makes that explicit and functionally true. Now when a method
is invoked, the only classes considered for handling that request will
be ones marked with the right namespace.
Henry Gessau [Sun, 8 Feb 2015 02:19:06 +0000 (21:19 -0500)]
Refactor radvd control in the l3-agent
Several of parameters used by radvd are known when a router is created
and do not need to be passed around every time an RA method is
called. Also, we want to easily check the state of radvd for a router.
Use an object to keep track of the data and state of an radvd process.
Terry Wilson [Thu, 22 Jan 2015 19:52:43 +0000 (13:52 -0600)]
monkey patch stdlib before importing other modules
Some oslo libraries assume that stdlib is already patched when
they are imported (e.g. oslo_concurrency.processutils tests the
'time' module for monkey_patching to detect which 'subprocess'
module to import.
This can cause issues when things like test frameworks import
modules that monkey_patch, as the order imports are made can break
this kind of check. It is always good to monkey patch as soon as
possible, hence trying to do the patching in neutron/__init__.py.
This is an alternative to https://review.openstack.org/#/c/153225/
which just patches neutron/tests/__init__.py. Unfortunately, just
monkey_patching in tests/__init__.py didn't fix all of the issues
I ran into. For example, tempest tests were failing with timeouts.
Jakub Libosvar [Tue, 3 Feb 2015 13:33:39 +0000 (14:33 +0100)]
Don't crash when adding duplicate gre allocation
This patch catches DBDuplicateError when initializing ML2 GRE type
driver and allocation already exists in DB. Because current allocations
are queried and then only those that doesn't exist in database are
added, DBDuplicateError should never occur.
But the race can happen when running multiple neutron-servers and one
of servers adds allocations between allocations are queried and added.
Fix lack of device ownership enforcement for DVR routers
The enforcement rule was applied to centralized router interfaces, to avoid
a potential security vulnerabilty.
Even though DVR routers are fundamentally different from centralized routers,
there is no good reason as to why the rule should be skipped for DVR interfaces.
This patch sanitizes the insanity a bit and closes this potential loophole by
preventing the operation for DVR routers too.
This exception is an overkill, and can be safely removed. The tests
affected were not designed to cover any regression as they were asserting
that the mocked Exception was being raised, defeating the very purpose of
catching the regression; they have been revised to ensure that the checks
are not misplaced in future revision of the code, or that they behave the
way they are supposed to.
Chengli XU [Wed, 25 Jun 2014 14:26:04 +0000 (22:26 +0800)]
l2-pop shouldn't notify agent about inactive ports
When an agent starts, or the first port of an agent becomes active,
l2 population mechanism driver will notify the agent of all ports on other agents.
It should not notify about inactive ports.
Basically, this patch-set is needed for fixing the bug 1332450.
Carl Baldwin [Mon, 2 Feb 2015 23:34:24 +0000 (23:34 +0000)]
Use weak ref to avoid deleting fip namespace through agent
By using a weak ref in the agent to keep track of the fip namespaces,
we avoid having to call a method directly on the agent to delete a fip
namespace. When the last router removes the last floating ip, the
fip_ns is marked destroyed and the router's strong reference is
removed. This allows the garbage collector to reap it. When the
agent goes looking for the fip namespace instance again, it will check
to see that it has not been garbage collected and that it has not been
destroyed before using it.
The goal here is to avoid having to ask the agent to delete a fip
namespace. We know to delete a fip namespace when all of the floating
ips are gone. We delete floating ips in the context of processing a
router. So, having to call back out to the agent to destroy the fip
namespace is preventing some of this code from being moved in to the
router context.
With the decomp running at full steam, some questions have been
raised on Gerrit, IRC or the mailing list. This patch adds more
details on how to go about unit testing and some current limitations
of 3rd party systems.
Add section for DevStack Integration Strategies to the DevRef
Plugins may already have DevStack support, that may need to be revised
according to the decomposition. If a plugin/driver does not have one,
it is necessary to add it to ease the development effort. This section
explains what DevStack integration options are available, in relation
to the dev/test cycle and 3rd party CI systems.
Links were not rendered correctly. So this patch takes care of that too.
This patch moves all the models for the NSX plugin currently in trunk
into a single module. The module neutron.db.migration.models.head is
also updated accordingly.
This patches is aimed at simplifying the decomposition of the VMware
NSX plugin.
This patch actually restores vmware unit tests, by adding back
the __init__.py file which was renamed during the advanced
service spinoff and not reinstated when fixing vmware code to
comply with the spinoff.
Furthermore, this patch also fixes a minor issue with context
usage in vmware unit tests which is triggering failures because
of the new database constraint introduced with the commit 79c97120de9cff4d0992b5d41ff4bbf05e890f89
Finally, flake8 tests on vmware directories are also restored
with this patch.
Doug Wiegley [Thu, 5 Feb 2015 03:33:35 +0000 (21:33 -0600)]
Fix breakage in all service repo unit tests, due to duplicate imports of exts
Duplicate imports of the same class + super() are not playing nicely
together, and our unit test base classes cause some dups in the extension
search path, breaking the service repos. This was not noticed earlier
in the extension moving process, because the temporary move code had a crude
mechanism to prevent the loading of same named extensions.
Billy Olsen [Fri, 23 Jan 2015 22:50:40 +0000 (15:50 -0700)]
Refactor logging in loop to only log debug messages once
Logging entries in a loop to a file can be expensive for a large
number of objects (e.g. ports) in a loop. Rather than perform the
overhead of logging a debug entry for each line within the hosts
file, move the debug trace of the contents to after the loop to
bulk up the I/O operations.
When dnsmasq is restarted, it forgets about all leases (since it runs
with leasefile-ro option). When client tries to renew its lease, dnsmasq
sends DHCPNAK reply with message "lease not found". Then client shuts
down the network and re-request lease from DHCP server (and gets exactly
same IP address). There's a small network downtime which affects
services, like zookeeper, running in VMs.
lijianlj [Fri, 16 Jan 2015 09:02:40 +0000 (17:02 +0800)]
Fix extra-dhcp-opt on stateless dhcpv6 subnet
The opts in dnsmasq opt-file is depending on the tag set
in the host-file. When you have only one stateless dhcpv6 subnet,
it will be filtered by the _iter_host() function, and will not be
written to the host-file, this may lead to extra-dhcp-opt not working.
Robert Kukura [Thu, 29 Jan 2015 22:13:00 +0000 (17:13 -0500)]
ML2: Use same port binding logic for DVR ports as non-DVR ports
DVR ports are now bound using the same function,
Ml2Plugin._bind_port_if_needed(), that is used to bind non-DVR ports,
so that concurrent binding attempts are properly handled and mechanism
driver update_port_precommit() and update_port_postcommit() methods
are called. The Ml2Plugin._commit_dvr_port_binding() function is
eliminated, and the DvrPortContext class has been folded into the
PortContext class, reducing duplicated logic.
A followup patch will address the duplication of ML2 DB schema for DVR
and further reduce the duplicated and special-case port binding logic
supporting DVR.
Jakub Libosvar [Fri, 30 Jan 2015 17:30:22 +0000 (18:30 +0100)]
Decrease rpc timeout after agent receives SIGTERM
The patch sets different timeout to rpc api objects in OVS agent after
SIGTERM is received. Given timeout is configurable. This action prevents
long waiting for rpc call() methods to timeout and decreases amount of time
needed to successfully stopping OVS agent.
singhannie [Wed, 31 Dec 2014 11:47:38 +0000 (03:47 -0800)]
Configures RADVD to send managed flag in RA
for DHCP_STATEFUL
RADVD process is configured so that it sends
managed flag in RA for the subnets with
ra_mode set to DHCP_STATEFUL. UT case is
updated to check the presence of managed
flag in config file of RADVD for
DHCP_STATEFUL.