28 Commits

Author SHA1 Message Date
Dmitry Tantsur
f2e8c031cc Switch to JSON RPC from ironic-lib
Change-Id: I8b438861780c85faae7ff18646960723a1fd9876
2021-03-10 16:48:07 +01:00
Kaifeng Wang
dcc049768b Fixes unusable Guru meditation report
GMR requires configuring a path for storing the report via [oslo_reports]log_dir,
this is empty by default, and currently there is no means to specify this option,
thus doesn't respond with SIGUSR2.

Though gmr is optional, test requirement is still required so that we can
generate proper configuration sample for it.

Story: 2007570
Task: 39467

Change-Id: I0f03e9d01a3c4e42a4fc8bf2d8ceb2d1a587056c
2020-04-20 09:00:03 +08:00
Pavlo Shchelokovskyy
5e8c966a40 Use HTTPProxyToWSGI middleware from oslo
currently it is impossible to use ironic-api for both internal and
public api at the same time when both of those are using (ssl
terminating) proxies as there's only one config option to override the
resource url's in responses ([api]public_endpoint).

This patch adds the http_proxy_to_wsgi middleware from oslo.middleware
to the ironic API service, which, with properly configured proxies,
makes the choice of correct URL automatic, and thus makes such scenario
possible.

As this middleware may potentially not properly handle some
endpoint URL schemas, leave the api.public_endpoint option as a backup,
but it will be ignored when proxy headers parsing is enabled.

Change-Id: I3ce6b0726b479c2835f8777957b2cb12d8098aec
Story: #2006303
Task: #36019
2019-08-02 12:29:37 +00:00
Riccardo Pittau
f5dbf8ba0c Switch to use exception from ironic-lib
The exception modules in ironic and ironic-lib contain the same
almost identical class IronicException.
With this patch we directly use the one in ironic-lib.

Updating requirements and lower-constraints to use compatible
version of ironic-lib.

Also deprecating duplicated fatal_exception_format_errors
option.

Change-Id: I1ce0d12d912020346425fd658d3b1807607455a4
Story: 1626578
Task: 10515
2019-06-11 12:03:44 +02:00
Dmitry Tantsur
c36a01a439 Publish baremetal endpoint via mdns
This change adds an option to publish the endpoint via mDNS on start
up and clean it up on tear down.

Story: #2005393
Task: #30383
Change-Id: I55d2e7718a23cde111eaac4e431588184cb16bda
2019-05-23 17:11:50 +02:00
Kaifeng Wang
7b021309ee Remove tox checkconfig
As we are not maintaining sample config file in the repo now,
the checkconfig can be removed since it's always generated from
the code.

Change-Id: I5bfd7c5cbb048a71864fac4fcfebb940529f87f1
2018-09-29 15:09:12 +08:00
Jim Rollenhagen
6f439414bd Add optional healthcheck middleware
This adds the healthcheck middleware from oslo, configurable via the
[healthcheck]/enabled option. This middleware adds a status check at
`/healthcheck`.

This is useful for load balancers to determine if a service is up (and
add or remove it from rotation), or for monitoring tools to see the
health of the server.

This endpoint is unauthenticated, as not all load balancers or
monitoring tools support authenticating with a health check endpoint.

Change-Id: I7929d5f4502c3f84b1cf30526c94a458081a6a29
Closes-Bug: #1748515
2018-02-12 14:48:05 -05:00
Ramamani Yeleswarapu
3773f17403 Enable OSProfiler support in Ironic
This patch does the following:
* Adds osprofiler wsgi middleware
  This middleware is used for 2 things:
  - It checks that person who wants to trace is trusted and knows
    secret HMAC key.
  - It starts tracing in case of proper trace headers
    and adds first wsgi trace point, with info about HTTP request.

* Adds initialization of osprofiler at start of service
  - Initialize and set an oslo.messaging based notifier instance
    to osprofiler, which will be used to send notifications to Ceilometer.

* Traces HTTP/RPC/DB API calls and SQL requests

NOTE to test this patch:
1) Make the following changes in localrc to configure DevStack to enable
   OSProfiler:

   enable_plugin panko https://git.openstack.org/openstack/panko
   enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer
   enable_plugin osprofiler https://git.openstack.org/openstack/osprofiler

   # Enable the following services
   CEILOMETER_NOTIFICATION_TOPICS=notifications,profiler
   ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral
   ENABLED_SERVICES+=,ceilometer-anotification,ceilometer-collector
   ENABLED_SERVICES+=,ceilometer-alarm-evaluator,ceilometer-alarm-notifier
   ENABLED_SERVICES+=,ceilometer-api

NOTE: the order of enabling plugins matters.

2) Run stack.sh. Once DevStack environment is setup, enable profiler options
   in ironic.conf and restart ironic services:
   [profiler]
   enabled = true
   hmac_keys = SECRET_KEY
   trace_sqlalchemy = true

3) Use openstackclient and run baremetal command with
   --os-profile SECRET_KEY
   [--profile can be used, but it is deprecated.]
   For example, the following will cause the <trace-id> to be printed
   after node list:

   $ openstack --os-profile SECRET_KEY baremetal node list
   .....
   .....
   Trace ID: <trace-id>
   Display trace with command:
   osprofiler trace show --html <trace-id>

4) The trace results can be saved using this command:

   $ osprofiler trace show --html <trace-id> --out trace.html

OSprofiler spec: https://review.openstack.org/#/c/103825/

Co-Authored-By: Tovin Seven <vinhnt@vn.fujitsu.com>
Co-Authored-By: Hieu LE <hieulq@vn.fujitsu.com>

Partial-Bug: #1560704

Change-Id: Icd3d7c62cf7442de8a77fc67f119ae9b03725f02
2017-07-07 15:58:28 -07:00
John L. Villalovos
3cedd6f924 Have bashate run for entire project
Before bashate was only running on the devstack/ directory. Have it
now run on the entire project for *.sh files.

Fix issues detected by bashate.

Also check the files:
    devstack/files/hooks/qemu
    devstack/lib/ironic

These files were located by doing:
    $ find openstack/ironic/ -not \( -type d -name .?\* -prune \) \
      -type f -not -name '*.sh' | xargs file | grep -i "shell script"

Change-Id: I238b7ab650781143fe8231e01250ab56120ff94f
2016-09-27 11:19:33 -07:00
Jay Faulkner
15c366580a Metric chassis, driver, node, and port API calls
This change adds initial metrics for Ironic based on new support in
ironic-lib. Emits timing metrics for basic Ironic API calls.

Bumps ironic-lib to 2.0.0 in requirements to add metrics support, as
well as adding ironic_lib.metrics and ironic_lib.metrics_statds to
ironic-config-generator.conf to get them in the sample config, which
is also regenerated.

Change-Id: Ic35802e4cd11763ebbedb8ddc28f7e8dc535cc2f
Partial-bug: #1526219
2016-07-15 18:15:11 +00:00
Lin Tan
773aa20a4a Make use of oslo-config-generator
oslo_config provide a utility for generating sample config files,
which provide more detail about opts, like Minimum/Maximum value
and Allowed values.
So drop Ironic's "generate_sample.sh" which was copied from
oslo-incubator long time ago.

Add a new entry point "ironic" under oslo.config.opts namespace to
explore config options to oslo-config-generator.

After this patch, new config options of Ironic code should register
with ironic/conf/opts.py. New external libraries should
register with tools/config/ironic-config-generator.conf

There is a bug #1554657 with oslo-config about deprecated_group.
This bug have impact of some configs from keystonemiddleware
and oslo.messaging in ironic.conf.sample
So currently, deprecated option should always add the deprecated_group
even it didn't alter the group, otherwise the deprecated group value will
be 'DEFAULT'.

Update etc/ironic/ironic.conf.sample via running 'tox -egenconfig'.

Closes-Bug: #1564195
Change-Id: If7721e98e69b6f54f1ee04a07477396b86583371
2016-05-25 11:59:13 +08:00
Faizan Barmawer
7c138f01a0 Refactor disk partitioner code from ironic and use ironic-lib.
The disk partitioner related code from ironic/common/disk_partitioner.py
and ironic/drivers/modules/deploy_utils.py is being moved to ironic-lib.
The code in ironic needs to be removed and use ironic-lib to perform
disk related activities.

Change-Id: I7b1b1d8b45b947a7b5715f3c6ab49d84e84b6b90
2015-12-09 22:03:35 -08:00
Anton Arefiev
564f5f7cd7 Add SSL support to the Ironic API
Add posibility to configure the API to service requests via HTTPS instead
of HTTP using native ssl from oslo.service wsgi.

New options was added:
 * enable_ssl_api - turn on ssl support;
Options defined in oslo.service for configure certs:
 * ca_file - ca certificate file to use to verify connecting clients;
 * cert_file - certificate file to use when starting the server securely;
 * key_file - private key file to use when starting the server securely;

Closes-bug: #1430213
Change-Id: Id4b84d83f9aa6c7f898b3b9b59158d5b1a00e159
2015-11-18 12:04:18 +00:00
Michael Krotscheck
05f4a64aed Added CORS support middleware to Ironic
This adds the CORS support middleware to Ironic, allowing a deployer
to optionally configure rules under which a javascript client may
break the single-origin policy and access the API directly.

OpenStack Spec:
   https://review.openstack.org/#/c/179866/
Oslo_Middleware Docs:
   http://docs.openstack.org/developer/oslo.middleware/cors.html
OpenStack Cloud Admin Guide Documentation:
   http://docs.openstack.org/admin-guide-cloud/cross_project_cors.html

Co-Authored-By: Devananda van der Veen <devananda.vdv@gmail.com>
Depends-on: I2deed897f8f9ef87e4a74227c4fcea9afdb151e8
Change-Id: Ic55305607e44069d893baf2a261d5fe7da777303
2015-09-01 19:45:01 +00:00
Lucas Alvares Gomes
2e16a3cd7e Fix "tox -egenconfig" by avoiding the MODULEPATH env variable
MODULEPATH is apparently a well known variable from environment-modules
package and was causing the sample configuration generation to fail.

Change-Id: Ie9f1896c9480aa371c99a316511b172e92f52824
Closes-Bug: #1437904
2015-08-20 10:50:00 +01:00
Sergey Vilgelm
0f4eba1854 Switch to oslo.service
oslo.service has graduated, so ironic should consume it.

Change-Id: Iaa1ca0d97b92b9a6858b2c2d50eb514cc2118762
Closes-Bug: #1466851
2015-06-29 10:49:15 +02:00
Ghe Rivero
aafeed2f85 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.

Change-Id: I4261083dae076cea66c42ad16eb82a5faaeb1a65
2015-05-05 08:43:28 +02:00
Ghe Rivero
338c1f2d01 Adopt config generator
oslo.config.generator has been removed from olso-incubator so
we need to adopt it in order to generated up-to-date config
files.
Changes introduced:
- Move config/generator.py from openstack.common to ironic.common
- Update config generator to use new style list_opts discovery
- Split _print_opt function to reduce complexity and pass pep8 tests

Change-Id: I397504bf0604a86082f26e46952720117611f3a8
2015-05-04 20:38:13 +00:00
Ghe Rivero
b2f15d07d3 Sync with oslo.incubator
Add oslo.policy and oslo.concurrency to oslo config generator extra
libraries to retrieve config options
Update oslo_incubator service module
Update oslo_incubator versionutils with new list_opts discovery

Change-Id: I5558f6f9f708b1643ebd6c8b2a213a1fae582a50
2015-04-06 12:54:56 +02:00
Lin Tan
1be0fd0a8e Generate keystone_authtoken options in sample config file
Adding keystonemiddleware.authtoken as extra libraries
to register its missing options, like admin_user.
Update sample conf by running 'tools/config/generate_sample.sh'

Closes-Bug: #1430115
Change-Id: Ic8666dc4a3a6b7c5855afb2929d8b14ebe21ca52
2015-03-19 13:56:34 +08:00
Devananda van der Veen
50003a107d Use auth_token from keystonemiddleware
auth_token middleware in python-keystoneclient is deprecated and has
been moved to the keystonemiddleware repo.

This patch updates Ironic to use the new keystonemiddleware package.

Change-Id: Ifb48996867f9f51c4dbedde0e0d9476c2d2818b4
Closes-Bug: #1342274
2014-08-11 15:33:58 -07:00
Ghe Rivero
689052700c Sync oslo.incubator modules
Update the openstack.common modules from oslo.incubator
to have a current copy needed to start using new released
oslo libraries.

Change-Id: I60ea98b3381cbbc3d2905af224792ee68b423825
2014-08-05 22:28:25 +00:00
Victor Sergeyev
4d41e5cd86 Use oslo.db library
oslo.db library has been graduated from oslo-incubator,
so now we can use it instead of ironic.openstack.common.db.* code.

Co-Authored-By: Ghe Rivero <ghe.rivero@hp.com>

Implements: blueprint oslo.db

Change-Id: I250050a7dbd8735ba3af954223b54eabae793f59
2014-07-17 14:04:57 +03:00
Lucas Alvares Gomes
69dc8400db Port to oslo.messaging
The oslo.messaging library takes the existing RPC code from oslo and
wraps it in a sane API with well defined semantics around which we can
make a commitment to retain compatibility in future.

The patch is large and hard to be split into different patches, but the
changes can be summarized as:

* Remove openstack/common/{rpc, notifier, log_handler} modules dependency
(superceded by oslo.messaging)

* New config option `conductor.workers_pool_size` add to determine the
size of the workers greenthread pool.

* PeriodicService class refactored and renamed to RPCService, all periodic
tasks methods were moved to the ConductorManager class leaving RPCService
class to be resposable for setting up and starting the RPCServer from
oslo.messaging only.

* In oslo.messaging, a request context is expected to be a dict so the
method RequestContext.{to,from}_dict() was updated/added to the module.

* The allowed_rpc_exception_modules configuration option is replaced
by an allowed_remote_exmods get_transport() parameter. This is not
something that users ever need to configure, but it is something each
project using oslo.messaging needs to be able to customize.

* New common/rpc.py module added to wrap the global messaging state. It
also contains transport aliases for backwards compatibility with IceHouse
rpc_backend configuration values.

blueprint: oslo-messaging
Change-Id: I454e8898baed002a1cddb9eb76492ae9c2f1212b
2014-04-25 22:46:44 +01:00
Chris Krelle
f616e239c7 Import Nova "ironic" driver
Import the Nova "ironic" driver from the Nova review queue.
This Nova driver will not be present in the Icehouse release of Nova,
but is required for Ironic functionality and can be installed as an
out-of-tree driver.

Co-Author: Lucas Alvares Gomes <lucasagomes@gmail.com>
Co-Author: Devananda van der Veen <devananda.vdv@gmail.com>

Change-Id: I3351dee1a4b2dfb50317ce85dffe8012f0feca6c
2014-03-05 16:30:15 -08:00
Victor Sergeyev
1fd5b44425 Sync common config module from Oslo
List of changes

1a6dfb9 Sanitize FQDN in config generator
e839886 Config generator fails with lazy messages
763eedf Fix DictOpt support in config sample generator
e3dddd7 generator: use EXTRA_* env vars in the bash script
e8e636c generator: add an EXTRA_LIBRARIES env variable
5dce17b Use entry points to discover options in libraries
dd9aa2b Remove unused variables
ad17a69 Fix filter() usage due to python 3 compability
7c18261 Temporary workaround for config generator
4b3e32b Sort the output of config/generator.py by group name
12bcdb7 Remove vim header
806272e Improve error reporting on import failures
6cd1c33 Clean up extra modules code

Updated ironic.conf.sample using new config generator.

Closes-Bug: #1282481
Change-Id: Ice3e527589bbf0e881d21f55229264513ea445d2
2014-02-25 11:13:06 +02:00
Devananda van der Veen
1f9917cc02 Add [keystone_authtoken] to ironic.conf.sample
Update the auto-generation of our sample config file by exporting a
variable to oslo.config.generator such that it will include the
keystone_authtoken section when building our config.

Change-Id: I8f0d93846cd948059ac6cbc6ec4024257e2c3f27
Closes-bug: 1271308
2014-01-21 12:29:45 -08:00
Devananda van der Veen
252ddedd6d Sync config module from oslo
Add 'config' to openstack-common so that it syncs from Oslo,
move tools/conf -> tools/config to be able to sync from Oslo,
and then sync the changes which are proposed in oslo-incubator
commit Iee6cc05cad70963f2a151f595ac376c9338f5774.

Change-Id: I32a80b0e2aa0e26b9fc78b7546c07e102639374e
2013-12-27 15:34:14 -08:00