Commit graph

112 commits

Author SHA1 Message Date
Zuul
6362fa4663 Merge "Trait Based Networking Simulator" 2025-12-16 20:37:00 +00:00
Zuul
f09d80cce5 Merge "Separate states code from states constants" 2025-12-11 05:33:25 +00:00
Jay Faulkner
c69caf28e8
Separate states code from states constants
Currently, the nova virt driver for ironic has a file containing nothing
but our states as constants. A recent bug was caused, in part, by these
not being properly updated. The goal here is to move ironic state
machine code and constants into separate files -- once merged, I will
update the nova driver to use a copy of this file (and add a comment to
the file here saying it's synced over there). This should help prevent
this kinda issue in the future and in the long run cause less duplicated
work.

Assisted-by: Claude Code (claude)
Signed-off-by: Jay Faulkner <jay@jvf.cc>
Change-Id: Ief4533b69899c893f150ef3a7006fb99f7e42964
2025-12-08 14:17:14 -08:00
Zuul
6b6b932714 Merge "Switch graphical console image to ubuntu by default" 2025-12-05 16:38:12 +00:00
Clif Houck
d3d65ee2c6
Trait Based Networking Simulator
Adds a tool that will ingest a TBN configuration file along with test
network/port-like objects in order to simulate how TBN would plan the
network for a node.

Change-Id: Ia7fbb9b651e4ed4c63a105484856de7f38bc541c
Signed-off-by: Clif Houck <me@clifhouck.com>
2025-12-04 15:37:13 -06:00
Steve Baker
856238c56a Switch graphical console image to ubuntu by default
The centos Containerfile still exists and the launch scripts have been
adapted to work on both distros.

The ubuntu container has been tested with noble. The container built
in the CI jobs is bound to the version of ubuntu which the host is
running, which will provide functional testing validation when jobs are
moved to newer releases.

Change-Id: I1954e418543acf939bf65189121484e038f3737c
Signed-off-by: Steve Baker <sbaker@redhat.com>
Signed-off-by: Julia Kreger <juliaashleykreger@gmail.com>
2025-12-04 11:24:43 -08:00
Steve Baker
194b638c72 Add a conductor liveness check utility script
This script runs a liveness check on the configured conductor hostname
and will fail if the conductor is not online. Its intended purpose is to
be used as a kubernetes pod startup or liveness probe for the conductor
container.

Change-Id: I88288e0d7a1da4ec99f31c20771299cce2499bf0
Signed-off-by: Steve Baker <sbaker@redhat.com>
2025-12-03 10:22:09 +13:00
Allain Legacy
b8f3318ca6 Add standalone networking service for ironic
Implements the foundational infrastructure for a new standalone
networking service that can operate independently of the main ironic
conductor. This commit establishes the service skeleton with:

- RPC API layer with oslo.messaging integration for remote calls
- Public API interface for conductor/API to interact with the service
- RPC service implementation for handling network requests
- Stub networking manager with method signatures (implementation
  added in subsequent commit)
- Service entry point (ironic-networking command) for deployment
- Configuration options for service behavior and networking backend
- Infrastructure and packaging changes for the new service

The manager includes stub implementations that raise NetworkError,
with the full implementation of network operations, driver framework
and switch drivers are added in subsequence commits.

Related-Bug: 2113769
Assisted-by: Claude/sonnet-4.5
Change-Id: I351c7afe96cbcebd6b2e2bb5f0b4f17b5d804ceb
Signed-off-by: Allain Legacy <alegacy@redhat.com>
2025-11-27 11:39:59 -05:00
Zuul
3a614de7f1 Merge "trivial: fix benchmark data generation script" 2025-11-22 20:56:29 +00:00
Steve Baker
e6e842b228 Replace Chrome/Selenium console with Firefox extension
The current containerised graphical console approach has a Selenium
script managing a Chrome browser session. This change replaces that with
firefox and a custom extension to perform the required actions to login
and load the BMC console. This supports the same vendors as the previous
approach (iDRAC, iLO, Supermicro).

This change is required by Red Hat as Chrome is not packaged in RHEL.
However switching to firefox has allowed a more robust and featureful
implementation so it is presented here on its own merits.

This is implemented with bash, calling out to dedicated python scripts
for these specific tasks:
- Detecting which vendor specific javascript to use for the
  redfish-graphical driver
- Building the required certificate fingerprint when app_info.verify_ca
  is false, which is written to the profile's cert_override.txt
- Building a custom policy.json which is specific to the BMC and vendor
  implementation.

Functional differences with the chrome/selenium version
- Firefox kiosk mode has a more locked-down environment, including
  disabling context menus. This means the brittle workaround to disable
  them is no longer required.
- Firefox global policy allows the environment to be locked down
  further, including limiting accessing to all URLs except the BMC.
- There is now a dedicated loading page which can show status updates
  until the first BMC page loads. This page shows error messages if any
  of the early redfish calls fail.
- VNC client sessions are now shared with multiple clients, and firefox
  will be started on the first connection, and stopped when the last
  connection ends.
- Starting Xvfb is now deferred until the first VNC client connection.
  This results in a never-connected container using 5MB vs 30MB
  once Xvfb is started. Starting Xvfb has ~1sec time penality on first
  connection.
- The browser now runs in a dedicated non-root user
- All redfish consoles now hide toolbar elements with a CSS overlay rather than
  simulating other methods such as clicking the "Full Screen" button.
- ilo6/ilo5 detection is now done by a redfish call and the ilo5 path
  has less moving parts.

Change-Id: Ib42704a016dc891833a0ddbeae8054cac2c57d4d
Signed-off-by: Steve Baker <sbaker@redhat.com>
Assisted-By: gemini
2025-11-05 11:07:07 +13:00
Takashi Kajinami
8d7be386d5 Replace unused oslo.service options
In threading mode the options implemented in oslo.service are not used,
in favor of the options imported from cotyledon.

Change-Id: I8a94bfea5fe9f9f54077e5d958198ede09f78903
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-09-04 22:45:57 +09:00
Julia Kreger
60de53ea45 trivial: fix benchmark data generation script
While trying to create some fake data, I realized the randomizer
code was not running, nor were changes being committed, and largely
the code was still patterned on ipmi, when really we should be
patterning on fake. Also drops the number of nodes to create to 5000,
instead of 10,000, as we're ultimately going to create a fairly unhappy
fake ironic database with this model.

Using the fake interface *and* fake config, provides us an easy
path to begin to benchmark drastic changes to the conductor model
as part of removing eventlet.

Change-Id: I179c842d369eb9a3a60878556559746cca27bcaa
Signed-off-by: Julia Kreger <juliaashleykreger@gmail.com>
2025-08-19 22:57:05 +00:00
Steve Baker
1ad1b167ff Implement graphical console read-only support
Change-Id: I321c1d0e6bce4e66107f92fc67c95bc38a0a9ad9
Related-Bug: 2086715
2025-03-02 22:27:33 +00:00
Steve Baker
4ed44172b4 Add vnc-container image build
The files in tools/vnc-container allow a container image to be built
which supports Ironic's graphical console functionality.

For each node with an enabled graphical console, the service ironic-novncproxy
(or nova-novncproxy) will connect to a VNC server exposed by a container
running this image.

If the devstack ir-novnc serivce is enabled then this container image
will be built locally and ironic configured to used it for the systemd
console container provider.

This makes a devstack environment functional in accessing graphical
consoles for Dell, HPE and Supermicro.

Related-Bug: 2086715
Change-Id: I0842570cca22ac0e67d358c30225e8e08561f459
2025-03-02 22:27:33 +00:00
Jay Faulkner
74d239d4eb Migrate ironic_lib to ironic
This migrates ironic-lib code and usages to code in ironic.common.
Relevant unit tests were migrated as well.

Also removes support for ironic-lib from CI and devstack.

Change-Id: Ic96a09735f04ff98c6fec23d782566da3061c409
2025-01-09 13:52:30 -08:00
Jay Faulkner
e2fce4c0d5 Fix genconfig: remove now-gone ironic_lib modules
For oslo-config-generator, you have to list the external libraries that
provide configuration options so it knows to pull them in. Several of
the listed ironic_lib modules are no longer in that project causing
failures.

Change-Id: If270ac0701769a6ce8131816b1cb4921120bd7ab
2024-11-15 07:53:04 -08:00
Jay Faulkner
466cd3902c Remove postgresql testing and documentation
Ironic has maintained a CI job for years after postresql support was
deprecated in order to prevent unintentional breakage of that support.
Now, we have confirmed evidence that other openstack components, such as
keystone, required for testing this postgresql support no longer
function in this job.

As a result, ironic can no longer test postgresql support. Operators
utilizing postgresql who have not yet migrated must migrate now.

Change-Id: If6e4432b000996789346a1f7449410cfc8497fe1
2024-11-12 14:41:04 -08:00
Jay Faulkner
80c8b9f3fc Migrate lint to pre-commit
Migrate all existing linters to pre-commit. This consolodates our bandit
and codespell job into the general pep8 job.

Change-Id: I6b40a3338d98fab500e22918b6bd5b8bff2106fd
2024-10-29 14:59:33 -07:00
Jay Faulkner
e2dad9128a Localdev: disable caching and related periodic
When running out of a local tox environment, don't try to cache images,
or cleanup cached images.

Change-Id: If153923d340455497018bf0021bab86a4c8ae69b
2024-07-03 15:57:21 -07:00
Jay Faulkner
3dcbc19541 Add tox env for local dev; update documentation
This is a quick and easy way to get Ironic up for testing; updated to be
even quicker and easier if you don't need multiprocess or mysql.

Co-Authored-By: CID <cid@gr-oss.io>
Change-Id: Ibef8a24868fd1f507e69e6d615d6327031d11495
2024-07-01 18:28:12 +00:00
Zuul
df9e1ba80e Merge "[codespell] Fixing Spelling Mistakes" 2024-03-14 17:13:05 +00:00
Dmitry Tantsur
4b31cc1c48
Switch to qemu-img functions from ironic-lib 6.0.0
Change-Id: I0010d8710db4f2859dabe8ccfa5bf478d4f039f6
2024-03-11 17:16:12 +01:00
Sharpz7
949387bd80 [codespell] Fixing Spelling Mistakes
This is the first in a series of commits to add support for codespell. This is continuning the process completed in ironic-python-agent.

Future Commits will add a Tox Target, CI support and potentially a git-blame-ignore-revs file if their are lots of spelling mistakes that could clutter git blame.

Change-Id: Id328ff64c352e85b58181e9d9e35973a8706ab7a
2024-02-12 19:58:56 +00:00
Zuul
2dec169587 Merge "Fix missing oslo.versionedobjects library option" 2023-08-08 12:57:29 +00:00
Takashi Kajinami
0bda652262 Fix missing oslo.versionedobjects library option
This ensures the options for oslo.versionedobjects library are
included in the file generated by oslo-config-generator.

Change-Id: Ib63c4dd1c14905ec200e67a8fe9ba5f20b160b08
2023-08-08 15:05:22 +09:00
Julia Kreger
c4e3100d5c Add hold steps
* Updates API version to 1.85 to permit an ``unhold`` verb
* Adds the ``deploy hold`` and ``clean hold`` provision states
  to the internal state machine.
* Adds on documentation on steps to help provide greater clarity
  to Ironic's users on how to utilize steps. It should be noted
  this documentation also includes the power state reserved step
  names from the DPU functionality patch.
* Fixes the state machine diagram. Changes type to PNG as SVG
  rendering is broken due to python libraries utilized for SVG
  generation which do not work on more recent Python versions.

Change-Id: I34f58f4e77e7757b89247fd64f5fcde26f679453
2023-06-30 14:34:26 -07:00
Dmitry Tantsur
4bcef0eee5 Do not log into the template1 database during test-setup
Template databases are not designed to run random SQL code. They should
only be accessed to modify the template itself. Use postgres instead.

Change-Id: Id7d38895d8d04964557447ecbc6ca29f39f626c9
2023-03-31 12:36:54 +02:00
Julia Kreger
b201e52f89 [CI] Fix port list benchmark
Change-Id: Ifdcf69f605e38f4c56661c8fd3c6b8aac087fc78
2023-03-22 11:52:18 -07:00
Harald Jensås
d691ee05e5 Add ports statistics to tools/benchmark scripts
Update the scripts in tools/benchmark to enable benchmarking
ports as well.

Change-Id: Ida42e8b7c483d905dbc4226d695f35aca77a8722
2022-11-18 15:55:25 +01:00
Takashi Kajinami
f0935c182e Add audit middleware options to ironic.conf
Ironic supports enabling the audit middleware. This change adds
the option for the middleware to the ironic.conf file generated by
oslo-config-generator.

Depends-on: https://review.opendev.org/804316
Change-Id: Ic7adb755f47ea65fe975dfbc7cca905a376d728e
2022-07-07 15:51:07 +00:00
Dmitry Tantsur
1f509c5bde Fix the benchmark job
This is a price to pay for using private API and not having unit tests :)

Change-Id: Ie400a73eb2036678ed9446e0b499301cc2b690dd
2022-02-09 10:11:49 +01:00
Dmitry Tantsur
3f990beb97 Refactor common configuration bits from service commands
The prepare_service call from ironic.common.service is changed to also
configure guru meditation and profiler. A new call prepare_command is
provided for the cases it's not required.

Change-Id: I5b9b7b7bc827c8bcda06e9a967deae8577ad87f4
2021-12-01 12:19:33 +01:00
Steve Baker
6af0eb374e Set postgresql password encryption for FIPS compliance
This is part of the work to add jobs which confirm ironic works with
FIPS enabled, but this change is also appropriate non-FIPS jobs.

Change-Id: I4af4e811104088d28d7be6df53c26e72db039e08
2021-08-05 11:47:11 +12:00
Ruby Loo
7507dec09f Use env to find python3
Our container doesn't have python3 at /usr/bin/python3. This
changes the script so that /usr/bin/env is used to find python3.

For discussion/opinions about how (and the better way) to locate
python3:

- https://developpaper.com/the-difference-between-usr-bin-python-and-usr-bin-env-python-in-python/
- https://stackoverflow.com/questions/13879569/usr-bin-python-and-usr-bin-env-python-which-support

Change-Id: I88cab53244913b5c9bfce6729f38f93a57ddbe80
2021-06-14 17:02:54 +00:00
Julia Kreger
ffff76a682 Add basic tools for benchmarking
Adds a horribly written, just hacked together little tool to help
provide sizing insight into an ironic deployment's state and underlying
performance.

Key data:
* Queries the list of node from a pure python interface level with the
  database and reports timeing for the list of nodes to be returned.
  This information helps convey how long a periodic hits the database
  just for the query.
* Requests *all* nodes using the query pattern/structure of the nova
  resource tracker, and uses the marker to make any additional requsts.
  The data is parsed, and collected, and counts identified vendors,
  if any.
* Collects basic data on conductors in terms of running, conductor groups
  as well as currently loaded drivers in the deployment.

All of this information provides operational insight into *what*
conditions exist within the deployment allowing developers to try
and identify solutions based on the unique circumstances of larger
deployments.

Also adds a utility to generate and semi-randomize data to allow us to
create a benchmark job in CI.

Change-Id: Iae660aea82db8f1c4567ee2982595ccfdf434fe3
2021-05-24 16:36:02 +00:00
Dmitry Tantsur
f2e8c031cc Switch to JSON RPC from ironic-lib
Change-Id: I8b438861780c85faae7ff18646960723a1fd9876
2021-03-10 16:48:07 +01:00
Steve Baker
235115099a Generate policy.yaml.sample
Generating a yaml file called policy.json.sample is a bit misleading
because the file is not valid json, this change fixes that, with the
intention that the user can copy policy.yaml.sample to
/etc/ironic/policy.yaml and make customizations.

Change-Id: Ie6d5c8c38d785005d2bf2dc8f9f7ac42c2e8f7fb
2021-02-11 11:52:51 +13:00
Kaifeng Wang
3b06feb91e Update checking reno script to use python3
Spotted in focal container while running pep8, updates the shebang
to use python3 explicitly, also removes the unused -tt argument.

Change-Id: Icb16ac63a83379cafe9a7dac380f2b87b881adc9
2020-10-11 22:13:21 +08:00
Julia Kreger
eac7226ce2 CI: update bindep for centos-8 py36 job changes
Opendev infra changed py36 defaults to run on centos8 and
of course, there is no python-devel mapping on centos.

Removed the entry and adjusted the test-setup.sh script
so the databases are started locally as they are not auto
started upon installation.

Change-Id: I826757ad73b0b14f119f9205475379b85f111383
2020-10-03 18:22:36 -07:00
Dmitry Tantsur
8aecabcfe4 Stop using md5 for __repr__ of objects
The md5 function is not available on systems in FIPS mode, just
use the callable name (which is closer to how repr usually looks).

Change-Id: I4319ce2f42f35251595306b9a77ae1f8bc55595c
2020-07-07 15:28:03 +02:00
Sean McGinnis
58693c7f4d
Make test-setup.sh compatible with mysql8
Starting from mysql version 8 it's not possible to create a user
implictly when using GRANT.

This patch makes the behavior compatible with that.

Change-Id: I2b73a532deb8782c2c0bb05070b727e9edc6e9d8
Co-written-by: Riccardo Pittau <elfosardo@gmail.com>
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-06-22 14:18:45 -05: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
Riccardo Pittau
80e49538c2 Remove future usage
No need to import print_function from future anymore

Change-Id: I49164db5bd283c42602c75539c0c5fffe6ec2630
2020-03-30 10:52:29 +02: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
Kaifeng Wang
bffb075d20 Adds bandit template and exclude some of tests
Adds bandit configuration template and exclude some of
tests that we don't want to fix for the moment.

Keeping job unvoted so that we can keep an eye on possible
issues while not breaking gate.

Change-Id: Ic577cad3b61421c04023ea887236992acb19f77c
Story: 2005791
Task: 33518
2019-06-20 15:08:43 +08: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
Nguyen Van Trung
edd0ff7f46 Update docs to portgroup with creating windows images
This change will add how to create windows images article
in portgroup docs. these images will support to create port
bounding through ironic services.

This feature has tested on Fujitsu servers successfully.

Change-Id: I1ce941a16f080fce1699d8629a7e12a2c2d83ade
2018-09-24 04:11:14 +00:00
Julia Kreger
471aafc047 Ignore bashate E044
Bashate introduces a new error, E044, which attempts to
identify any questionable conditionals that would be
incorrectly using bracketing. That being said, it is
modeled on keeping the design simple, and errors on more
condensed lines where conditionals are included.

Since we don't need this, and the case where it is erroring
is invalid as the test is overly simple, lets ignore it.

Change-Id: Ie46dcd6cd6100f3c7e35c2c817828e45bd6b7921
2018-07-21 17:19:17 -04:00