Miguel Angel Ajo [Tue, 11 Aug 2015 11:51:16 +0000 (13:51 +0200)]
Fix the low level OVS driver to really do egress
It seems that the Queue + QoS + linux-htb implementation was really
limiting ingress by default. So this patch switches the implementation
to the ovs ingress_policing_rate and ingress_policing_burst parameters
of the Interface table.
Later in time we may want to revise this, to make TC & queueing possible,
but this is good enough for egress limiting.
Also, removed the _update_bandwidth_limit del+set on OvS QoS driver for
the bandwidth limit rule update, since that's not needed anymore.
Miguel Angel Ajo [Tue, 11 Aug 2015 14:47:23 +0000 (16:47 +0200)]
Update documentation acording to last QoS/OvS changes
Change Ie802a235ae19bf679ba638563ac7377337448f2a introduces
a few changes to the low level ovs implementation of QoS,
this patch updates documentation.
Ihar Hrachyshka [Mon, 10 Aug 2015 16:51:24 +0000 (18:51 +0200)]
devref: update quality_of_service
- note that we do not use versioning features of oslo.versionedobjects
yet;
- described the flow of updates from agent perspective;
- mentioned the delete_port API of QoS drivers;
- removed SR-IOV from the list of supported drivers since it's not in
yet.
Moshe Levi [Tue, 11 Aug 2015 04:08:11 +0000 (07:08 +0300)]
SR-IOV: Convert max rate from kbps to Mbps
ip link tool configures max rate in Mbps and
it the QoS model max rate is defined in kbps. This
patch convert the max rate from kbps to Mbps. Also
because zero disables the rate limit the min value
is 1Mbps and not 1kbps.
Ihar Hrachyshka [Mon, 10 Aug 2015 06:29:52 +0000 (08:29 +0200)]
Removed configuration option for qos agent driver selection
There is no (general) use case to allow users to configure qos driver to
load by qos l2 agent extension. So instead of getting the driver name
from the configuration file, hardcode it and potentially reuse for other
extensions that may also be interested in splitting extension into
agent agnostic and agent specific pieces.
Added driver_type parameter to AgentCoreResourceExtension.initialize().
Also updated the method signature to reflect that we expect l2
extensions to receive connection.
Finally, removed #noqa import for openvswitch.common.config from qos
extension unit test since it seems unneeded.
Moshe Levi [Mon, 10 Aug 2015 11:43:55 +0000 (14:43 +0300)]
Add delete_port api to agent extension manager
This commit add delete_port api to the agent
extension manager, the agent extension and the qos
etension, and it update the ovs agent to call it upon
delete port.
Miguel Angel Ajo [Mon, 10 Aug 2015 13:32:57 +0000 (15:32 +0200)]
Functional test for QoS policy bandwidth rule update
Creates a port in a policy, and subsequently modifies the
bandwidth limit rule in the policy, then verifies that the
new limits are assigned to the port.
Ihar Hrachyshka [Mon, 10 Aug 2015 06:57:41 +0000 (08:57 +0200)]
resources_rpc: fixed singleton behavior for ResourcesPullRpcApi
__init__ is called for any __call__ on a class, no matter whether it is
a singleton. Meaning, client was reinitialized every time a caller
instantiated the Rpc class. That's not a critical issue, but a minor
performance hit.
Jakub Libosvar [Mon, 10 Aug 2015 08:37:13 +0000 (08:37 +0000)]
Add thread locks on port routines for qos ext
Only one routine can be executed at one time. Handling port updates or
creations is a critical section of qos agent extension. With this patch
only one routine can be executed and in case of incoming update/create,
execution routine must wait until second routine is done with its job.
Moshe Levi [Mon, 10 Aug 2015 07:06:00 +0000 (10:06 +0300)]
SR-IOV: fixed singletion behavior for ESwitchManager
__init__ is called for any __call__ on a class, no matter whether it is
a singleton. Meaning, client was reinitialized every time a caller
instantiated the ESwitchManager which break the SR-IOV agent when working
with agent qos extension.
Nir Magnezi [Sun, 2 Aug 2015 12:56:56 +0000 (08:56 -0400)]
Fix get_objects to allow filtering
At the moment, an attempt to retrieve a list of objects (like qos
policy) and filter by name fails, because get_objects does not use
filters and therefore, upon query by object name, the server replies
with a list of all created objects (instead of a partial list).
Ihar Hrachyshka [Fri, 7 Aug 2015 22:21:09 +0000 (00:21 +0200)]
QoS core extension: fixed dict extension when QoS policy is unset
Previously, if QoS policy was detached from a core resource, core
resource extension didn't update the resource dict with the new QoS
policy value (None), and that resulted in no notification sent to the
agent about the change, so QoS rules were not flushed from the affected
ports.
OVS agent QoS extension functional test for bandwidth limit rules
This functional test spawns the OVS agent, with bandwidth limit rules in
a policy attached to ports. Then it asserts that the low level OVS
bandwidth limits are set for each port.
To make this possible we refactor and extract the base OVS agent test
framework into neutron.tests.functional.agent.l2.base.
Jakub Libosvar [Mon, 3 Aug 2015 15:48:02 +0000 (15:48 +0000)]
Add rpc agent api and callbacks to resources_rpc
This patch also refactors existing test cases for server side rpc
classes in order to test code in generic manner. Finally, we remove
notify() and get_resource() from consumers or producers modules
respectively in order to remove circular dependencies. The notificitaion
driver will send events directly using RPC api class instead of going
through registry.
Co-Authored-By: Miguel Angel Ajo <mangelajo@redhat.com>
Partially-Implements: blueprint quantum-qos-api
Change-Id: I9120748505856acc7aa8d15d896697dd8487bb02
Miguel Angel Ajo [Fri, 24 Jul 2015 00:45:35 +0000 (02:45 +0200)]
neutron.api.rpc.callbacks interface rework
Split rpc.callbacks interface into consumer and producer parts.
Better terms are chosen for two RPC APIs we have:
- pull when a component actively requests a new object state;
- push when a component updates anyone interested about an object
change.
Also, for callback registration, the following terms are used:
- subscribe when a component is registered in consumer registry;
- provide when a component is registered in provider registry.
Covered the registries with some unit tests.
Lots of existing tests utilize the registries now, and need to be
isolated from other tests that mess with the managers (that are
singletons), so introduced a common qos base test class to mock the
manager with per-test instance of it).
Ihar Hrachyshka [Thu, 6 Aug 2015 14:59:53 +0000 (16:59 +0200)]
Introduce base interface for core resource extensions
The interface can be found in neutron.core_extensions.base.
Adopted the interface in qos core resource extension.
Alos moved qos_extension under neutron.core_extensions.qos. Partially,
this is to avoid confusion around the fact that the module does not
really contain a neutron API extension but core resource extension.
Since we don't want rule_types API to misbehave by claiming support for
QoS for linuxbridge ml2 driver, let's trade API test for its
service correctness.
Note that we cannot enforce the supported rule_types for actual CRUD
operations because then we would need to disable the whole API test
coverage for rules, and we don't want it.
This suggests we should get Linux Bridge support in some way or another.
Ihar Hrachyshka [Fri, 7 Aug 2015 11:50:07 +0000 (13:50 +0200)]
Clean up QoS rules first, then QoS policies
Since policy deletion kills all rules by CASCADE, cleaning rules up
after policies is basically no-op. Instead, let's swap the order and
in that way implicitly cover rule deletions.
Initialize ancillary_port_info dict as blank in OVS agent
The first assignment of ancillary_port_info was from the scan_ancillary_ports
function which could result in an exception and result in ancillary_port_info
being unbound for the port stats scan below.
This patch just initializes ancillary_port_info as an empty dict so the port
stats will always have an input.
Assaf Muller [Thu, 7 May 2015 06:02:59 +0000 (09:02 +0300)]
Enable fullstack multinode tests, add L3 HA test exemplar
* Created a 'resources' subdir and moved all fixture files
to it.
* Split ML2ConfigFixture to the server-side ml2 configuration
fixture, and the OVS agent configuration fixture.
* Neutron process logs were using H:M:S format as their file name,
but when starting multiple agents of the same type my machine
was fast enough to do that in the same second so that different
processes were outputting to the same log file. No good!
Added ms to the log name format. I also changed the log time
from UTC to local timezone.
* Renamed and moved 'FullstackFixture' to neutron/tests/fullstack/
resources/environment.Environment
* Added a 'Host' abstraction that groups agents that report with
the same 'host' value. Hosts may be interconnected by the
environment via shared bridges.
* The 'Environment' class will accept global
attributes (This will be later filled with stuff like tunneling,
l2pop or other environment-level flags), and in this patch accepts
a list of host attributes (Configuration that may differ between
hosts like the l3 agent mode [legacy, dvr, dvr_snat]).
* Made OVS agent and L3 agent fixtures expose their bridges
so that I could interconnect them.
* Added a super simple L3 HA test to show that this entire thing
works.
Moshe Levi [Sun, 2 Aug 2015 09:58:54 +0000 (12:58 +0300)]
SR-IOV: Update eswitch manager to support rate
This patch update the eswitch manager to support
max rate on VF, moreover it updates the eswitch
manager to be singleton so it can be called from the
SR-IOV qos driver.
Ihar Hrachyshka [Tue, 4 Aug 2015 13:29:37 +0000 (15:29 +0200)]
Follow up with some cleanup for agent qos_driver
Removed error handling for missing rule type handler since the rule type
is already filtered thru supported types for the backend, so in case the
handler is really not present, that's a huge bug in the qos driver
extension and should not be handled gracefully.
John Schwarz [Mon, 3 Aug 2015 15:33:44 +0000 (18:33 +0300)]
Gracefully handle duplicate rule creation
Previously, creating a second bandwidth limit rule for a policy raised
an uncaught exception, which eventually caused 'ServerFault' on the
client side. This patch replaces this exception with a NeutronException
which leads to a more correct 'Conflict' error instead.
Note that the code is implemented in the base object class. This means
that future versioned objects will also feature this restriction if
their database implies that no duplicate entries can be created.
John Davidge [Thu, 16 Jul 2015 17:26:24 +0000 (18:26 +0100)]
DB, IPAM & RPC changes for IPv6 Prefix Delegation
This patch includes the DB, IPAM & RPC changes needed for the IPv6 Prefix
Delegation feature.
To enable this feature, the subnetpool_id attribute of subnets has been
modified to allow for a special subnetpool identifier - "prefix_delegation".
WORKFLOW:
1. Admin sets default_ipv6_subnet_pool in neutron.conf to "prefix_delegation"
2. User creates a new IPv6 subnet without a CIDR or subnetpool ID
3. User creates an interface between this subnet and a router with an existing
external interface
The agent-side changes will follow in separate patches.
A documentation patch is up for review here:
https://review.openstack.org/#/c/178739
Video guides for configuring and using this feature are available on
YouTube:
Cyril Roelandt [Wed, 5 Aug 2015 09:39:50 +0000 (11:39 +0200)]
Python 3: convert dict_keys object to list
This makes sure we use the same types in Python 2 and 3, prevents TypeErrors
from happening, and should have no performance impact since the the lists are
quite small anyway.
Henry Gessau [Wed, 5 Aug 2015 01:29:46 +0000 (21:29 -0400)]
Remove VPN from API tests
Change Idd5524ed0b602408be5a53830981a8ab974b390c removed the
VPN service from devstack installations in the gate, so now we
can no longer test VPN APIs from neutron. The tests will be
added to the vpnaas repo's API test suite.
Moshe Levi [Tue, 28 Jul 2015 12:46:10 +0000 (15:46 +0300)]
Update OVS driver to work with objects
This patch updates the QoS OVS driver to work with policy NeutronObjects
that are passed by the agent extension manager, instead of lists of rule
dicts, as we originally expected. It also adds validation that the
rules that are sent by the neutron-server are actually supported by the
backend.
Finally, port dict was not really enough to determine the name of the
port in ovsdb. 'name' field is not really present in all port dicts, and
does not reflect what is known to ovs anyway. So instead, we should
rely on vif_port object to determine the ovs port name. Since ovs agent
only added the vif_port value to details dict when binding was desired,
I made adding the vif_port object unconditional, and covered that fact
with unit tests.
With this patch in place, I was able to get policy rules applied to a
port in devstack installation. Functional tests will belong to a
follow-up.
Cyril Roelandt [Tue, 4 Aug 2015 12:27:48 +0000 (14:27 +0200)]
Python 3: fix test_ovs_tunnel
In Python 3, this happens:
>>> d = {}
>>> a = d.values()
>>> b = d.values()
>>> a == b
False
And anyway we're not really willing to pass dict_values objects around; we are
expecting lists, just like in Python 2, so let's just do the conversion.
John Schwarz [Mon, 3 Aug 2015 12:49:13 +0000 (15:49 +0300)]
Add API tests for non-accessible policies
Tests which dealt with creating a rule for a policy that the tenant has
no access to, or for a policy which does not even exist, were missing.
This patch adds them.
John Schwarz [Mon, 3 Aug 2015 13:56:27 +0000 (16:56 +0300)]
Gracefully handle fetching nonexistent rule
Currently, if we invoke the API for 'show rule' but the rule does not
exist, an exception is raised from deep within Neutron. This in turns
causes an uncaught exception and the user will see 'ServerFault'. This
patch proposes a fix for this scenario - the case where the rule does
not exist is handled and a NeutronException is caused, causing a proper
'NotFound' error on the client side instead.