summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/redfish/management.py
Commit message (Collapse)AuthorAgeFilesLines
* Handle MissingAttributeError when using OOB inspections to fetch MACsJacob Anders2023-05-021-1/+10
| | | | | | | | | | Currently, if an attempt is made to fetch MAC address information using OOB inspection on a Redfish-managed node and EthernetInterfaces attribute is missing on the node, inspection fails due to a MissingAttributeError exception being raised by sushy. This change adds catching and handling this exception. Change-Id: I6f16da05e19c7efc966128fdf79f13546f51b5a6
* Add more sources to redfish firmware upgradeAija Jauntēva2022-01-171-4/+68
| | | | | | | | | | | | | | Adds swift and file support for `redfish` management interface `firmware_update` step. Adds `source` to step and `[redfish]firmware_source` to config for setting up if and how files are staged. Support `http`, `local` and `swift` for staging. Adds `checksum` to step for checksum verification when file is staged. Story: 2008723 Task: 42067 Change-Id: Ibcc7815b32344d67f912d7dcda7283bac3582316
* Fix validating input for redfish update_firmwareAija Jauntēva2022-01-131-0/+2
| | | | | | | Story: 2009772 Task: 44249 Change-Id: I8e559b3c7e833c361e12d01d744510ac5c8d8cf6
* Use driver_internal_info methods for redfish driverSteve Baker2022-01-051-9/+5
| | | | | | | | | This change switches the redfish driver classes to using set_driver_internal_info, del_driver_internal_info, timestamp_driver_internal_info node methods for modifying driver_internal_info. Change-Id: If0643bebcee6aea81b6a199353f9dc81656365ac
* Fix redfish update_firmware for newer SushyAija Jauntēva2021-12-131-1/+1
| | | | | | | | `TaskMonitor.task_monitor` is deprecated and was removed from sushy at Ie48fab19199c0c2f3455d2212d50460a29685eed. Somehow missed to update it for `redfish` firmware upgrade steps previously. Change-Id: Iced8e921335995e1e084d6e632c6e81d3fc9249f
* Stop relying on explicit values of Redfish constantsDmitry Tantsur2021-11-101-3/+22
| | | | | | | | | | | | There are a few places in unit tests where we rely on Redfish constants having well-known values. Use constants themselves instead. An even more problematic place is _set_boot_device: it relies on storing Redfish constants in driver_internal_info. With the future switch to enums, it will no longer be possible. Use Ironic constants and provide a compatibility layer. Change-Id: I8e075f808e013afd778dd7cdc0927fe339309b70
* Fix RedfishManagement.get_mac_addresses and related functionsDmitry Tantsur2021-11-091-3/+2
| | | | | | | | | | | RedfishManagement.get_mac_addresses has two problems: * It returns a dict while the base class documents returning a list * The dict's values are Redfish-specific values This change fixes this function to return a list and significantly simplifies the related create_ports_if_not_exists. Change-Id: I329cabe04662d0d668d4c3e04ecede5b4fdec6c6
* node_periodics: encapsulate the interface class checkDmitry Tantsur2021-10-121-10/+2
| | | | Change-Id: I887d4fe4836bc58b5605e950a4287f0d27a590cb
* Add a helper for node-based periodicsDmitry Tantsur2021-10-111-85/+31
| | | | | | | | | | | | | | | We have a very common pattern of periodic tasks that use iter_nodes to fetch some nodes, check them, create a task and conductor some operation. This change introduces a helper decorator for that and migrates the drivers to it. I'm intentionally leaving unit tests intact to demonstrate that the new decorator works exactly the same way (modulo cosmetic changes) as the previous hand-written code. Change-Id: Ifed4a457275d9451cc412dc80f3c09df72f50492 Story: #2009203 Task: #43522
* Add and document high-level helpers for async stepsDmitry Tantsur2021-10-111-5/+1
| | | | | | | | | | The pattern we use right now is too verbose to even put in documentation. This change adds two more helpers: * deploy_utils.prepare_agent_boot replaces the omnipresent 2-line snippet around task.boot.prepare_ramdisk. * deploy_utils.reboot_to_finish_step adds rebooting to it. Change-Id: I88540268d3bacebda775a0e94015c29a82c2c6a0
* Fix driver task pattern to reduce periodic db loadJulia Kreger2021-09-131-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a pattern of periodic tasks was created where nodes, and in many cases, all nodes not actively locked nor those in maintenance state, were pulled in by a periodic task. These periodic tasks would then create tasks which generated additional database queries in order to populate the task object. With the task object populated, the driver would then evaluate if the driver in question was for the the driver interface in question and *then* evaluate if work had to be performed. However, that field containing a pointer to if work needed to be performed as often already queried from the database on the very initial query to generate the list of nodes to evaluate. In essence, we've moved this up in the sequence so we evaluate that field in question prior to creating the task, potentially across every conductor, depending on the query, and ultimately which drivers are enabled. This saves potentially saves hundreds of thousands of needless database queries on a medium size deployment per single day, depending on which drivers and driver interfaces are in use. Change-Id: I409e87de2808d442d39e4d0ae6e995668230cbba
* Update to not use deprecated `get_task_monitor`.Aija Jauntēva2021-04-081-3/+3
| | | | | | | `update_service.get_task_monitor` is deprecated, using top level `get_task_monitor` instead. Change-Id: Ib028313ee14744a2c016ebaa463e6bfc3a4cc5f0
* Restrict syncing of boot mode to SupermicroBob Fournier2021-03-311-1/+6
| | | | | | | | | | | | The fix for https://storyboard.openstack.org/#!/story/2008252 synced the boot mode after changing the boot device, because Supermicro nodes reset the boot mode if not included in the boot device set. However this can cause a problem on Dell nodes when changing the mode uefi->bios or bios->uefi. Restrict the syncing of the boot mode to Supermicro. Story: 2008712 Task: 42046 Change-Id: I9f305cb3f33766c1c93cf4347368b1ce025fc635
* Merge "Use OOB inspection to fetch MACs for IB inspection"Zuul2021-03-221-0/+19
|\
| * Use OOB inspection to fetch MACs for IB inspectionJacob Anders2021-02-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Allow unsupported redfish set_boot_modeSteve Baker2021-03-191-0/+13
|/ | | | | | | | | | | | | | | | | | | Currently if the baremetal boot mode is unknown and the driver doesn't support setting the boot mode then the error is logged and deployment continues. However if the BMC doesn't support getting or setting the boot mode then setting the boot mode raises an error which results in the deploy failing. This is the case for HPE Gen9 baremetal, which doesn't have a 'BootSourceOverrideMode' attribute in its system Boot field, and raises a 400 iLO.2.14.UnsupportedOperation in response to setting the boot mode. This is raised from set_boot_mode as a RedfishError. This change raises UnsupportedDriverExtension exception when the 'mode' attribute is missing from the 'boot' field, allowing the deployment to continue. Change-Id: I360ff8180be252de21f5fcd2208947087e332a39
* Merge "Redfish secure boot management"Zuul2021-02-031-0/+113
|\
| * Redfish secure boot managementDmitry Tantsur2021-01-261-0/+113
| | | | | | | | | | | | Story: #2008270 Task: #41137 Change-Id: Ied53f8dc5b93522ac9ffc25ec93ad2347a7d1c7c
* | Fixes issue of redfish firmware updateankit2021-01-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently ilo5 based hardware does not support redfish based firmware update. This patch fixes the issue by making the change to to check whether sushy_task.messages is present. It was also not calling prepare_ramdisk() before rebooting the system to update the firmware which has been fixed in this patch. Change-Id: I9d70fed0de1829973748c06a1342d7a7af0f93d4 Story: #2008403 Task: #41339
* | For Supermicro BMCs set enable when changing boot deviceBob Fournier2021-01-291-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting the boot settings on Supermicro BMCs, the BootSourceOverrideEnabled must be set to the desired value whenever the BootSourceOverrideTarget is set or it will revert to the default value (Once). This is different than what is currently implemented for other BMCs in which the BootSourceOverrideEnabled is not set if it matches the current setting. This change uses the vendor setting to determine if it's a Supermicro BMC. Story: 2008547 Task: 41652 Change-Id: I1b1a6baafd4cc4daa2fbdb82f69ded6253b1fcbf
* | Refactor vendor detection and add Redfish implementationDmitry Tantsur2021-01-281-0/+15
|/ | | | | | | | | | | | | | | | Get rid of the TODO in the code and prepare for more management interfaces supporting detect_vendor(). Vendor detecting now runs during transition to manageable and on power state sync (essentially same as before but for all drivers not only IPMI). Update the IPMI implementation to no longer hide exceptions since they're not handled on the upper level. Simplify the regex and fix the docstring. Add the Redfish implementation as a foundation for future vendor-specific changes. Change-Id: Ie521cf2295613dde5842cbf9a053540a40be4b9c
* Update `cleaning_error_handler`Aija Jauntēva2020-11-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Update `cleaning_error_handler` to match with `deploying_error_handler` that logs all errors and optionally separates between logged message and `last_error`. Logged message usually contains node's uuid as there is no context for node in stream of log entries. `last_error` usually does not contain node's uuid as it is already displayed in the context of node. Impact: * There were messages that were only added to node's last_error. Now they are going to be logged too. * No need to log explicitly before `cleaning_error_handler`. Such occurrences have been removed. * Where there were different message for log and last_error it is kept. Where there was only 1 message, it is left as it is to be both logged and updated in `last_error`. * Exception logging is replaced with error logging with traceback. Story: 2008307 Task: 41198 Change-Id: I813228fb47a51ee6c45b420322acabdf565ff752
* Sync boot mode when changing the boot device via RedfishBob Fournier2020-10-191-0/+5
| | | | | | | | | | | After changing the boot device via Redfish, check that the boot mode being reported matches what is configured and, if not, set it to the configured value. Some BMCs change the boot mode when the device is set via Redfish, this will ensure the mode is set properly. Change-Id: Ib077f7f32de029833e6bd936853c382305bce36e Story: 2008252 Task: 41103
* Redfish driver firmware updateChristopher Dearborn2020-09-281-0/+337
| | | | | | | | | | | | This patch adds support for performing firmware updates using the redfish and idrac hardware types. Co-Authored-By: Aija Jaunteva <aija.jaunteva@dell.com> Change-Id: Ie8f3f68c4a771121ec0ee13ce9349c7cd2b1e567 Depends-On: https://review.opendev.org/#/c/745950 Story: 2008140 Task: 40872
* Correct Redfish boot once fallback conditionalRichard Pioso2020-07-051-1/+1
| | | | | | | | | | | This corrects the variable examined to determine if falling back from Redfish boot source override enabled continuous to once should be performed. The value of the variable 'enabled', instead of 'desired_enabled', should be used. Story: 2007733 Task: 40273 Change-Id: I26bf32c7f824e8e5ca7018d491e0bc9dc96a8671
* Fix Redfish handle no continuous override boot srcRichard Pioso2020-06-151-11/+15
| | | | | | | | | | | | | | | | | | | | | Some hardware Redfish services have dropped support for continuously overriding the boot source when the boot mode is Unified Extensible Firmware Interface (UEFI). See this discussion: http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014543.html A workaround falls back to one-time override, restoring it on every reboot or power on. [1] However, it does not work, because, per the Distributed Management Task Force (DMTF) Redfish standard, one-time override is disabled on the next boot cycle. [2] This fixes that by explicitly setting the boot source override to one-time every time it is restored. [1] https://storyboard.openstack.org/#!/story/2007527 [2] https://redfish.dmtf.org/schemas/v1/ComputerSystem.v1_11_0.json Story: 2007733 Task: 39897 Change-Id: I6f5a11a77e7b16cdd0d837fdec51c3e9aeea9a31
* redfish: handle hardware that is unable to set persistent bootDmitry Tantsur2020-05-081-4/+70
| | | | | | | | | | | | Some hardware has dropped support for continuous boot, see this thread: http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014543.html Work around by falling back to one-time boot device, restoring it on every reboot or power on. Story: #2007527 Task: #39320 Change-Id: I762056dea4f7b8ccdb8f95b2f21e26b45763905d
* Improve `redfish` set-boot-device behaviourIlya Etingof2020-04-061-2/+9
| | | | | | | | | | | | | | Makes management interface of `redfish` hardware type not changing current boot frequency if currently set one is the same as the desired one. The goal is to avoid touching potentially faulty BMC option whenever possible. This should hopefully improve interoperability with Redfish BMCs. Depends-On: https://review.opendev.org/710751 Change-Id: I380cd3aae410e05a4519c3764140ced121bf7fe7 Story: 2007355 Task: 38937
* Improve `redfish` set-boot-mode implementationIlya Etingof2020-04-061-21/+2
| | | | | | | | | | | Refrain from touching unrelated boot params when setting boot mode through Redfish BMC. This should hopefully improve interoperability with Redfish BMCs. Change-Id: I461e54012045463b5e97daf26a93eb9dce6f6964 Story: 2007355 Task: 38910
* Fix the remaining hacking issuesDmitry Tantsur2020-03-311-6/+9
| | | | | | | | | | Fixes W504 and E117, resulting in some indentation changes. Also fixes code that exceeds the complexity requirement, that is bumped to 20 (mostly to avoid refactoring the agent heartbeat call, resulting in conflicts for the deploy steps work). Change-Id: I8e49f2c039b0ddfca9138f8e148708b7e8b5df7e
* Add indicator management to redfish hw typeIlya Etingof2019-11-211-0/+209
| | | | | | | | | | | Implements necessary indicator management calls to redfish driver to actually read/set system/chassis and drive LEDs through Redfish. The spec: https://review.opendev.org/#/c/655685/7/specs/approved/expose-hardware-indicators.rst Change-Id: Ib9ccdfa41974cd353af8a517dc2917f129e49e03 Story: 2005342 Task: 30471
* Fix drive sensors collection in `redfish` mgmt interfaceIlya Etingof2019-10-141-4/+2
| | | | | | | | | Fixes drive sensors information collection in `redfish` management interface. Prior to this fix, wrong Redfish schema has been used for Drive resource what has been causing exception and ultimately sensor data collection failure. Change-Id: I8b0f69d13420fa0a3fc21f044ed2bba6a540e638
* Failure in get_sensor_data() of 'redfish' management interfaceShivanand Tendulker2019-07-171-3/+3
| | | | | | | | | | | | This patch fixes following issues in get_sensor_data(): - Uses 'identity' field instead of unsupported field 'member_id' in Sushy's PowerSupplyListField - get_members() is not supported for Sushy's list fields like FansListField and TemperaturesListField Change-Id: I534d78fa9c9fc2573c7b6e15c3356da234f063ec Story: 2006229 Task: 35830
* Collect sensor data in ``redfish`` hardware typeIlya Etingof2019-06-241-4/+147
| | | | | | | | | Adds sensor data collector to ``redfish`` management interface. Temperature, power, cooling and drive health metrics are collected. Change-Id: I8accdcc73c7e0261579d753633f9dfc02a868115 Story: 2005878 Task: 33692
* Added Redfish boot mode managementIlya Etingof2018-06-181-3/+84
| | | | | | | | | This change adds node boot mode management to the Redfish driver. Story: 1731013 Task: 9271 Change-Id: I3aa11cc0ce9da9cf6c801300370bd7ce420f434a
* Add redfish driverLucas Alvares Gomes2017-04-211-0/+173
This patch is adding a redfish driver based on the sushy library. This is just a basic driver that currently supports: * Power: Hard power on/off/reboot, soft power off/reboot * Management: Setting the boot device (PXE, disk, cd-rom and bios) and its frequency (persistent or not) * Management: NMI Injection * SSL authentication Unittest coverage for the redfish modules is now in 100%, let's try to keep it this way (-: Documentation and DevStack updates will be done on subsequent patches. Partial-Bug: #1526477 Change-Id: I14470edff65cd14bb73263ec7310559a8eaa6c84