Dan Wendlandt [Tue, 5 Jun 2012 05:07:27 +0000 (22:07 -0700)]
Add common dir for shared agent code, add OVS lib.
bp quantum-agent-common
Adds a common directory that can be used for code shared by agents for
different plugins. Also seeds this directory with an OVS library,
removing that code from the openvswitch plugin itself. This code
can then be leveraged by other plugins (e.g., Ryu) who have similar code.
Also add a suite of mox-based tests for OVS lib.
Also add more powerful OVS flow expression builder as suggested by
salv-orlando, plus additional flow expression testing.
Note: the expectation is that this directory will be used for much of the
agent functionality that is similar to what Nova's nova/network/linux_net.py
file included, such as iptables manipulation, dhcp manipulation, etc.
People should be careful about changing code in this directory in a
non-backward compatible way, as other plugins may be using the code as well.
According to plugin api of QuantumPluginBase, unplug_interface
should only raise exception.NetworkNotFound and exception.PortNotFound.
To unplug a non-attached port should not raise Exception.
After this modification, to unplug an non-attached port will have no impact.
In addition, I remove the 'network = db.network_get(net_id)' since
'db.validate_port_ownership(tenant_id, net_id, port_id)' statement has taken
care of the check.
patch 2: split test case to test it exclusively compared to patch 1.
patch 3: remove added test statement in previous test case
Gary Kotton [Tue, 29 May 2012 12:19:45 +0000 (08:19 -0400)]
Parse linuxbridge plugins using openstack.common.cfg
Implements the blueprint use-common-cfg
In order for the linuxbridge plugin to use the rpc code soon to be merged into
openstack-common, we need to parse our configuration using cfg. Here we
make the most simple, backwards compatible change in that direction.
The same is relevant for the openvswitch implementation
When running ovs_quantum_agent in tunneling mode and a new tunnel_ip is added while
an agent is running the following exception below occurs. This causes the agent to
no longer function since it becomes caught in a loop.
ERROR:__main__:Main-loop Exception:
Traceback (most recent call last):
File "ovs_quantum_agent.py", line 583, in daemon_loop
self.manage_tunnels(tunnel_ips, old_tunnel_ips, db)
File "ovs_quantum_agent.py", line 550, in manage_tunnels
self.add_tun_br_flows_for_local_vlan(lv_obj)
AttributeError: 'OVSQuantumTunnelAgent' object has no attribute 'add_tun_br_flows_for_local_vlan'
Yong Sheng Gong [Fri, 25 May 2012 12:10:07 +0000 (20:10 +0800)]
fix some pylint warnings.
1. Parent class should have instance variables used in its method(s).
2. remove some unused imports
Patch 2: fix according to comments
Patch 4: fix problem under pep8 1.1
Change-Id: Iafd89a6017b30484fb8da50219be6b4ae073f083
mat [Wed, 16 May 2012 14:16:43 +0000 (16:16 +0200)]
Cisco plugin CLI call to quantumclient CLI
when Cisco plugin CLI is used, it wil call the quantumclient CLI if the command is not in its extensions.
the version of the Quantum API must be specified when the the Cisco plugin CLI is looking for Quantum commands.
mat [Tue, 15 May 2012 15:35:12 +0000 (17:35 +0200)]
Calling Super method from QuantumPortAwareScheduler.__init__
the quantum.plugins.cisco.nova.quantum_port_aware_scheduler.QuantumPortAwareScheduler class wasn't calling its superclass __init__.
the host_manager attribute of driver.Scheduler class wasn't initialized, and the scheduler was crashing when it was receiving a host message via amqp.
Dan Wendlandt [Tue, 15 May 2012 19:41:52 +0000 (12:41 -0700)]
OVS plugin: add tunnel ips to central database
bp simplify-ovs-tunnel-mgmt
Makes the OVS plugin agent report its own IP address to the centralized
quantum database, and build its set of tunnels based on the contents of
this centralized database. This removes the need for a removes need for
a 'remote-ips' file on each compute node that needs to be updated
when a new host is added.
Also:
- simplifies error handling within tunnel manager daemon_loop
- fixes issues with operational status not working for tunnel-mode
- fixes issue that not-stripping vlan of tunneled packet potentially
crashes OVS, causing flows to get wiped.
Bhuvan Arumugam [Mon, 7 May 2012 03:27:26 +0000 (20:27 -0700)]
Include AUTHORS in release package.
Fixes Bug #976267.
Include AUTHORS file in release package. The file is generated
automatically from git. Handle different combination for mailmap
records. Include test case to verify this fix.
* MANIFEST.in
Include AUTHORS file in release package.
* .gitignore
Add AUTHORS file.
* quantum/openstack/common/setup.py
generate_authors(): New method to create AUTHORS file. If
AUTHORS.in file exists, append it's content to AUTHORS file.
parse_mailmap(): Handle all mailmap combination while parsing.
* setup.py
Import the new method.
Generate AUTHORS file before creating the package.
* quantum/tests/unit/test_setup.py
New test script to verify different combination of records
in mailmap file.
* This is a massive patch that aims to clean up the codebase
and bring it into compliance with HACKING.rst and PEP8 in one
fell swoop.
* Cleaned up use of gettext.
* Updated log usage for consistency.
* The tests run successfully against all plugins except
cisco and nicira (due to dependency issues with these plugins).
* Addresses bug 981208
* quantum previously depended on python-quantumclient for the
functionality in quantum/common. This change migrates
the required modules to the quantum repo and removes that
dependency.
* Addresses bug 977711
Sumit Naiksatam [Thu, 15 Mar 2012 23:43:19 +0000 (16:43 -0700)]
Bug #956559
VIF driver and scheduler for UCS plugin are broken since the flag
configuration mechanism in nova is changed. Fixing that and also
fixing some property names, along changes to how the quantum client
code is invoked.
> commit d1888a3359345acffd8d0845c137eefd88072112
> Author: Mark McLoughlin <markmc@redhat.com>
> Date: Fri Feb 3 00:50:58 2012 +0000
>
> Remove the last of the gflags shim layer
>
> Make FLAGS a ConfigOpts instance and fix up all the places where we
> expected FlagValues behaviour.
>
> Change-Id: I8f96f42e0d8d30ba6b362d29861e717cf0fa9e89
Bob Kukura [Tue, 13 Mar 2012 21:23:06 +0000 (17:23 -0400)]
Add root_helper to quantum agents.
When running commands that require root privileges, the linuxbridge,
openvswitch, and ryu agent now prepend the commands with the value of
the root_helper config variable. This is set to "sudo" in the plugins'
.ini files, allowing the agent to run as a non-root user with
appropriate sudo privilidges.
If root_helper is changed to "sudo quantum-rootwrap",
then the command being run will be filtered against lists of each
agent's valid commands in quantum/rootwrap. See
http://wiki.openstack.org/Packager/Rootwrap for details.
Fixes bug 948467.
Change-Id: I549515068a4ce8ae480905ec5eaab6257445d0c3 Signed-off-by: Bob Kukura <rkukura@redhat.com>
Dan Wendlandt [Tue, 28 Feb 2012 20:34:49 +0000 (12:34 -0800)]
Fix some plugins that don't check that nets + ports are owned by tenant
bug 942713. This bug confuses the validate_networks() method of
QuantumManager in Nova, causing it to believe that it is valid for a
tenant to plug into a particular network when in fact that network is not
owned by the tenant, nor the "provider".
The patch also adds unit tests to confirm correct plugin behavior.
This patch fixes the issue for the Sample Plugin, the OVS plugin,
the Linux Bridge plugin, and the Ryu plugin, all of which has the
same DB model. Validated the fix with the unit tests.
I couldn't run the unit tests for the NVP plugin standalone, but by
inspection, the code seems to handle this case. I wasn't able to run
the Cisco plugin unit tests, and that code uses its own DB model, so I
am uncertain whether this issue exists in that plugin.
Isaku Yamahata [Sat, 19 Nov 2011 09:17:03 +0000 (18:17 +0900)]
plugin: introduce ryu plugin
blueprint ovs-driver-extention
This patch implements the blueprint ovs-driver-extention
https://blueprints.launchpad.net/quantum/+spec/ovs-driver-extension
This patch factors out ovs common logic from ovs plugin into ovscommon
and adds Ryu NOS plugin.
This patch enhances ovs plugin for generic OVS controller support and
This patch is to add ofp controller support to OVS.
Store ofp controller address in ovs quantum data base.
- nova firewall_driver
- nova linuxnet_interface_driver
There may be ports unmanaged by nova/quantum. Those ports are used
to connect vm to outside of physical machine. They needs special care.
Changes 11 -> 12:
- ryu agent
eliminated from quantum.common import exceptions as exc
- ryu.db.api
eliminated ofp_has_servers
- ryu.nova
eliminated from quantum.plugins.ryu.nova import ovs_utils
and eliminate ovs_utils
Chnages 10 -> 11:
- rebased to a945d1a30478c644d307c77a8a85f3a08e5a834e
- more Maru's review
- setup.py: fix setup() argument
This isn't directly related to ryu plugin though
- improve fake ini file when unit test
remove fake ini file after unit tests.
use StringIO when no file is required.
- LOG: don't use %
Chnages 8 -> 9 -> 10:
- minor fixes: forgot to commit some hunks
Chnages 7 -> 8:
- rebased to d6bf2b76162ba806b2ad1f636f6273e47e03a117
- catch up d6bf2b76162ba806b2ad1f636f6273e47e03a117 change
introduced bin/quantum_ryu_agent
- addressed Maru's review
- avoid custom patching, use mock for test
and added mox and mock to pip-requires
- more pep8
- avoid \ for line continuation
- avoid single char variables
- db.api: first() -> one()
- utilize implicit conversion
var is not None -> var
- and more...
Changes 6 -> 7:
- update comment in ryu/run_tests.py
- make unit tests pass without ryu installed
i.e.
PLUGIN_DIR=quantum/plugins/ryu/ ./run_tests.sh
works now
Changes 3 -> 4:
- reflected Dan's review
- on-OVS in ryu.ini
- update @author
- some naming
Changes 2 -> 3:
- rebased to 04d144ae0b2ad5618847d1784cea48a08d53a46a
- abandoned to share code and duplicated codes from openvswitch plugin
for ovs plugin stability.
- dropped setup_ryu.sh and added README
- update nova driver to catch up upstream change (gflags -> cfg)
Changes 1 -> 2:
- unbreak openvswtich unit test
- MANIFEST.in
Changes 3 -> new 1:
- rebased to 1eb3c693b5f6f3f301047100c36c7915434f8be7
- factor out common loginc from openvswitch plugin into ovscommon
- Introduced a new independent ryu plugin
- try new review due to the previous effort was marked abandoned.
> https://review.openstack.org/#change,3055
> Change-Id: I17801a7a74d4087838a8a26c1b1f97f28c2dcef3
Dave Lapsley [Tue, 21 Feb 2012 07:41:14 +0000 (02:41 -0500)]
blueprint quantum-ovs-tunnel-agent
Enhance existing Quantum OVS Plugin with a tunneling agent that
enables Hypervisors to be connected via GRE tunnels. The new agent
can be enabled/disabled via configuration file and provides backwards
compatibility with existing non-tunneling OVS Agent.
This patch fixes bug 938637
Quantum unittests doesn't pass with plugin (openvswitch, linuxbridge) in venv
as follows.
This is because config file under <quantum src>/etc/ can't be find due to
FLAGS.state_path points to <python-quantumclient src> which can be different
from <quantum src>.
Set FLAGS.state_path to <quantum src> when quantum unit tests.
$ PLUGIN_DIR=quantum/plugins/openvswitch ./run_tests.sh -V
<snip>
ActionExtensionTest
test_extended_action_for_adding_extra_data (quantum.tests.unit.test_extensions.ActionExtensionTest)ERROR
<snip>
======================================================================
ERROR: test_extended_action_for_adding_extra_data (quantum.tests.unit.test_extensions.ActionExtensionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/quantum/tests/unit/test_extensions.py", line 212, in setUp
self.extension_app = setup_extensions_test_app()
File "/quantum-src/quantum/tests/unit/test_extensions.py", line 474, in setup_extensions_test_app
return TestApp(setup_extensions_middleware(extension_manager))
File "/quantum-src/quantum/tests/unit/test_extensions.py", line 469, in setup_extensions_middleware
conf, app = config.load_paste_app('extensions_test_app', options, None)
File "/quantum-src/.venv/src/python-quantumclient/quantum/common/config.py", line 316, in load_paste_app
conf_file, conf = load_paste_config(app_name, options, args)
File "/quantum-src/.venv/src/python-quantumclient/quantum/common/config.py", line 286, in load_paste_config
"Cannot load application %s" % app_name)
RuntimeError: Unable to locate any configuration file. Cannot load application extensions_test_app
-------------------- >> begin captured logging << --------------------
quantum.extensions.extensions: INFO: Initializing extension manager.
quantum.extensions.extensions: INFO: Loading extension file: foxinsocks.py
quantum.extensions.extensions: DEBUG: Ext name: Fox In Socks
quantum.extensions.extensions: DEBUG: Ext alias: FOXNSOX
quantum.extensions.extensions: DEBUG: Ext description: The Fox In Socks Extension
quantum.extensions.extensions: DEBUG: Ext namespace: http://www.fox.in.socks/api/ext/pie/v1.0
quantum.extensions.extensions: DEBUG: Ext updated: 2011-01-22T13:25:27-06:00
quantum.extensions.extensions: WARNING: Loaded extension: FOXNSOX
quantum.extensions.extensions: INFO: Loading extension file: __init__.py
quantum.extensions.extensions: INFO: Loading extension file: foxinsocks.pyc
quantum.extensions.extensions: INFO: Loading extension file: __init__.pyc
--------------------- >> end captured logging << ---------------------
Bob Kukura [Fri, 17 Feb 2012 22:00:52 +0000 (17:00 -0500)]
Cleanup the source distribution.
Missing text files such as LICENSE and various READMEs are now
included in the tarball source distribution. The Makefile and shell
script for installing the openvswitch agent on xen are also now
included. The openvswitch and linuxbridge agents are included, and
executable wrapper scripts for the agents are provided. The cisco and
linuxbridge nova drivers are now setup to be run from the quantum
namespace rather than copied to nova. Finally, the setup_*.py scripts
have been removed from the project. Fixes bug 925074.
Test by running "python setup.py sdist" and examining the generated
tarball.
Change-Id: I33d336a5eb13678e6d527b575958393b337b6f3d Signed-off-by: Bob Kukura <rkukura@redhat.com>