'status' have four values 'ACTIVE/DOWN/ERROR/BUILD' in v2 spec.
However, some plugins still using 'UP/DOWN' from v1. In order to
consistent the use of 'status' value. A common constant file was
created and modified all plugins to use the same constant value.
This fix is phase 1 of a fix that to address re-allocation of a fixed_ip before
the DHCP lease expires. The next phases will add RPC and recycling
support.
We implement it as an extension for linux bridge and ovs plugins.
We also expose the /quotas/Xx url to client to operate the quota.
We need admin role to show other tenant's quota, and to update quota data.
Any user can show its own tenant's quota. An DB table is used to save the
quota for each tenant.
To use it, we have in quantum.conf:
quota_driver = quantum.extensions._quotav2_driver.DbQuotaDriver
The default quotas for each tenant are defined in quantum.conf too.
In addition, modify extension framework to allow exposing a new resource and
its controler. The extension can check the environment, such as configuration
in global cfg.CONF to decide if it can be enabled.
Also, we can define enabled extensions for each plugin in extensions.py
New resources can be put into quota framework via quota_items in nova.conf
The run_tests.sh script's PEP8 pass (with current 1.3.3) was
reporting under- or over-indented visual continuations in a handful
of files, all of which are fixed with this trivial patch.
The provider extension is supported by the linuxbridge and openvswitch
plugins and their agents [openvswitch phase 2 implementation is
in-progress, and does not yet support flat networks or multiple
interfaces].
Ranges of VLANs available on named physical networks for normal
allocation are specified in the plugin's config file via the
ListOpt syntax:
The mapping of each named physical network to its physical network
interface is specified (per-agent-host) in the agent's config file via
the ListOpt syntax:
Nachi Ueno [Mon, 13 Aug 2012 08:13:20 +0000 (08:13 +0000)]
Add device_owner attribute to port
in order for firewall logic to be able to poke a hole allowing traffic to/from a DHCP server,
we need to expose the IP being used for DHCP in a subnet to external entities.
This commit adds device_owner attribute, then dhcp-agent will update the device_owner value
of port to dhcp-agent.
The API layer is now able to issue bulk create requests to the plugin,
assuming that the plugin supports them. Otherwise, the API layer will
emulate atomic behavior.
This patch also implements OVS plugin support for bulk requests.
Dan Wendlandt [Mon, 13 Aug 2012 12:20:11 +0000 (05:20 -0700)]
improve test_db_plugin so it can be leveraged by extension tests
prereq for bp quantum-l3-fwd-nat
- load extension middleware as well as core API
- support 'action' requests in addition to CRUD ops
- add helper methods that check API return code
- clean-up places where existing tests where hitting 409s on delete
but ignoring the errors (basically SubnetInUse errors).
This patch allows Quantum to handle public networks. It modifies the
API adding a new attribute to the network resource ('shared')
and enhances the policy engine in order to handle the behaviour of
the service wrt shared networks.
Policy.json specifies a default behaviour which can be changed by
the administrator, even at runtime.
Tests added to test_db_plugin validate 'obvious' behaviour - such as
that only the ports belonging to a given tenant should be returned
even when they are queried on a public network.
Tests added to test_policy instead validate the changes added to the
policy engine.
This plugin supports multiple plugins at same time. This plugin is for L3 connectivility
between networks which are realized by different plugins. This plugin add new attribute 'flavor:id'.
flavor:id correspond to specific plugin. flavor-plugin mapping could be configureable by plugin_list config.
This plugin also support extensions. We can map extension to plugin by using extension_map config.
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.