The original bug occurred because the set of subnet cidrs changed
without a restart of dnsmasq. As a result, dnsmasq would not respond
with offers for fixed_ips assigned in the unknown cidr ranges even when
the underlying host file had properly updated.
This patch addresses the bug by restarting dnsmasq when the set of
subnet cidrs changes. When the set does not change, it will reload the
options and allocations.
This patch adds specific filters for the ip command. The first filter
matches ip with any subcomand except netns exec. The second filter
matches "ip netns exec" and then relies on the caller (match_filter) to
verify the sub-command against the other filters. Matching the
subcommand separately allows for a single set of filter definitions that
work with and without namespaces.
Adds namespace clean up utility called quantum-netns-cleanup which can be used
to remove old namespaces.
The --force option can be used to remove all Quantum namespaces and any
remaining devices. The force option is should not be run on a live Quantum
systems. It is intended for cleaning up devstack a after running
unstack.sh (ideally this will be added to unstack.sh in the future).
Example cmd line when cleaning up a devstack install:
quantum-netns-cleanup --config-file /etc/quantum/quantum.conf \
--config-file /etc/quantum/dhcp_agent.ini --force
This patch also ensures that the local vlan mapping is updated correctly.
This was problematic in the event that the OVS agent would start and a port
was in administrative state down.
The fix follows the patch that was done on the DHCP agent to enable
the user to configure the usage of namespaces. In the event that
namspaces are disabled the agent is limited to running only one
router. The agent needs to define the router_id that is supported.
The process in this case is:
1. create router
2. start agent with router id
Previously, some netns commands were executed in the context of the
namespace defined in the wrapper. These commands should be be executed in
the root namespace for the most reliable results.
This is the 3rd and final patch for this bug. This patch alters ip allocation
recycling to honor lease expiration. Allocations that are in the
expiration wait state have null port_ids.
Bob Kukura [Fri, 31 Aug 2012 04:12:41 +0000 (00:12 -0400)]
expose openvswitch GRE tunnel_id via provider API
The provider:vlan_id extended attribute is renamed to
provider:segmentation_id, and the openvswitch plugin returns the
tunnel_id of GRE networks as this attribute.
- Rename provider:vlan_id to provider:segmentation_id.
- Use consts for providernet extension's attribute names
- Remove validation clause from provider:segmentation_id resource attribute map data.
- Validate provider:segmentation_id in linuxbridge and openvswitch plugins.
- Rename physical_id to segmentation_id in the openvswitch schema, plugin, and agent.
The bug noticed that an admin user could delete a port that stored
the underlying IP allocation for a floating IP. This patch prevents
the direction deletion of ports via the API for ports that are used as
router interfaces, router gateways, of for floating IPs.
Add a unit test to check such an invalid delete, and also updates
unit tests to avoid them tripping over the new checks.
siyingchun [Wed, 29 Aug 2012 01:22:26 +0000 (09:22 +0800)]
Modified code PEP8 warning.
*Find more than one space after keywords, then eat one.
*Make sure every continuation line is aligned with the first character after
the top parenthesis in the top line.
Bob Kukura [Wed, 15 Aug 2012 06:43:17 +0000 (02:43 -0400)]
Implementation of 2nd phase of provider extension for openswitch
Enhances openvswitch plugin to support flat networks and VLANs on
multiple physical networks via the provider extension. Implements
blueprint provider-networks.
See http://wiki.openstack.org/ConfigureOpenvswitch for
configuration and usage details.
A devstack patch to support the updated openvswitch configuration
variables is at https://review.openstack.org/#/c/11418/.
Summary: Copy/paste the essential parts of the rootwrap
mechanism from nova/cinder into quantum. This includes
the core changes to filter.py and wrapper.py which deal
with loading filters from files pointed to by
rootwrap.conf
Detailed changes:
Transliterate the old rootwrap/*-agent.py files to
new format, and put the results in etc/quantum/rootwrap.d
Delete the *-agent.py files.
Add conf to point to etc/quantum/rootwrap.d
Add a unit test cribbed from nova to exercise the filter
mechanism
Add a unit test to exercise the actual filtered execution
Note that as written, this patch does not set the default
execute mechanism (in the agent .ini files) to rootwrap,
leaves it as sudo. That can be done in a followon
change, or in distro specific packaging.
Note also that there is still work to do around finishing
and testing the filter specs themselves. We've decided
that that is out of scope for this patch.
Port has no 'host_routes' attribute according to the latest V2 API
specification. So, policy check for 'host_routes' is not need any
more, just remove it in this patch.
Currently, the cisco nexus sub-plugin doesn’t handle the network admin state parameter
when it’s updated. The fix would enable the sub-plugin to handle an update of the admin
state of the network. In update_network of the nexus sub-plugin, vlan corresponding to that network
is added/removed from the nexus interfaces based on the network state. Unit tests are added as well.
This patch fixes a bug in delete_network and delete_subnet where the InUse
exception was being thrown for resources owned by the network and not
the tenant. This patch force deletes network resources if they are the
only blocker to deleting the parent resource.
Yusuke Muraoka [Tue, 28 Aug 2012 09:59:42 +0000 (09:59 +0000)]
Plugin aware extensions should also be reset at each test setup
PluginAwareExtensionManager caches extension according plugin.
At each db plugin test setup, testing plugin and router are newly
created.
However, the extension manager held the extensions for first time
loaded plugin. Because of their cache.
So if a plugin conditional extension exists, it could not be loaded by
testing order.
In the event that an IP address and gateway are defined on an interface that is
used in a flat network, then the interface details will be copied to the
bridge when it is created.
If the network is deleted then the IP addresses are returned to the interface.
On account of the new requirement to run plugin-specific tests also
along with the Quantum tests, changes are being made to
incorporate the Cisco plugin unit tests into the Quantum unit test
suite. Earlier unit tests have been moved and modified.
the fact that these plugins ever cleared this field is probably just a
misunderstanding of how the field is supposed to be used, as I don't think
it ever makes sense for the L2 plugin logic to change this field.
This is phase 2 of the bug fix. This changeset adds support for dnsmasq
--dhcp-script to notify Quantum of lease renewals. Communication between
dnsmasq and the Quantum DHCP agent occurs via UNIX domain socket since dnsmasq
may run in a network namespace. The DHCP agent is responsible for
relaying the updated lease expiration back the Quantum server.
Remove parsing of "verbose" query param from API layer
Remove "verbose" fetching from db in db_base_plugin
Remove "verbose" parameter from plugin methods
Execute the test cases in test_db_plugin.py for each plugin.
Each plugin now get its own test_<plugin_name>_plugin test module.
This commit excludes cisco and metaplugin plugins, which do not run
the "core" unit tests at all.
Clark Boylan [Tue, 21 Aug 2012 21:41:29 +0000 (14:41 -0700)]
Add nosehtmloutput as a test dependency.
Adding nosehtmloutput as a test dependency allows nose to output its
results to an html file. This will be used by Jenkins to save logs on
a different server.
This patch will enable regular users to list subnets on a shared
network by exposing the subnet's "shared" attribute to the policy
engine, and letting it applying different rules if the subnet is
shared or private.