Commit Graph

108 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez 0aa154b5ce Fix the ``log.setup`` method call with "fix_eventlet=False"
Since [1], present in oslo.log 5.3.0, the ``log.setup`` method is
unpatching the evenlet thread module. That is causing several problems
in some Neutron services, in particular the keepalived-state-change
service.

Within this oslo.log version, the patch [2] is provided to call this
method without unpatching any eventlet module.

This patch is also bumping the minimum required version of oslo.log
to 5.3.0, in order to call the ``log.setup`` method with the kwarg
"fix_eventlet=False".

[1]https://review.opendev.org/c/openstack/oslo.log/+/852443
[2]I4bbcfe7db6d75188e61b9084cb02b2dd2aaa0c76

Closes-Bug: #2037239

Change-Id: Iea77d20bec330b692e3e8c9e38b3a62e2047b4f4
2023-10-05 13:16:21 +00:00
Rodolfo Alonso Hernandez c5b76a8393 Script to remove duplicated port bindings
A new script to remove the duplicated port bindings was added. This
script will list all ``ml2_port_bindings`` records in the database,
finding those ones with the same port ID. Then the script removes
those ones with status=INACTIVE. This script is useful to remove
those leftovers that remain in the database after a failed live
migration.

"dry_run" mode is possible if selected in "[cli_script] dry_run"
boolean config option. The duplicated port bindings are printed in
the shell but not deleted.

Related-Bug: #1979072

Change-Id: I0de5fbb70eb852f82bd311616557985d1ce89bbf
2022-08-18 08:13:56 +00:00
Jakub Libosvar 4d3a274765 Don't register config options on imports
Importing some modules lead to registering config options that may
collide with config options from a project that calls the import. This
patch wraps the side effect that registers config options into a
function that needs to be called in case the caller wants to register
the options.

This solution is also not perfect as it guards the common options to be
registered only once even if the function is called multiple times. This
is to solve problems in unittests, ideally we should always call the
function just once even in our testing suites.

Resolves-Bug: #1968606
Change-Id: Ic1532eb8de887ff1b1085206df11f53e22f7f524
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
2022-04-13 05:49:15 +00:00
Ghanshyam Mann fe413fe01d [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I0dbb8484e749e645627756e88ec79c1b26a6414a
2021-01-08 09:10:49 +00:00
Rodolfo Alonso Hernandez cf36bd4ca5 Enable ovsdb debug messages in functional and fullstack
Enable the configuration flag "ovsdb_debug" for functional and
fullstack tests. If enable, NeutronOvsdbIdl won't define any log
level when setting up the logger; if not "max_level" is defined,
all messages are logged.

Change-Id: I1185c1ca2556e2aed27051efd98a1d141f5298c9
Related-Bug: #1802640
2020-01-29 17:11:44 +00:00
Riccardo Pittau c6ff9c922e Use openstacksdk for ironic notifiers
This patch removes the dependency from ironicclient for the ironic
event notifiers in favor of openstacksdk.
Also, increasing minimum required versions for mock and
openstacksdk.

Change-Id: Ib76e19d29f0ae3db6d181578b638da699181f60d
2019-09-19 06:56:24 +00:00
Harald Jensås afff649a39 Notify ironic on port status changes
This patch adds an ironic notifier that sends notifications
to ironic endpoint /v1/events. The events are triggered by
port updates and deletions. Only ports with vnic_type
baremetal are honored.

Story: 1304673
Task: 22263
Closes-Bug: #1828367
Implements: blueprint event-notifier-ironic
Authored-By: Vasyl Saienko <vsaienko@mirantis.com>
Co-Authored-By: Harald Jensås <hjensas@redhat.com>
Co-Authored-By: Julia Kreger <juliaashleykreger@gmail.com>
Change-Id: I0bb3187a88a7f20adb8c60e24945db159afb83f1
2019-05-27 13:38:42 +02:00
Boden R 024802aafd remove neutron.common.rpc
The neutron.common.rpc module has been in neutron-lib for awhile now and
neutron is shimmed to use neutron-lib already.
This patch removes neutron.common.rpc and switches the code over to use
neutron-lib's implementation where needed.

NeutronLibImpact

Change-Id: I733f07a8c4a2af071b3467bd710290eee11a4f4c
2019-02-06 11:05:55 -07:00
Hongbin Lu 7a2b4dcff1 Replace ryu with os_ken
Implements: blueprint ryu-framework-maintenace-transition
Change-Id: Ic721efc7cd0066be0ea7b6239b273e656643e9c1
2018-12-13 10:00:17 +00:00
Nguyen Phuong An 2f98f56cb5 Allow neutron-api load config from WSGI process
neutron-api needs to load config files when deployed under
WSGI process. This patch will do this. neutron-rpc-server
also need to be aware of plugin extension.

uWSGI seems not happy with eventlet.GreenPool. So this patch
will switch to futurist.ThreadPoolExcutor for ML2 OVO push
notification.

Partially-implements: blueprint run-in-wsgi-server

Change-Id: Ia2659c9c8f1deeceefc1c75f1149a1e47c91e7a9
Closes-Bug: #1708389
2018-07-25 15:22:14 +07:00
Inessa Vasilevskaya 7322bd6efb Make code follow log translation guideline
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.

Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
2017-08-14 02:01:48 +00:00
Kevin Benton d92dc1244e Change ovsdbapp vlog to INFO
This is to eliminate the following messages that fill the
OVS agent logs:

ovsdbapp.backend.ovs_idl.vlog [-] [POLLIN]

Change-Id: I00010ef600a4185b7628318bb88971d978b9fe67
Partial-bug: #1707307
2017-07-31 23:00:46 +00:00
Gyorgy Szombathelyi fddfa7b244 Honor the common session options for the placement API
Insecure, cafile, timeout and cert parameters can be used
for the placement API, too.

Change-Id: I59456fb0b994af91780e12824109afd132051a0d
2017-06-09 15:32:03 +02:00
Joe Talerico 27d18ac5c5 Don't override default values for oslo.db options
This change will make neutron-server use default values from oslo.db if
any of them are not overridden in config files, instead of applying its
own unique values that may be unexpected to users and operators.

It also makes our config files correct since now we don't claim wrong
values being default. (Remember the config generator was never aware of
our snowflake behaviour.)

If you wonder why we were overriding it in the first place, it was
needed back in the times when we were using db module from
oslo-incubator that has not provided proper defaults. Those times are
long gone.

Of course the change is not impact free, and operators who for some
reason want to keep the old values may need to adjust their
configuration files. Still, I believe using default values from oslo.db
is the correct thing to do long term.

We still need to set connection string for unit tests to sqlite:// since
oslo.db doesn't provide any default value for the option. It should be
fine to effectively unset default value for the option for
neutron-server since no one in production can use sqlite anyway.

This change also drops set_db_defaults function from
neutron.common.config. I have checked that there are no consumers for
the function outside the tree.

NeutronLibImpact
UpgradeImpact

Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Change-Id: Ia97d6cf24e554f7b3878dd301ae4e7e10a1c9998
Closes-Bug: #1682307
2017-04-13 08:06:39 -07:00
Miguel Lavalle ebe62dcd33 Add a ReST client for placement API
This patchset adds a ReST client for the placement API. This
client is used to update the IPv4 inventories associated with
routed networks segments. This information is used by the
Nova scheduler to decide the placement of instances in hosts,
based on the availability of IPv4 addresses in routed
networks segments

DocImpact: Adds [placement] section to neutron.conf with two
           options: region_name and endpoint_type

Change-Id: I2aa614d4e6229161047b08c8bdcbca0e2e5d1f0b
Partially-Implements: blueprint routed-networks
2017-01-17 16:41:46 -06:00
ZhongShengping 9c81f275e6 Change cfg.set_defaults into cors.set_defaults
Cors has added set_deafults method, just use it.
Related link:
https://review.openstack.org/#/c/285368/

Change-Id: I4b7fe72cbe968640f2f7a6de63f9289d6728782d
2016-11-09 15:11:17 +08:00
Armando Migliaccio 5743ed4679 Reduce log level for ryu in OVS agent log
In a tempest run, Ryu is logging about ~30K debug traces and it puts the
OVS agent's log amongst the biggest log files in a single node OpenStack
deployment in the gate. This patch sets Ryu and its components to log at
INFO level and above to reduce the number of traces emitted.

This patch, alongside [1,2], brings down the size of the biggest Neutron
log files, server and OVS agent respectively. More can surely be done,
however callbacks and ryu are the most obvious ones, and following up
with further cuts may be dealt with on a ad-hoc basis.

Closes-bug: #1620864

[1] https://review.openstack.org/#/c/366424/
[2] https://review.openstack.org/#/c/366478/
Change-Id: I40b7c77601788ae2e7428c7a0206ca2a807d10dc
2016-09-12 07:35:50 +00:00
lilintan f03a6f944a Don't pass argument sqlite_db in method set_defaults
Config option sqlite_db is deprecated for removal[1],
so don't need set its default value.

[1]https://github.com/openstack/oslo.db/blob/\
0a1bae9859079fb21a03716be947c5f1da6db0a2/oslo_db/options.py#L17

Change-Id: Ie1e94e03013e8f1e47bbc1cd12f8d1b81a4cb24e
2016-08-16 13:54:54 +08:00
Anindita Das 414ceed4f3 Refactoring config options for common config opts
Refactoring neutron common config opts to be in neutron/conf/common so
that all the configuration options reside in a centralized location.
This simplifies the process of looking up the config opts and provides
an easy way to import.

Moved conf/common/config.py to conf/common.py as per review comments.

Partial-Bug: #1563069

Change-Id: Ib5fa294906549237630f87b9c848eebe0644088c
2016-07-26 15:55:49 +00:00
Ihar Hrachyshka a984f9554c Calculate MTU on every network fetch instead of on create
Today, existing networks may not reflect MTU configured for
neutron-server, if they were created when neutron-server was using
different MTU setup for its infrastructure, or when it was using bad
default values for network MTUs (specifically, before Mitaka, all networks
were getting MTU = 0 by default, disabling both advertisement and data
path MTU size enforcement).

This patch stops persisting MTU in the database on network create and
instead calculate it on every network resource fetch.

DocImpact Now changes to MTU configuration options immediately affect
          existing network MTUs, not just new networks.

UpgradeImpact Existing networks with invalid MTU persisted in database
              may change their MTU values to reflect configuration.

Change-Id: Iee4f5037bf10b73ba98464143b183aacb59c22f2
Closes-Bug: #1556182
2016-07-20 13:26:50 +02:00
Carl Baldwin 1554cee9e2 Obsolete mac_generation_retries and deprecate the option
As discussed in this patch [1] this option didn't come from any actual
user-encountered problem and is now effectively obsolete for its
original purpose anyway.  In the interest of cleaning up options that
aren't of any real use, this patch obsoletes this one immediately and
marks it deprecated for removal in Ocata.

TrivalFix

[1] https://review.openstack.org/#/c/327413

Change-Id: I58003d5b07e28c7254ff836dec937f699bc83112
2016-06-20 12:31:30 -06:00
Jenkins b3dbe19494 Merge "Deprecate advertise_mtu option" 2016-05-25 20:26:12 +00:00
Ihar Hrachyshka 0cf4ddc6ee tests: validate sorting and pagination for networks
These are the very first API tests in the tree to cover those features.
The test is implemented in a generic way that will hopefully ease its
adoption for other resources.

Sadly, those tests cannot pass on every neutron cloud, at least until we
enable those API features by default and remove options to disable the
features.

There is no way to determine, via neutron API, whether cloud supports
those features. To work around that, we introduce two new tempest
options that determine whether tests that rely on sorting or pagination
should be executed. Those options are set in post-extra phase because
configure_tempest resets any configuration made during post-config.

Also bump resource quotas x10 times since default quotas are now not
enough, at least for network resource that is now under sorting and
pagination testing.

Related-Bug: #1566514
Change-Id: I5e68f471a641a34100aba31cb2c4a815c7220014
2016-05-24 09:17:25 +00:00
Ihar Hrachyshka 4955746bbf Deprecate advertise_mtu option
Now that we advertise MTU via DHCP and RA by default, there is no reason
to keep the option available for configuration. Other agents/plugins are
also encouraged to advertise MTU values to instances by their own means.

DocImpact: mark the advertise_mtu option as deprecated as of Newton.

Closes-Bug: 1576000
Change-Id: Ibf7d60dfc57bec090f16d909c050c09e7cfd9352
2016-05-20 14:28:05 +02:00
Henry Gessau 78fff41ee3 Use converters and validators from neutron-lib
Related-Blueprint: neutron-lib

Change-Id: I6b9079e9e703c6fd75adbed3846e7257685433e8
2016-04-24 19:13:10 -04:00
Jenkins b54abb1baf Merge "Adopt oslo.log default_log_levels" 2016-03-24 14:05:12 +00:00
Henry Gessau 4980f031fe Adopt oslo.log default_log_levels
oslo logging complains that:

"Option verbose from group DEFAULT is deprecated for removal. Its
value may be silently ignored in the future."

Switch to using default_log_levels instead.

Change-Id: Ibddb8b379753193624d1a3df1cf2c53018c0a62b
2016-03-23 20:20:37 -04:00
Sreekumar S 7215168b11 Removing 'force_gateway_on_subnet' option
With this fix 'force_gateway_on_subnet' configuration
option is removed, and gateway outside the subnet is
always allowed. Gateway cannot be forced onto to the
subnet range.

DocImpact: All references of 'force_gateway_on_subnet'
configuration option and its description should be
removed from the docs.

Change-Id: I1a676f35828e46fcedf339235ef7be388341f91e
Closes-Bug: #1548193
2016-03-23 12:14:26 +05:30
Jenkins 84f1eb8790 Merge "Set DEFAULT_NETWORK_MTU to 1500 and use it" 2016-03-10 14:14:39 +00:00
Jenkins 2768da320d Merge "Moved CORS middleware configuration into oslo-config-generator" 2016-03-10 09:22:23 +00:00
Sean M. Collins be9fe6a200 Set DEFAULT_NETWORK_MTU to 1500 and use it
No more magic numbers.

Change-Id: I5f557c005434e4b922b692ecdffa0b9c4255a1cd
2016-03-08 16:54:56 -05:00
Kevin Benton ae45cd5732 Add global_physnet_mtu and deprecate segment_mtu
Introduce the neutron-wide 'global_physnet_mtu' option that
references the underlying physical network MTU. This also
introduces a method in plugin.common.utils that all plugins
should use to retrieve it. This value should be used to
calculate the proper MTU for virtual network components.

This patch also deprecate the 'segment_mtu' option specific
to the ML2 plug-in and makes ML2 reference this new option.

Closes-Bug: #1542475
Closes-Bug: #1542108
Change-Id: I6ffc8973c9b8f46cc19922ff04fdd2d23646b878
2016-03-08 11:11:08 -08:00
Michael Krotscheck aae181817e Moved CORS middleware configuration into oslo-config-generator
The default values needed for neutron's implementation of cors
middleware have been moved from paste.ini into the configuration
hooks provided by oslo.config. Furthermore, these values have been
added to neutron's default configuration parsing. This ensures
that if a value remains unset in neutron.conf, it will be set to use
sane defaults, and that an operator modifying the configuration
file will be presented with a default set of necessary sane headers.

Change-Id: I327d1d7ce50dd4a20d781e6251a5af81c57e6ca1
Closes-Bug: 1551836
2016-03-01 12:21:33 -08:00
Sreekumar S 3e6d602f54 Deprecate 'force_gateway_on_subnet' configuration option
Currently 'force_gateway_on_subnet' configuration is set to True
by default and enforces the subnet on to the gateway. With the
fix in https://review.openstack.org/#/c/233287/, gateway outside
the subnet can be added, and the configuration option now has
lost its significance.

With this patch, the configuration option is deprecated.
It should be removed in Newton release, and the system should
always allow gateway outside the subnet.
This patch is dependent on the fix for adding gateway outside
the subnet, mentioned above.

DocImpact: 'force_gateway_on_subnet' description should be
updated in the docs and marked as deprecated to be removed in
the Newton release.

Change-Id: I28b3d7add303ee479fc071c1de142b0f7811e4e5
Closes-Bug: #1335023
Closes-Bug: #1398768
2016-02-22 11:19:14 +05:30
sridhargaddam 47713f5870 Support MTU advertisement using IPv6 RAs
RFC4861 allows us to specify the Link MTU using IPv6 RAs.
When advertise_mtu is set in the config, this patch supports
advertising the LinkMTU using Router Advertisements.

Partially Implements: blueprint mtu-selection-and-advertisement
Closes-Bug: #1495444
Change-Id: I50d40cd3b8eabf1899461a80e729d5bd1e727f28
2016-02-10 09:59:33 +00:00
Miguel Lavalle 93ac8b3a33 External DNS driver reference implementation
An interface with an external DNS service is defined for Neutron. A reference
implementation is also included, based on Designate. The interface and the
driver will enable users to publish in the external DNS service the dns_name
and dns_domain attributes associated with floating ips, ports and networks. As
a consequence, the floating ips and networks api is extended to manage dns_name
and dns_domain attributes. The dns_name attribute was added to ports in a
preceding commit

DocImpact: Introduce config option external_dns_driver to specify a driver
for external dns integration. For more info, see
doc/source/devref/external_dns_integration.rst

APIImpact
Implements: blueprint external-dns-resolution

Change-Id: Ic298ad2558410ab9a614f22e1757d1fc8b22c482
2016-01-21 21:55:08 +00:00
Sean M. Collins 7e7d5dc861 Make Neutron attempt to advertise MTUs by default
It seems like a useful option, and it could be a more sane default,
rather than pushing the responsibility to enable this onto deployers and
provisioning tools[1]. In fact, it may be worth doing some more work to
take away some of the hassle of configuring all these things correctly,
and see if it can be automatically determined.

[1]: https://specs.openstack.org/openstack/fuel-specs/specs/7.0/jumbo-frames-between-instances.html

Related-Bug: #1527675
Change-Id: I5cbbc4660f8c4e15e59f8f5ce0419501bdd27348
2016-01-18 13:34:16 +01:00
Kevin Benton 6474c6efac Make neutron pecan server an option instead of binary
Launch pecan server instead of home-grown wsgi server using
a new config option. This will make it easier to test out
pecan without invasive changes to devstack.

Related Blueprint: wsgi-pecan-switch
Change-Id: I99261e6bfc9b16c0d601828f97553a9192804216
2016-01-14 18:25:13 -08:00
Jeremy McDermond 7dad96deb4 Add option for nova endpoint type
When the neutron notification to nova was updated to use novaclient the
nova_url parameter was disabled.  This prevents administrators from
using anything but the publicURL as the proper endpoint to notify nova.
This patch adds an option to pass on to novaclient for the
endpoint_type so that the administrator can set the notification url to
public, internal or admin.

Change-Id: I405f761944449cab6b8c8895f98419f79cd74cad
Closes-Bug: #1478471
DocImpact: Need to add a new option to the neutron configuration
reference.
2015-12-10 08:40:36 +00:00
Jenkins e3a531a1fa Merge "Use _ from neutron._i18n" 2015-12-07 03:12:08 +00:00
Monty Taylor a37e11f637 Use keystoneauth instead of keystoneclient
keystoneauth was split out last cycle as a library specifically to deal
with doing auth functions so that people who do not need to do keystone
CRUD operations can just consume only the auth session parts. As part
of modernizing keystone interactions, use keystoneauth instead of
keystoneclient.

Depends-On: I1f754a9a949ef92f4e427a91bbd1b1e73e86c8c4
Change-Id: Ia6fb7d8bb07d3101cf1b1afc318f3dcac0a37afc
2015-12-06 15:09:42 +00:00
Akihiro Motoki 2d8632e412 Use _ from neutron._i18n
Partial-Bug: #1520094
Change-Id: I874a4aa1d71d1f7034a1ff0b7450b419ef5c6864
2015-12-06 19:39:04 +09:00
Doug Wiegley dd726ed494 Move i18n to _i18n, as per oslo_i18n guidelines
- This does NOT break other projects that rely on neutron.i18n,
  as this change includes a debtcollector shim to maintain those
  older entry points, until they can migrate.
- Also updates _i18n.py to the latest pattern defined by oslo_i18n
- Guidance and template are from the reference:
  http://docs.openstack.org/developer/oslo.i18n/usage.html

Partially-Closes-Bug: #1519493
Change-Id: I1aa3a5fd837d9156da4643a367013c869ed8bf9d
2015-12-01 19:29:10 -07:00
Martin Hickey 71190773e1 Automatically generate neutron core configuration files
This adds a new tox environment, genconfig, which generates sample
neutron core configuration file using oslo-config-generator.

Updates to some configuration option help messages to reflect useful
details that were missing in the code but were present in config files.

It also adds details to devref on how to update config files.

Partially-Implements: blueprint autogen-neutron-conf-file

DocImpact

Change-Id: I1c6dc4e7d479f1b7c755597caded24a0f018c712
Closes-bug: #1199963
Co-Authored-By: Louis Taylor <louis@kragniz.eu>
2015-11-27 15:22:59 +00:00
Hirofumi Ichihara 6e50027819 Add availability_zone support for network
This patch adds the availability_zone support for network.

APIImpact
DocImpact

Change-Id: I9259d9679c74d3b3658771290e920a7896631e62
Co-Authored-By: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Partially-implements: blueprint add-availability-zone
2015-11-25 22:34:09 +09:00
Jenkins ddd13b25e7 Merge "Revert "Move dhcp_lease_duration into DHCP agent config options list"" 2015-11-17 05:29:34 +00:00
Kevin Benton 3a57401e86 Revert "Move dhcp_lease_duration into DHCP agent config options list"
This reverts commit 3101e2b62f.

The lease duration isn't DHCP agent specific. DHCP is a feature that
should be provided by whatever plugin is loaded and operators would
still like to set lease times for DHCP.

In the reference implementation we just consume it directly in the
agent, but that doesn't mean it's specific to the agent implementation.

Change-Id: I5efb6aa5e196d4cac5ff7c0c35be5a350401b925
2015-11-16 10:53:24 +00:00
Jenkins a9a205e002 Merge "Undeprecate force_gateway_on_subnet option" 2015-11-14 09:22:39 +00:00
Jenkins d8c07f1933 Merge "Move dhcp_lease_duration into DHCP agent config options list" 2015-11-13 22:31:42 +00:00
Ihar Hrachyshka 63db82ac40 Undeprecate force_gateway_on_subnet option
There are valid use cases for gateways outside of subnet range. F.e.
deployers may decide to provide external connectivity in that way, by
injecting link routes.

Change-Id: I18a78adff1106129fd59eaa5be315fcf6ba70cc4
2015-11-13 12:26:55 +01:00