Commit Graph

163 Commits

Author SHA1 Message Date
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
Dmitry Tantsur 0902912217 Generic API for attaching/detaching virtual media
This patch allows to attach or detach a generic image as
virtual media device after a node has been provisioned.

Closes-Bug: #2033288
Change-Id: I97b68047d769f6fb686c53e89084b5874e02b8c7
2023-11-23 09:55:09 +01:00
Julia Kreger 2366a4b86e Adds service steps
A huge list of initial work for service steps

* Adds service_step verb
* Adds service_step db/object/API field on the node object for the
  status.
* Increments the API version to 1.87 for both changes.
* Increments the RPC API version to 1.57.
* Adds initial testing to facilitate ensurance that supplied steps
  are passed through and executed upon.

Does not:

* Have tests for starting the agent ramdisk, although this is
  relatively boiler plate.
* Have a collection of pre-decorated steps available for immediate
  consumption.

Change-Id: I5b9dd928f24dff7877a4ab8dc7b743058cace994
2023-08-16 06:34:08 -07:00
Iury Gregory Melo Ferreira aecb581082 Firmware Interface
FirmwareInterface base
New Config options [default]
- enabled_firmware_interfaces
- default_firmware_interface

New FirmwareInterface base with update method
Implementations of FirmwareInterface
- FakeFirmware (fake)
- NoFirmware (no-firmware)

New entrypoint ironic.hardware.interfaces.firmware
* fake and no-firmware

Api Controllers
- Updated: driver/node/utils/versions
- Created: firmware

Unit tests
api-ref for Node Firmware

Fake and Noop implementation for FirmwareInterface

Change-Id: Ib3b9cb22099819f97d5eab1e3f1b670cb91cbb25
2023-07-11 07:39:15 -03:00
Dmitry Tantsur 0370f5ac97 Migrate the inspector's /continue API
This change creates all necessary parts to processing inspection data:

* New API /v1/continue_inspection

Depending on the API version, either behaves like the inspector's API
or (new version) adds the lookup functionality on top.

The lookup process is migrated from ironic-inspector with minor changes.
It takes MAC addresses, BMC addresses and (optionally) a node UUID and
tries to find a single node in INSPECTWAIT state that satisfies all
of these. Any failure results in HTTP 404.

To make lookup faster, the resolved BMC addresses are cached in advance.

* New RPC continue_inspection

Essentially, checks the provision state again and delegates to the
inspect interface.

* New inspect interface call continue_inspection

The base version does nothing. Since we don't yet have in-band
inspection in Ironic proper, the only actual implementation is added
to the existing "inspector" interface that works by doing a call
to ironic-inspector.

Story: #2010275
Task: #46208
Change-Id: Ia3f5bb9d1845d6b8fab30232a72b5a360a5a56d2
2023-06-07 10:57:08 +02:00
Zuul 5e6fa6ef30 Merge "Upgrade to latest hacking - v6" 2023-04-30 09:41:59 +00:00
Jay Faulkner 153d4d8385 Upgrade to latest hacking - v6
Required minor changes to existing files to comply with new flake rules.

Change-Id: Ia0bff27ab4a7ec98c533ea66357a3c0529026102
2023-04-21 12:15:07 -07:00
Dmitry Tantsur 3e21560bf7 Remove all references to the "cpus" property
Unused by Nova and unlike memory_mb/local_gb also by Ironic (actually,
our usage of local_gb is worth double-checking as well, but at the very
least it's referenced by inspection implementations).

Change-Id: Ie8b0d9f58f4dcd102c183c30ae7f5acf68a5e4c3
2023-03-28 11:53:26 +02:00
Jacob Anders b385d9ae5b Add support for verify steps
This change adds support for verify steps in Ironic. Verify steps
allow executing actions on transition from "verifying" to "managable"
state and can perform actions such as cleaning BMC job queue or
resetting the BMC on supported platforms. Verify steps are similar
to deploy and clean steps, just simpler.

Story: 2009025
Task: 42751
Change-Id: Iee27199a0315b8609e629bac272998c28274802b
2021-09-30 20:46:17 +10:00
Arun S A G 288b8fd883 Add agent_status and agent_status_message params to heartbeat
agent_status is used by anaconda ramdisk to inform the
conductor about state of the deployment. Valid agent
states are 'start', 'end' and 'error'. The agent_status_message
is used to describe the why the agent_status is set to a
particular state. Use of these parameters require API
version 1.72 or greater.

When anaconda finishes deployment the agent_status is
set to 'end'. When anaconda ramdisk is unable to deploy
the OS for some reason the agent_status is set to 'error'.

PXEAnacondaDeploy is implemented to handle the 'anaconda'
deploy interface. PXEAnacondaDeploy ties to together pieces
needed to deploy a node using anaconda ramdisk.

Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Change-Id: Ieb452149730510b001c4712bbb2e0f28acfc3c2e
2021-03-31 14:20:39 -07:00
Zuul acd4b451dc Merge "Use OOB inspection to fetch MACs for IB inspection" 2021-03-22 13:16:06 +00:00
Dmitry Tantsur 30a85bd0ce API to force manual cleaning without booting IPA
Adds a new argument disable_ramdisk to the manual cleaning API.
Only steps that are marked with requires_ramdisk=False can be
run in this mode. Cleaning prepare/tear down is not done.

Some steps (like redfish BIOS) currently require IPA to detect
a successful reboot. They are not marked with requires_ramdisk
just yet.

Change-Id: Icacac871603bd48536188813647bc669c574de2a
Story: #2008491
Task: #41540
2021-03-16 16:08:46 +01:00
Jacob Anders 05df3d7aa4 Use OOB inspection to fetch MACs for IB inspection
This change adds get_mac_addresses call to the ManagementInterface which will
be used by both out-of-band inspection and in-band inspection with
ironic-inspector. This will remove the necessity of manually defining MAC
addresses for nodes and/or enabling IPMI functionality on Redfish-based
systems.

Change-Id: I3debcd1f32a2627dafd8456ec73a71fc7c402ebb
Story: 2008038
Task: 40699
2021-02-11 17:03:18 +10:00
Dmitry Tantsur b6f4587f0b Common framework for configuring secure boot
Two drivers already support turning secore boot on and off,
Redfish will follow soon. This patch adds ManagementInterface
calls to get and set the secure boot state.

Story: #2008270
Task: #41561
Change-Id: I96b2697163def52618b4c051a5c85adf7d1818a5
2021-01-19 17:56:06 +01:00
Zuul 2d70e6e26e Merge "IPMI: Handle vendor set boot device differences" 2020-12-14 21:03:02 +00:00
Julia Kreger a7ac9ce8cd IPMI: Handle vendor set boot device differences
Supermicro machines, when in UEFI mode, have a different
device number, in binary, to represent the hard disk from
other vendors such as Fujitsu which actually has somewhat
similar code in their driver.

This means we need to be somewhat cognizent of the vendor of
the BMC and possibly update the device mapping based upon that
vendor.

This may ultimately fix a number of IPMI related problems, because
there is a reliance upon the text output of ipmitool, which only
reads the bytes retured by the BMC, which may not be reality after
the next reset, espescialy if ipmitool doesn't know of the UEFI
operating difference.

Change-Id: Ie19db9e0cf1eafdfc9bb46248f4d457337821f94
Story: 2008241
Task: 41085
2020-12-14 12:00:38 +00:00
Dmitry Tantsur 2e5d01d48d Fix DHCP-less operations with the noop network interface
The base implementation of get_node_network_data returns {} and is
not overridden in the noop network. Update the base implementation
to use task.node.network_data and remove the excessive logging.

Change-Id: Ie50dcd1c2a151f5dd09794467792527032249809
2020-11-10 18:53:32 +01:00
Dmitry Tantsur 2b676a6864 Accept and use a TLS certificate from the agent
Accepts the certificate from a heartbeat and stores its path in
driver_internal_info for further usage by the agent client (or
any 3rd party deploy implementations).

Similarly to agent_url, the certificate is protected from further
changes (unless the local copy does not exist) and is removed
on reboot or tear down (unless fast-tracking).

Change-Id: I81b326116e62cd86ad22b533f55d061e5ed53e96
Story: #2007214
Task: #40603
2020-09-09 17:27:30 +02:00
Dmitry Tantsur e804f6c56b Account for power interfaces that cannot power on
The future agent power interface will only be capable of rebooting, so:
1) Adjust agent_base to be able to use reboot instead power off+on
2) Adjust power sync to avoid trying to force power state for such nodes

Change-Id: Ia95a68729f684a06c722539816eadea5ebb80d1a
Story: #2007771
Task: #40381
2020-07-20 09:41:41 +02:00
Ilya Etingof cf12521f70 Add `get_node_network_data` method to NetworkInterface
Extends NetworkInterface with `get_node_network_data` method
providing network configuration for node NICs in form of Nova network
metadata structure (i.e. `network_data.json`). Network interface
implementations would implement their own ways of gathering network
configuration when possible.

Ironic would eventually pass network configuration to the node being
managed out-of-band.

Change-Id: I4c956c08a695fb17ec32c3e2a17cbca55148eb79
Story: 2006691
Task: 36992
2020-05-25 18:17:38 +02:00
Dmitry Tantsur a3d7d73a69 Bump hacking to 3.0.0
The new version enables a lot of standard flake8 checks. Some of them
are temporary disabled to reduce the scope of this patch:
* Complexity check requires a few functions to be rewritten (apparently,
  it was not enabled previously).
* Indentation check failures are numerous and potentially contradictive.
These checks will be enabled in follow-ups.

W606 is removed from excludes since we no longer hit it.

Change-Id: I1e5a6f8e5e90c55cfc6f740b26c30196512d3be3
2020-03-31 10:16:54 +02:00
Riccardo Pittau 78c121a5d7 Stop using six library
Since we've dropped support for Python 2.7, it's time to look at
the bright future that Python 3.x will bring and stop forcing
compatibility with older versions.
This patch removes the six library from requirements, not
looking back.

Change-Id: Ib546f16965475c32b2f8caabd560e2c7d382ac5a
2019-12-23 09:38:25 +01:00
Dmitry Tantsur c5dfa1bd9f Foundation for boot/network management for in-band inspection
This change the required base driver interface additions and inspector
interface changes to support in-band inspection driven by ironic.

Change-Id: Ibf9a80d0f72d5f128bf46ddca4cb9762c9a8191b
Story: #1528920
Task: #10404
2019-11-21 13:31:47 +01:00
Ilya Etingof d3e4fe50b5 Add indicator management harness to ManagementInterface
Adds ``get_indicator_state``, ``set_indicator_state`` and
``get_supported_indicators`` methods to driver management interface.
Drivers can override these methods implementing indicators (e.g.
LEDs) management calls against the BMC of the baremetal nodes being
managed.

The spec: https://review.opendev.org/#/c/655685/7/specs/approved/expose-hardware-indicators.rst

Change-Id: I952de78312f09897e6b743e11c9cc5dac977dc36
Story: 2005342
Task: 30311
2019-08-26 12:05:29 +02:00
Shivanand Tendulker b1986361a8 Add new method 'apply_configuration' to RAIDInterface
This commit adds new method 'apply_configuration' to RAIDInterface.
This method would be used as deploy step and would accept the
target raid config as argsinfo argument.

Co-Authored-By: Mark Goddard <mark@stackhpc.com>
Change-Id: If50294f5413e67bb333ebba53fb3dab251f5317d
Story: 2003817
Task: 26571
Task: 30004
Task: 36061
2019-08-14 01:02:34 -04:00
Mark Goddard 56acabfab4 Deploy Templates: factor out ironic.conductor.steps
There is enough steps code in conductor.utils to warrant a separate
module.

Change-Id: I0126e860210bbc56991876f26e64d81d3d7d5c08
Story: 1722275
Task: 29902
2019-03-15 10:10:45 +00:00
Mark Goddard cfc4a6f752 Allow methods to be both deploy and clean steps
This means we can add clean_step and deploy_step decorators to a driver
interface method.

Change-Id: Ic964ec706349a74ff371d91b1d7203d942c81fb0
Story: 2005223
Task: 30005
2019-03-13 16:29:09 +00:00
Hamdy Khader a41c7a9592 Add support for Smart NICs
Extend Ironic to enable use of Smart NICs to implement
generic networking services for baremetal servers.

Extending the ramdisk, direct, iscsi and ansible deployment Interfaces
to support the Smart NIC use-cases.

For Smart NIC use-case the baremetal node must be powered on and
booted into bios then wait for agent that runs on the Smart NIC to be
alive then do the network changes required.

Task: #26932
Story: #2003346
Change-Id: I00d6f13dd991074e4f45ada4d7cf4ccc0edbc7e1
2019-02-07 15:24:34 +02:00
Dmitry Tantsur 699bd410c7 [Refactor] Make caching BIOS settings explicit
Currently we cache BIOS setting after calling apply_configuration or
factory_reset implicitly via a wrapper added in BIOSInterface.__new__.
It's confusing, and we did forget about this aspect when writing
unit tests for the new iLO BIOS interface. This results in unsufficient
mocking that breaks unit tests with proliantutils installed.

This patch moves caching BIOS settings to an explicit decorator and
fixes the mocking problem.

Change-Id: I704eccea484b36cb5056fdb64d3702738c22c678
Story: #2004953
Task: #29375
2019-02-06 19:08:18 +01:00
Zuul f1d779433b Merge "Fix async keyword for Python 3.7" 2018-09-25 09:28:08 +00:00
vmud213 85b0d3e141 Honors return value from BIOS interface cleansteps
When a BIOS interface clean step is executed the return value is ignored.
If it is asynchronous, the return value which is CLEANWAIT state is ignored
and the cleanstep is marked as complete immediately. The current change
honors the return value and moves the node to CLEANWAIT state accordingly.

Change-Id: I3a3915116286326316ee9a55333c046f729c1a08
Story: #2003750
Task: #26438
2018-09-18 16:41:39 +05:30
Michal Arbet 3749cd618b Fix async keyword for Python 3.7
In Python 3.7, async becomes a keyword, and therefore we need
to change variable async.

The passthru() previously had async and async_call, we just remove
the old parameter.

scciclient moved from async to do_async as parameter, so we use that.

Change-Id: I35cb34d9ba78186de88ff7b56ab89ee6e24db6e6
2018-09-05 16:18:35 +02:00
Julia Kreger 154d97b634 Follow-up patch to ramdisk interface
* Breaks up and updates a few tests
* Switches some checks to be capability based
* Add decoratores to ramdisk deploy interface
* Switches ramdisk deploy interface to use deploy_steps.

Change-Id: Ief730a8bd9750a9ed6828506c3642f4dd7246c46
2018-07-30 12:48:19 -07:00
Mark Goddard 65a68e4e96 Deploy steps - conductor & drivers
This adds a 'deploy_step' decorator. A deploy step must take as the
only positional argument, a TaskManager object.

A step can be executed synchronously or asynchronously. A step should
return None if the method has completed synchronously or
states.DEPLOYWAIT if the step will continue to execute asynchronously.
If the step executes asynchronously, it should issue a call to the
'continue_node_deploy' RPC, so the conductor can begin the next
deploy step.

Only steps with priorities greater than 0 are used.
These steps are ordered by priority from highest value to lowest
value. For steps with the same priority, they are ordered by driver
interface priority (see conductor.manager.DEPLOYING_INTERFACE_PRIORITY).

All in-tree DeployInterfaces are converted to have one big deploy_step
(their existing deploy() method).

A new RPC method 'continue_node_deploy' (RPC API version 1.45) is used
by deploy steps to notify the conductor to continue node deployment
(e.g. execute the next deploy step).

Similar to cleaning, the conductor gets the node's deploy steps and
executes them, one at a time (one deploy step right now). The conductor
also handles out-of-tree drivers that don't have deploy steps yet; a
warning is logged in these cases.

Co-Authored-By: Ruby Loo <rloo@oath.com>

Change-Id: I5feac3856cc4b87a850180b7fd0b3b9805f9225f
Story: #1753128
Task: #22592
2018-07-11 16:18:59 +00:00
Dmitry Tantsur 53e7baef42 Remove support for creating and loading classic drivers
* removes any bits related to loading classic drivers from
  the drivers factory code
* removes exceptions that only happen when classic drivers
  can be loaded
* removes the BaseDriver, moves the useful functionality to
  the BareDriver class
* /v1/drivers/?type=classic now always returns an empty list
* removes the migration updating classic drivers to hardware
  types

The documentation will be updated separately.

Change-Id: I8ee58dfade87ae2a2544c5dcc27702c069f5089d
2018-07-02 17:37:28 +02:00
Ilya Etingof 5e8f2e39d4 Adds boot mode support to ManagementInterface
This change introduces optional boot mode get/set methods
to driver management interface [1] [2] alongside existing
get/set boot device calls.

The management interface is called at deploy time to
synchronize BM machine boot mode setting with Ironic
node configuration whenever needed.

Also, this change introduces common exception class to
be eventually used by the drivers to communicate their
runtime errors to Ironic code in a uniformed way.

1. http://eavesdrop.openstack.org/irclogs/%23openstack-ironic/%23openstack-ironic.2018-01-09.log.html#t2018-01-09T15:54:16
2. http://eavesdrop.openstack.org/irclogs/%23openstack-ironic/%23openstack-ironic.2018-05-11.log.html#t2018-05-11T12:47:12

Story: 1734131
Task: 10640
Change-Id: If3db6ab8d3fae35d17808a231b7eecf11cf58327
2018-06-15 15:19:41 +00:00
Zuul 097be73f33 Merge "Fix FakeBIOS to allow tempest testing" 2018-06-05 09:28:01 +00:00
Yolanda Robla 4bc142e0dc Fix FakeBIOS to allow tempest testing
In order to start tempest testing using FakeBIOS, we
need to fix some issues, like enabling it on the fake
driver, and add the clean_steps decorators.

Change-Id: I7c47187b823c3a0ce1784849d401bd6baafe2542
2018-06-04 12:17:36 +02:00
Kaifeng Wang bce7f11785 Implements baremetal inspect abort
This patch implements the feature of baremetal inspect abort.

For a node in inspect wait state, an abort request initiates the process of
introspection abort.

Adds transision from ``inspect wait`` to ``inspect failed`` with event
``abort`` to the state machine.

Adds an ``abort`` interface to ``InspectInterface``, which raises
UnsupportedDriverExtension by default.

Implements the ``abort`` interface for ironic inspector inspect interface.

API microversion is bumped for backwards compatibility.

Closes-Bug: #10602
Story: #1703089
Task: #10602

Change-Id: I02a39ed08c7c64b36c6ef05678f0af6d8324c5e2
2018-05-30 21:04:37 +08:00
Zuul ce4594e2c5 Merge "BIOS Settings: Add BIOSInterface" 2018-05-10 15:35:59 +00:00
Julia Kreger 530a3ed088 Fix W504 errors
Also a few related errors based on some earlier investigation
may have been pulled in along the lines of E305.

Story: #2001985
Change-Id: Ifb2d3b481202fbd8cbb472e02de0f14f4d0809fd
2018-05-09 06:11:30 -07:00
Zenghui Shi 1e24ef9dde BIOS Settings: Add BIOSInterface
* Adds 'bios' interface to 'BaseDriver'

* Adds BIOSInterface driver class

* Adds fake & no-bios drivers and entries

* Implements it for 'fake-hardare' hardware type

* Adds configuration parameters:
  + [DEFAULT]/enabled_bios_interfaces
  + [DEFAULT]/default_bios_interface

* Adds 'bios_interface' field to Node object

* Handle 'bios_interface' field in _convert_to_version

* Adds bios in CLEANING_INTERFACE_PRIORITY

Drivers can implement this interface to do BIOS
configuration.

Co-Authored-By: Yolanda Robla Mota <yroblamo@redhat.com>
Co-Authored-By: Luong Anh Tuan <tuanla@vn.fujitsu.com>
Change-Id: I7e57130242b6cab21b54e35dc3c0b7819bdc43c0
Story: #1712032
2018-05-08 15:16:52 +08:00
Ruby Loo 3e92382d2e Clarify deprecation of "async" parameter
For vendor passthru decorators, the "async" parameter is deprecated.
This clarifies the messaging we emit (via logs and release notes), and
adds a TODO so we don't forget to delete the "async" parameter in
Stein cycle.

This is a follow up to Change-Id: I6299aafd30faae9a93df2cb901c1505df47e6b45.

Change-Id: I63ddf453584f4e7e8d2fa778ec50b8debcb86bf4
Task: 9289
Story: 1751306
2018-04-06 10:02:05 -04:00
Zuul 8b42df6f44 Merge "Do not use async parameter" 2018-03-29 19:20:05 +00:00
Ilya Etingof 548a2630bc Uniformly capitalize parameter description
This is the followup patch of https://review.openstack.org/#/c/526773/

It touches just ironic/drivers/base.py

Change-Id: Id8fcf80bf080c2ecb33783f895e55ecb32f8d4ab
2018-03-28 12:50:05 +02:00
Oleksiy Petrenko 0267c271d0 Do not use async parameter
We have method passthru that is accepting parameter async,
but since python 3.7 use async as reserved word,
the async parameter is deprecated,
async_call should be used instead.
async parameter will be removed in the next cycle.

Change-Id: I6299aafd30faae9a93df2cb901c1505df47e6b45
Task: 9289
Story: 1751306
2018-03-28 12:00:55 +03:00
Dmitry Tantsur 08ed859ce2 Revert "Don't try to lock for vif detach"
This is causing more serious issues, as there is a race
between tenant VIF removal and cleaning VIF adding.

This reverts commit 4f79cb3932.

The release note is not deleted from it, because the change has
already been released. A new one is added instead.

Change-Id: I922f24293645ff6bb79ad753f49dc9548b9f2485
Closes-Bug: #1750785
2018-02-21 18:33:35 +01:00
Zuul 180277a65a Merge "Add validate_rescue() method to boot interface" 2018-02-13 05:00:38 +00:00
Shivanand Tendulker 1c162058e3 Add validate_rescue() method to boot interface
Adds validate_rescue() method to boot interface to validate node's
boot properties related to rescue operation. This method is called
by the validate() method of rescue interface.

Closes-Bug: #1747467
Change-Id: Ib68d49a9cdb2ae4a5d43b90716c0a0c1166398c0
2018-02-09 06:43:29 -05:00
Zuul b73b8bc8fb Merge "Don't try to lock for vif detach" 2018-02-08 01:03:56 +00:00