Dan Wendlandt [Sun, 12 Aug 2012 02:42:59 +0000 (19:42 -0700)]
Linux Agent improvements for L3
prereq for bp quantum-l3-fw-nat
- make init_l3 take cidrs, rather than assuming an augmented port object
- make namespace for agent operations optional and allow the namespace
name to be configured.
- allow plug() operation to take an optional bridge parameter indicating
which bridge to plug into
- add namespace support for iptables manager
- make OVS plug() set the IP address, etc. of a device even if it already
exists.
This fix moves the correct device into the namespace and improves the test
to ensure the proper device was moved. The previous generic check
failed to catch an error during refactoring.
when deleting a port that uses the gateway IP, we were not removing
the IPAllocation entry, which resulted in a depedency issue when we
deleted the port that the IPAllocation entry referenced.
The base mac will now be validated when the configuration file is read.
In addition to this the following has been done:
1. checks validaity of the base mac - for example it cannot be a multicast MAC
2. adds a framework for attributes tests
The original policy framework allowed new policy checks to be created
through inheritance. This is somewhat clunky and unnecessary in
Python. This change refactors policy.py to allow new policy checks
to be registered using an @register() decorator. One consequence is
that HttpBrain is deprecated.
Care has been taken to ensure backwards compatibility; deprecation
warnings will be emitted for uses of HttpBrain or the inheritance-
based checks.
(Pull-up from openstack-common, with deprecation of HttpBrain.)
The openstack-common project already does its own pep8 checks; we
don't need to duplicate the effort. This also avoids issues with
pep8 version skew between projects.
Nachi Ueno [Fri, 3 Aug 2012 01:37:34 +0000 (01:37 +0000)]
Make 4th octet of mac_range configurable.
Fix bug 1022739.
To get OUI per cluster is not realistic. So This commit
make 4th octet of mac_range configurable. By this commit,
the cloud provider can allocate OUI (3 octets) + 1 extra octet
range (4 octets) for each cluster.
The openswitch plugin's in-memory VlanMap is replaced with a vlan_ids
DB table similar to that used by the linuxbridge plugin. This will
prevent conflicting VLAN assignments if multiple server replicas are
run, and also sets the stage for phase 2 of the provider-networks BP
implementation that will add support for multiple physical
networks.
Unlike with the current linuxbridge plugin, the contents of the
openvswitch plugin's vlan_ids table are properly updated at startup in
case the vlan_min or vlan_max configuration variables have changed.
A new test_ovs_db test case has been added.
The primary key of the vlan_bindings table is changed from the vlan_id
to the network_id, which is now a foreign key, and network deletion is
now properly handled.
The net_id has been removed from the VlanIdInUse exception, requiring
a minor update to the linuxbridge plugin. The new NoNetworksAvailable
exception, with ResourceExhausted as its base class, is returned when
no more VLANs are available.
Notification for network/subnet/port create/delete/update.
blueprint quantum-notifications
Add host configuration into conf, which is determined by socket.gethostname()
function by default. Host name is part of publiser id, which is in the format
of 'network'.$host.
We add create/update/delete start and end notification for each kind of resource.
By default, the notification do nothing since the notifier driver is no_op_notifier.
We can define it in quantum.conf.
"from quantum.common import config as logging_config" was missing for
ryu agent.
"from quantum.openstack.common import cfg" was missing for ryu plugin.
And unused imports is eliminated.
The current api-paste.ini does not provide a way to choose a pipeline:
there is no way to switching a pipeline between keystone-enabled and
noauth pipelines without modifying the pipeline directly.
This commit introduces 'auth_strategy' flag to quantum.conf and
a pipeline used is determined depending on the flag. Supported values for
this flag are 'keystone' (default) and 'noauth' at the moment.
Gary Kotton [Tue, 24 Jul 2012 17:15:54 +0000 (13:15 -0400)]
Enable agents and plugins to use the same configuration file.
The change also implements blueprint agent-logging (this
was due to the fact that the existing logging in the agents
did not work with the change)
Devstack support for the above is in
https://review.openstack.org/10267
Notes:
- The service and agent can be run with multiple configuration
files by using the CLI parameters --config-file <filename>
- The agent now makes use of the logging and debugging flags
defined in quantum.conf. This follows the standard common
configuration command line rules.
Gary Kotton [Tue, 24 Jul 2012 06:28:56 +0000 (02:28 -0400)]
Update openstack-common files.
The RPC support requires that the fanout_cast messages enable
the application to set the topic. This was fixed in
https://review.openstack.org/#/c/10125/.
Bob Kukura [Fri, 15 Jun 2012 14:20:05 +0000 (10:20 -0400)]
Initial V2 implementation of provider extension.
Initial provider extension implementation. Specify vlan_id using the
CLI with admin rights via "net-create --tenant_id <tenant-id>
<net-name> --provider:vlan_id <vlan-id>". Also includes
provider:vlan_id in reply messages for admins. The extension is
supported in the linuxbridge and openvswitch plugins.
Bob Kukura [Mon, 16 Jul 2012 00:45:25 +0000 (20:45 -0400)]
Implements data-driven views and extended attributes.
The quantum/api/v2/views.py module is replaced by is_visible
properties in the RESOURCE_ATTRIBUTE_MAP defined in
quantum/api/v2/attributes.py. Extensions are given the ability to add
extended attribute descriptions to this map during initialization,
allowing extended attributes to be implemented similarly to core
attributes in plugins.
Add v2 API support for the Cisco plugin
Blueprint cisco-plugin-v2-api-support
New meta-plugin which makes use of the Quantum db_plugin and supports
the new v2 API
Changes to the Cisco DB model, now reusing quantum DB for core attributes
Changes to the device sub plugins to access the quantum DB for core
resources' state versus Cisco DB
Addition of fake/dummy drivers to support testing of the device sub
plugins even without actual hardware
New v2 unit tests which exercise the meta-plugin and the device sub
-plugins as well
In general creating new v2 modules such that v1.x code can be deprecated
easily by deleting the older modules. The following files are v2
versions of older modules, only the imports have changed, most of the
other code is the same as from the older modules (already reviewed):
quantum/plugins/cisco/common/cisco_credentials_v2.py
quantum/plugins/cisco/db/network_db_v2.py
quantum/plugins/cisco/db/network_models_v2.py
quantum/plugins/cisco/db/nexus_db_v2.py
quantum/plugins/cisco/db/nexus_models_v2.py
quantum/plugins/cisco/db/ucs_db_v2.py
quantum/plugins/cisco/db/ucs_models_v2.py
quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py
quantum/plugins/cisco/ucs/cisco_ucs_inventory_v2.py
quantum/plugins/cisco/ucs/cisco_ucs_plugin_v2.py
quantum/plugins/cisco/segmentation/l2network_vlan_mgr_v2.py
fix bug lp:1025526,update iniparser.py to accept empty value.
also,this patch turn off pep8 E125 check,this for now seems to
be unnecessary,it check continuous line split.and update the
latest openstack-common https://review.openstack.org/#/c/9201
which has fix pep8 1.3 issue except for E125 check.
The code enable defining validity checks for input variables. This
is done via callback functions per type. The following types are supported:
- type:values - checks that data is valid according to a list of values
- type:mac_address - checks that data is a valid mac address
- type:ip_address - checks that data is a valid ip address
- type:subnet - checks that data is a valid cidr
- type:regex - checks that data matches a regular expression (for
example checking UUID validity)
Ensures that each attribute which is used by the policy engine is not
removed by the plugin when the 'fields' query parameter is specified.
This could be better achieved by not having the plugin perform this
selection, but as it is part of the plugin interface, it's probably better
not to introduce changes which alter it.
Because the openstack common project does not stick to latest pep8 rules,
I have to exclude some bad-ruled files in the tox.ini and run_tests.sh.
However pep8 does not support exclude option in the format quantum/openstack/common,
so I have to exclude some of openstack common files one by one.
Also, I have changed the Qunatum Context to base on the common context.
I does not update the setup.py in our openstack common dir and the one
under quantum top dir, since it should be maintained in a consistent way
across all of openstack projects.
After this introduction, we are ready for notification feature.
The router will simply use the QuantumManager which stores the instance
of the plugin being used by the Quantum server. Changes to unit tests
are for ensuring plugin instances are recycled across tests.
Gary Kotton [Sun, 8 Jul 2012 12:05:46 +0000 (08:05 -0400)]
Enable quantum agents to work with global cfg.CONF
This implements blueprint global-config-support
A common configuration parse function is used by the service and the agent.
In the case of the service, when loading the plugin, the configuration file
will be appended to the existing cfg.CONF (this was originally created when
quantum.conf was loaded).
In the case of the agent a global cfg.CONF will be created.
This task is a prerequisite for the RPC integration into Quantum.
Dan Wendlandt [Sun, 8 Jul 2012 19:34:22 +0000 (12:34 -0700)]
Fix v2 API policy checks when keystone is in use.
bug 1022032. There were significant errors in how
the policy framework was being invoked, but existing
tests did now show them, since they always invoked the
API with no keystone context. This patch fixes those
issues and add a significant amount of test coverage
simulating API calls with keystone enabled.
As part of this patch, we also needed to add a tenant-id
attribute to the subnet object. Furthermore, we
changed the API validation code to prevent tenant-id from
being changed with a PUT, since changing it after creation
could invalidate some of the create checks we're planning
on adding (e.g., that a port is being created on a network
owned by the same tenant).
This changeset adds a new parameter, 'allocation_pools' to the 'subnet'
resource of the Quantum v2 API.
Allows for creating and validation of subnets with multiple allocation pools.
This commit only deals with POST verb (subnet creation).
PUT verb (subnet update) will be dealt with in a subsequent commit.
Gary Kotton [Thu, 28 Jun 2012 10:26:10 +0000 (06:26 -0400)]
v2 support for the linux bridge plugin
blueprint lb-api-v2-support
Plugin support for the linuxbridge using the v2 API
1. The core_plugin in quantum.conf must be set to:
quantum.plugins.linuxbridge.LinuxBridgePluginV2.LinuxBridgePluginV2
2. By default the agent is v2. A configuration file entry 'target_v2_api'
in the section 'AGENT' can be set as False to support v1.
Gary Kotton [Sun, 1 Jul 2012 07:06:07 +0000 (03:06 -0400)]
Check if interface exists in bridge prior to adding.
This fixes bug 1019730. The fix for bug 1000406 ensures that return
values of shell commands are checked. The command
utils.execute(['brctl', 'addif', bridge_name, interface],
root_helper=self.root_helper)
would cause an exception if there was more than one attachment
on the network. The reason for this was the interface already existed
on the bridge.
Monty Taylor [Thu, 28 Jun 2012 14:45:35 +0000 (07:45 -0700)]
Use setuptools git plugin for file inclusion.
Fixes bug 1018833. We're looking at this as a possible pan-project
option instead of manual MANIFEST.in inclusion and then looking for
where the tarballs differ.