Currently agent schedulers options are defined in neutron.scheduler and
every plugin that supports scheduling should register them individually.
It is reasonable to define and register options in one place - agentschedulers_db.
Fixes NeutronManagerTestCase when running separately by importing missing config option
Divide dhcp and l3 agent scheduling into separate extensions
Rationale behind this is that some plugins may support only dhcp or l3 agent scheduling.
The patch is nothing more than refactoring. Functionality was not changed.
This patch fixes programming error in the unit test for ryu-agent.
- Change the way of patch to cfg of ryu-agent
- Fix typo
s/assert_calls/assert_has_calls/
With this patch we avoid masking NotImplementedError(s).
Previously, a catch-all clause returned 500, and it makes
sense to distinguish between genuine 500 errors (i.e. a bug),
versus 501 ones.
This opens up the issue of keeping the server behavior
consistent from one release to another, but one might argue
that this was bad design decision in the first place.
Jay S. Bryant [Sun, 9 Jun 2013 13:43:55 +0000 (08:43 -0500)]
Allow non-root ip in subnet CIDR
If a subnet is created using an IP that isn't a root IP
(doesn't end with .0) the code that handles IP checking
for fixed IPs fails. This fix changes the check for a
valid IP to use the net.network IP address to
avoid problems in subnets created with the non-root CIDR.
This patch leverages the same approach as bug 1174111 for avoiding
loading ExternalNetwork element from db for each network element.
make_network_dict, _extend_network_dict_l3 are refactored accordingly.
Also, this patch sligthly alters the logic of process_l3_network_create
and process_l3_network_update as these methods assumed
_extend_network_dict_l3 was always executed before retuerning.
Finally, calls to get_network and get_networks in plugins which only
extended the response with l3 attributes have been completely removed.
This patch improves the Nicira plugin test coverage by:
- adding a suite of test cases for nvplib
- removing unused exception handling code
- removing 'vestigial' code in nvp plugin modules
This patches also fixes a few minor glitches with the plugin
and the fake api client.
Aaron Rosen [Wed, 19 Jun 2013 20:46:06 +0000 (13:46 -0700)]
Remove duplicate _check_provider_update from plugins
This patch removes the duplicated method _check_provider_update
and adds a check for it in the NVP plugin that was missing so that an error
is raised if someone tries to update a provider network.
Carl Baldwin [Fri, 28 Jun 2013 03:07:00 +0000 (03:07 +0000)]
Update code to properly use dict returned from get_gateway.
Calling get_gateway was a late addition to my code to add a default
route in the DHCP namespace. The code did not properly handle the
dict returned from that method. This changes it to properly extract
the 'gateway' attribute from the dict.
Kanzhe Jiang [Fri, 28 Jun 2013 21:23:46 +0000 (14:23 -0700)]
Support a timeout argument when instantiating a bigswitch plugin
The timeout argument overwrites the timeout value set in the config file.
The change permits any standalone script to interact with the bigswitch controller
through the quantum plugin with customized timeout value without changing the plugin
behavior.
Instead of spawning ovs-vsctl for every port on br-int, we just dump the
required columns from the Interfaces table and grab the rows that we need. This
is a big win because the time it takes for ovs-vsctl to connect to the
openvswitch controller is orders of magnitude greater than the time it takes to
parse the rows. In practice, instead of taking roughly 1s per interface, the
agent's periodic task only takes 1s in total.
Mate Lakat [Fri, 28 Jun 2013 15:22:04 +0000 (16:22 +0100)]
dom0 rootwrap - case insensitive xenapi section
As per change https://review.openstack.org/33429 the config sections
became lowercase. This patch makes the quantum-rootwrap-xen-dom0
rootwrap to be case insensitive for the xenapi section.
This patch also changes the default config file to use a lowercase
xenapi section.
Kyle Mestery [Thu, 27 Jun 2013 11:28:51 +0000 (11:28 +0000)]
Deprecate enable_tunneling in the OVS agent
This patch properly deprecates the 'enable_tunneling' option in the OVS agent.
It does this be ignoring it if 'tunnel_types' is set, and if 'enable_tunneling'
is set, it defaults 'tunnel_types' to only GRE.
This patch syncs all the DB configuration items into
quantum.conf and removes the related items of plugins' config
file to avoid duplication.
sqlite related sqlite_db and sqlite_synchronous are defined
in 'default' section, which I think is a defect. And it seems
quantum does not use sqlite_db item.
Fixes and simplifies the logic for managing SNAT rules, based
on the assumption that a chain contains SNAT rules for a single
router.
It also fixes another small glitch with SNAT rules not being
removed when a gateway port is destroyed (the glitch did not
affect operations)
There is a currently a hacky way to get the dhcp-agent to hand out a
gateway route using a host route on the subnet. If you pass a route
that has 0.0.0.0/0 as its destination, dnsmasq will pass it as a static
route. Unfortunately it will also pass the router option if the subnet
has a gateway set. This is inconsistent and precludes users from options
that are available in nova-network like using an external gateway.
This patch fixes things by allowing a 0.0.0.0/0 host route to override
the router setting passed by dnsmasq. This prevents the situation
where dnsmasq hands out two default routes.
Kevin Benton [Mon, 24 Jun 2013 21:44:10 +0000 (14:44 -0700)]
Port location tracking for BigSwitch Plugin
Adds a new table to the Big Switch plugin to keep track of
the nova compute node host IDs that ports reside on.
This table is then used to allow users to override
the VIF type for a compute node based on the host ID.
This allows quantum to control an environment with multiple
VIF types.
Gary Kotton [Sat, 20 Apr 2013 12:18:02 +0000 (12:18 +0000)]
Update to use OSLO db
This code implements the blueprint oslo-db-support
NOTES:
1. The new section is database (this is backward compatible
with DATABASE)
2. The sql_* are deprecated. They are also backward compatible.
3. Eventlets DB pool is no longer supported
Sergey Vilgelm [Mon, 24 Jun 2013 11:26:50 +0000 (15:26 +0400)]
Do not raise NEW exceptions
Raising NEW exception is bad practice, because we lose TraceBack.
So all places like:
except SomeException as e:
raise e
should be replaced by
except SomeException:
raise
If we are doing some other actions before reraising we should
store information about exception then do all actions and then
reraise it. This is caused by eventlet bug. It lost information
about exception if it switch threads.
Kevin Benton [Thu, 6 Jun 2013 21:40:45 +0000 (14:40 -0700)]
Adds support for router rules to Big Switch plugin
Implements: blueprint bsn-router-rules
Adds bigswitch plugin extension which adds 'rules' dictionary to router objects.
Adds validation code and database components to store router rules
Adds configuration option to plugin to set default router rules and max router rules
Adds unit tests to test all router rule functionality
Adds database migration for router rules tables
The Big Switch controller's Virtual Router implementation supports "routing rules"
which are of the form:
<source, destination, next-hop, action>
This extension aims to expose this abstraction via the Big Switch Quantum plugin.
These rules are applied at the router level, allowing tenants to control
communication between networks at a high level without requiring security policies.
(e.g. prevent servers in a publicly accessible subnet from communicating with
database servers).
- add old_health_monitor parameter to the method
- the method signature in abstract lbaas driver was also changed
to accept pool_id rather than an assoc object as driver only needs pool_id
Darren Birkett [Wed, 19 Jun 2013 12:37:02 +0000 (12:37 +0000)]
replace use of dhcp_lease_time with dhcp_lease_duration
Having 2 separate dhcp lease period flags (dhcp_lease_duration
used by the quantum db plugin, and dhcp_lease_time used by the
dnsmasq dhcp agent) means that you could potentially have different
lease periods being set, and used by different parts of the codebase.
It seems to me there is no real need to have 2 separate flags, so this
commit basically replaces references to dhcp_lease_time (which is used
by the dnsmasq dhcpagent) with dhcp_lease_duration. This way, there
is only one flag to set, and both the quantum db plugin and dnsmasq
dhcp agent will use the same lease period.
The code was assuming a SNAT rule for each subnet was always present
when clearing a gateway. If the SNAT rule was removed for some other
reason from the NVP backend, this would have led to the failure of
the whole operation; however, a failure won't have been necessary
in this case, as the final effect of the operation is to remove
the rules anyway.
Also, this patch ensures a quantum router is put in ERROR state if
it is not found on the NVP backend.
Make sure exceptions during policy checks are logged.
If the invocation of f bombs out, the policy check fails (i.e. returns
False), however it does not log the root cause, which makes very
difficult to understand why this is happening.
Carl Baldwin [Fri, 31 May 2013 20:44:14 +0000 (20:44 +0000)]
Adds default route to DHCP namespace for upstream name resolution.
Any time the DHCP server is updated this code will maintain a default
route in the DHCP namespace using the gateway_ip attribute of the
first DHCP-enabled IPV4 subnet in the list of subnets where gateway_ip
is not None. This strategy uses the same gateway ip that the DHCP
server hands to the VMs on the network.
Kevin Benton [Tue, 18 Jun 2013 19:10:07 +0000 (12:10 -0700)]
Always include tenant_id in port delete request
Quantum does not include the tenant_id in port objects for floating IP addresses.
However, the Big Switch backend requires the tenant_id in the port removal requests.
This looks up the correct tenant_id whenever it is missing in the port removal.
Note however, users can still use the uppercase section name for
backwards compatibility.
When we last attempted to do this, oslo.config-1.2.0 wasn't actually
being installed correctly so add a unit test which verifies that both
uppercase and lowercase section names work.
oslo.config-1.2.0 normalizes section names in config files to lowercase.
This means that simply by upgrading to oslo.config-1.2.0, users will now
be able to do e.g.