summaryrefslogtreecommitdiff
path: root/ironic/drivers/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Upgrade to latest hacking - v6"Zuul2023-04-301-1/+1
|\
| * Upgrade to latest hacking - v6Jay Faulkner2023-04-211-1/+1
| | | | | | | | | | | | Required minor changes to existing files to comply with new flake rules. Change-Id: Ia0bff27ab4a7ec98c533ea66357a3c0529026102
* | Remove all references to the "cpus" propertyDmitry Tantsur2023-03-281-1/+1
|/ | | | | | | | 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
* Add support for verify stepsJacob Anders2021-09-301-2/+87
| | | | | | | | | | | | 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
* Add agent_status and agent_status_message params to heartbeatArun S A G2021-03-311-1/+4
| | | | | | | | | | | | | | | | | | | | 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
* Merge "Use OOB inspection to fetch MACs for IB inspection"Zuul2021-03-221-0/+11
|\
| * Use OOB inspection to fetch MACs for IB inspectionJacob Anders2021-02-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | API to force manual cleaning without booting IPADmitry Tantsur2021-03-161-2/+8
|/ | | | | | | | | | | | | | 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
* Common framework for configuring secure bootDmitry Tantsur2021-01-191-0/+34
| | | | | | | | | | 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
* Merge "IPMI: Handle vendor set boot device differences"Zuul2020-12-141-0/+18
|\
| * IPMI: Handle vendor set boot device differencesJulia Kreger2020-12-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix DHCP-less operations with the noop network interfaceDmitry Tantsur2020-11-101-1/+1
|/ | | | | | | | 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
* Accept and use a TLS certificate from the agentDmitry Tantsur2020-09-091-1/+3
| | | | | | | | | | | | | | 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
* Account for power interfaces that cannot power onDmitry Tantsur2020-07-201-0/+12
| | | | | | | | | | 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
* Add `get_node_network_data` method to NetworkInterfaceIlya Etingof2020-05-251-0/+20
| | | | | | | | | | | | | | | 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
* Bump hacking to 3.0.0Dmitry Tantsur2020-03-311-1/+1
| | | | | | | | | | | | | 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
* Stop using six libraryRiccardo Pittau2019-12-231-8/+6
| | | | | | | | | | 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
* Foundation for boot/network management for in-band inspectionDmitry Tantsur2019-11-211-0/+43
| | | | | | | | | 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
* Add indicator management harness to ManagementInterfaceIlya Etingof2019-08-261-0/+83
| | | | | | | | | | | | | | 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
* Add new method 'apply_configuration' to RAIDInterfaceShivanand Tendulker2019-08-141-5/+81
| | | | | | | | | | | | | 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
* Deploy Templates: factor out ironic.conductor.stepsMark Goddard2019-03-151-2/+2
| | | | | | | | | There is enough steps code in conductor.utils to warrant a separate module. Change-Id: I0126e860210bbc56991876f26e64d81d3d7d5c08 Story: 1722275 Task: 29902
* Allow methods to be both deploy and clean stepsMark Goddard2019-03-131-1/+1
| | | | | | | | | This means we can add clean_step and deploy_step decorators to a driver interface method. Change-Id: Ic964ec706349a74ff371d91b1d7203d942c81fb0 Story: 2005223 Task: 30005
* Add support for Smart NICsHamdy Khader2019-02-071-0/+8
| | | | | | | | | | | | | | | | 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
* [Refactor] Make caching BIOS settings explicitDmitry Tantsur2019-02-061-22/+12
| | | | | | | | | | | | | | | 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
* Merge "Fix async keyword for Python 3.7"Zuul2018-09-251-28/+7
|\
| * Fix async keyword for Python 3.7Michal Arbet2018-09-051-28/+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
* | Honors return value from BIOS interface cleanstepsvmud2132018-09-181-1/+2
|/ | | | | | | | | | | 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
* Follow-up patch to ramdisk interfaceJulia Kreger2018-07-301-0/+1
| | | | | | | | | * 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
* Deploy steps - conductor & driversMark Goddard2018-07-111-10/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove support for creating and loading classic driversDmitry Tantsur2018-07-021-100/+54
| | | | | | | | | | | | | | | | * 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
* Adds boot mode support to ManagementInterfaceIlya Etingof2018-06-151-0/+65
| | | | | | | | | | | | | | | | | | | | | 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
* Merge "Fix FakeBIOS to allow tempest testing"Zuul2018-06-051-1/+1
|\
| * Fix FakeBIOS to allow tempest testingYolanda Robla2018-06-041-1/+1
| | | | | | | | | | | | | | | | 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
* | Implements baremetal inspect abortKaifeng Wang2018-05-301-0/+16
|/ | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "BIOS Settings: Add BIOSInterface"Zuul2018-05-101-2/+90
|\
| * BIOS Settings: Add BIOSInterfaceZenghui Shi2018-05-081-2/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Fix W504 errorsJulia Kreger2018-05-091-2/+2
|/ | | | | | | | 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
* Clarify deprecation of "async" parameterRuby Loo2018-04-061-4/+9
| | | | | | | | | | | | | 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
* Merge "Do not use async parameter"Zuul2018-03-291-11/+31
|\
| * Do not use async parameterOleksiy Petrenko2018-03-281-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Uniformly capitalize parameter descriptionIlya Etingof2018-03-281-49/+49
|/ | | | | | | | This is the followup patch of https://review.openstack.org/#/c/526773/ It touches just ironic/drivers/base.py Change-Id: Id8fcf80bf080c2ecb33783f895e55ecb32f8d4ab
* Revert "Don't try to lock for vif detach"Dmitry Tantsur2018-02-211-4/+0
| | | | | | | | | | | | | This is causing more serious issues, as there is a race between tenant VIF removal and cleaning VIF adding. This reverts commit 4f79cb3932f2518ab3f06b86ceea065cbb399e8c. 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
* Merge "Add validate_rescue() method to boot interface"Zuul2018-02-131-0/+11
|\
| * Add validate_rescue() method to boot interfaceShivanand Tendulker2018-02-091-0/+11
| | | | | | | | | | | | | | | | | | 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
* | Merge "Don't try to lock for vif detach"Zuul2018-02-081-0/+4
|\ \
| * | Don't try to lock for vif detachJulia Kreger2018-02-071-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically, we did not have a prohibition upon removing a VIF entry stored in the extra field, however the VIF attachment/detachment feature resulted in a task being created which by default attempts to pull a reservation lock unless explicitly shared. This is problematic as part of the process of undeploying a node as exclusive locks are generated. Presently, if any of those locked tasks run long, such as a new image being required or for some crazy reason, the BMC power request hangs for a few minutes, the VIF record may be orphaned and never removed, as the expectation is that nova deletes the VIF record from ironic. This allows the VIF record to be removed when a node is no longer in active use and possibly subject to a lock being held for a long period of time, such as when setting up for CLEANING. Additionally, this patch moves the actual VIF record deletion until after the detachment action in the event that it fails. This allows for the state in ironic to be consistent instead of the record being removed before the detachment occurs. Change-Id: Ib7544e43a2b26441d4f562b584bbc7fee6a11fea Closes-Bug: #1743652
* | Modify error quotation markswudong2018-02-061-4/+4
|/ | | | | modify Chinese quotation marks to English Change-Id: I60b038f997f0e84e75a2902bf0e8c0606312ea71
* Add validate_rescue() method to network interfaceShivanand Tendulker2018-02-051-0/+10
| | | | | | | | Adds validate_rescue() method to network interface to validate rescuing network. This method is called by rescue.validate(). Change-Id: Iccac602047eec10f03ef6eaf2dbe716efd6e7f9a Closes-Bug: #1747100
* Remove mode argument from boot.(prepare|clean_up)_ramdiskJim Rollenhagen2018-02-011-10/+2
| | | | | | | | | | | | | | | | | | | | | Ideally, the boot interface shouldn't care if it's booting an image for deploy or rescue. The first step to unwinding this is not passing the mode argument into the boot interface - for now, we infer it from the state. Also stop validating whether the boot interface methods have a mode argument, as this is totally broken anyway (due to the decorator on the method). The rest of the boot interface's knowledge about deploy vs rescue can be eliminated in the future, as we shouldn't rework too much of that during feature freeze. We fix the bug in validation this way for now, for two reasons: * This argument really doesn't belong, and it's only been on master for six days. Get it out before people use it. * Library updates are currently frozen; fixing the decorator isn't an option right now. Change-Id: Icdeb870e9fd9cf836ff7ab97624189c8436adaba Closes-Bug: #1746730
* Deprecate classic driversDmitry Tantsur2018-01-311-1/+3
| | | | | | | | Also address small issues in the release note for the migration to hardware types. Change-Id: I32998c5508e01882714a76751482a916d066f938 Partial-Bug: #1690185