Assaf Muller [Mon, 5 Oct 2015 14:46:11 +0000 (10:46 -0400)]
Don't register agents for QoS l2pop fullstack test
Not registering agents (And waiting for them) shaves a couple
of seconds off the test run. More importantly it sets the correct
precedent / usage pattern for future copy/pastes.
The option force_metadata=True breaks the dhcp agent
Patch I5f6ee9788717c3d4f1f2e2a4b9734fdd8dd92b40 has an issue with
force_metadata = True.
Using the option force_metadata=True while
enable_isolated_metadata=False (which is the default), will break the
dhcp agent because the variable subnet_to_interface_ip is being
referenced before assignment.
Co-Authored-By: Jakub Libosvar <jlibosva@redhat.com>
Change-Id: I4e1d918e3a24dd483ee134021f587ae4520bf431
Closes-Bug: #1499406
Matt Riedemann [Thu, 1 Oct 2015 13:55:14 +0000 (06:55 -0700)]
Do not log an error when deleting a linuxbridge does not exist
When you're racing to teardown and relying on RPC, it should not be
considered an error that a bridge does not exist when you're trying to
delete it anyway. This is better served as debug level information.
For context, this shows up over 1000 times in successful
gate-tempest-dsvm-neutron-linuxbridge job runs in a week so it's
probably safe to say it's not contributing to test failures.
This patch adds all RPC workers to consumers of service
plugins queues such as metering and l3-plugin.
This is important for DVR-enabled deployments with hundreds
of agents.
This patch adds the availability_zone attribute to agents and
supports availability_zone API.
Availability_zone support for resources (network/router) and
the schedulers are included in subsequent patches.
Ihar Hrachyshka [Thu, 1 Oct 2015 15:13:25 +0000 (17:13 +0200)]
metadata: don't crash proxy on non-unicode user data
We attempt to log every successful metadata response with LOG.debug. But
as per oslo.log docs [1], we should make sure that what we pass into the
library is unicode.
Http.request returns a tuple of Response object and a string, which is
bytes in Python 2.x [2].
That's why we need to convert the response content to unicode before
passing it into oslo.log.
To achieve it, we utilize encodeutils.safe_decode with 'replace' errors
handling strategy, so that we don't get exceptions on input that does
not conform unicode.
For the unit test case, we pass a string that is not expected to convert
to unicode with errors='strict' strategy or similar, and check that we
still don't crash.
While at it, we remove a check for the number of log calls being
triggered, because it's something that we should avoid validating in
test cases, and it cannot trigger a real bug. The mock that was used to
count the number would also hide the bug that we try to reproduce.
Note that the bug does not require debug to be set because the crash
occurs before oslo.log machinery decides it should not log the message.
Brian Haley [Tue, 29 Sep 2015 15:31:34 +0000 (11:31 -0400)]
Add IPDevice.exists() method
Some callers of ip_lib.device_exists() have already instantiated
an IPDevice object, let's move the device existence check into
the IPDevice class so they can call it directly.
Assaf Muller [Thu, 1 Oct 2015 15:59:57 +0000 (11:59 -0400)]
Simplify L3 HA scheduler tests
Stop mocking scheduling in the L3 HA scheduler base class,
and mock it explicitly in a couple of tests that need to control
scheduling manually. This allows us to remove a tiny bit of code,
but more importantly make the test and production code a little bit
more similar, and allow the base class to be reused in a more
generic manner.
James Page [Thu, 1 Oct 2015 10:54:28 +0000 (11:54 +0100)]
Use format to convert ints to strings
This ensures that on 32bit architectures, where
sometimes an implicit long is created, the resulting
string does not contain a 'L' suffix as generated
by the hex function.
In addition to periodic checks of L3 and DHCP agents
add periodic checks of overall health of registered agents.
Log total count of agents at debug level so it can be
seen in logs of neutron-server.
In case some agents found dead - log detailed info about them:
Type of agent, last heartbeat, host.
Some database engines require exact match of sizes of foreign keys
and referenced fields. Foreign key router_id of table
cisco_ml2_apic_contracts is varchar(64) but it references field
id varchar(36) of table routers. This gives error while running
migration scripts in such databases.
This change only applies to new OpenStack installations
Carl Baldwin [Wed, 30 Sep 2015 20:12:23 +0000 (20:12 +0000)]
Remove is_ha property from the router
This was a todo left over from refactoring. The one place where it
was used was in the metadata driver which can just as easily check
isinstance.
The is_ha property in the HA class only returned True if self.router
was True. The agent sets this on creation and so it will always be
True. Additionally, it didn't really make sense to me anyway given
the way this was being used in the metadata driver.
Deprecate branchless migration chains from neutron-db-manage
Support for the scheme puts additional burden on neutron-db-manage
maintainers. The split branches were introduced in all 'official'
subprojects in Liberty, so it's fine to deprecate it in Mitaka, and drop
in Noodle.
Since there is no user actionable item to do for users, using
debtcollector that will only issue DeprecationWarning if they are
enabled. The assumption is that developers run their tests with that
enabled (as the BaseTestCase ensures) and handle warnings.
This optimization is needed for big clusters with hundreds
of agents where the spike of activity may trigger a burst
of RPC requests that would prevent neutron-server from processing
agent heart beats in time, triggering resource rescheduling.
This will be further optimized by running dedicated RPC workers
for state reports processing.
Henry Gessau [Sun, 27 Sep 2015 19:36:59 +0000 (15:36 -0400)]
Tag the alembic migration revisions for Liberty
Previously when we had one repo with one alembic branch we would
create a milestone revision on that single branch. Now we have
multiple repos and expand/contract branches for each repo.
So from now on we tag the final revision on every branch when we make
a milestone release. Update the cli to support the command:
neutron-db-manage upgrade <milestone>
where <milestone> becomes an alias for all the revisions for a
milestone.
Terry Wilson [Mon, 28 Sep 2015 22:42:25 +0000 (17:42 -0500)]
Check idl.run() return value before blocking
The IDL change_seqno can change as a result of running idl.run(), and
it returns True if there has been a change. The existing code would
block without checking the return value, and therefor could block
until another change occurred, or the timeout was reached.
For IP CIDR, D class is for multicast, but neutron does not
check this, if user create a subnet like '224.0.0.1/16', DHCP
agent will fail to spawn Dnsmasq service.
This patch adds a check, if subnet CIDR is D class or loopback,
neutron-server will raise a error.
The resource_identifier hooks has been removed as the Pecan
controllers are now able to identify by themselves the resource
they operate for.
However the unused hook module was never removed thus making it
'undeed'. This patch simply fires it a silver bullet thus ensuring
it will be gone forever.
Handle empty bridge case in OVSBridge.get_ports_attributes
Before this patch, get_ports_attributes would call
get_port_name_list. In the case of an empty bridge,
get_port_name_list would return an empty list and feed that
in to ovsdb.db_list, thereby returning all ports instead of
no ports.