summaryrefslogtreecommitdiff
path: root/ironic_python_agent/hardware.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Software RAID: Get component devices by md UUID"6.4.0Zuul2020-09-301-13/+50
|\
| * Software RAID: Get component devices by md UUIDArne Wiebalck2020-09-291-13/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | Scanning the output of mdadm commands for RAID members will miss component devices which are currently not part of the RAID. For proper cleaning it is better to scan block devices for a signature of the md device for which we would like to get the components. Story: #2008186 Task: #40947 Change-Id: Ib46612697851e36a16d272ccaeb0115106253863
* | Software RAID: Don't delete partitions too earlyArne Wiebalck2020-09-281-8/+17
|/ | | | | | | | | | Partions on the holder disk should only be deleted after all RAID devices have been deleted. Otherwise, super blocks on partitions which reside on the same disks cannot be cleaned. Story: #2008199 Task: #40979 Change-Id: I19293f5b992cd1fa68957d6f306dcec8f3b7a820
* Merge "Generate a TLS certificate and send it to ironic"Zuul2020-09-231-0/+8
|\
| * Generate a TLS certificate and send it to ironicDmitry Tantsur2020-09-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new flag (on by default) that enables generating a TLS certificate and sending it to ironic via heartbeat. Whether ironic supports auto-generated certificates is determined by checking its API version. Change-Id: I01f83dd04cfec2adc9e2a6b9c531391773ed36e5 Depends-On: https://review.opendev.org/747136 Depends-On: https://review.opendev.org/749975 Story: #2007214 Task: #40604
* | Fix backup node lookupJulia Kreger2020-09-091-1/+1
|/ | | | | | | | | | | | | | | | | | | | The node lookup code added in change I27201319f31cdc01605a3c5ae9ef4b4218e4a3f6 was slightly broken in that we call a method with a keyword arguemnt which doesn't exist. uuid versus node_uuid. It happens, it is a quick fix! Spotted on a metalsmith job: [-] Agent is requesting to perform an explicit node cache update. This is to pickup any chanages in the cache before deployment. [-] Failed to update node cache. Error lookup_node() got an unexpected keyword argument 'uuid' Change-Id: I59ecec65707a2f03918b233f1925395ebe59b8c4
* Update the cache if we don't have a root device hintJulia Kreger2020-08-251-3/+44
| | | | | | | | | | | | | | | | | | | | | | Or at least try to. Some deployments just don't use root device hints, and this is okay. However, other deployments need root device hints, and with fast track mode in ramdisks, we created a situation where the node cache could be updated by a human or software between the time the agent was started, and the deployment was requested. As a result, the agent has been updated to check if we have a hint and if we don't, update the cache from the node lookup endpoint. This is not needed when the inband deploy steps are executed, as the process of updating the steps does force the node cache to be updated. Change-Id: I27201319f31cdc01605a3c5ae9ef4b4218e4a3f6 Story: 2008039 Task: 40701
* Merge "Examples: add deploy_steps examples"Zuul2020-08-071-2/+3
|\
| * Examples: add deploy_steps examplesDmitry Tantsur2020-08-041-2/+3
| | | | | | | | Change-Id: Ifacd8fb05a80f34029965156334fbb707468f1f6
* | Merge "Return the final RAID configuration from apply_configuration"Zuul2020-07-291-1/+1
|\ \ | |/ |/|
| * Return the final RAID configuration from apply_configurationDmitry Tantsur2020-07-291-1/+1
| | | | | | | | | | | | | | AgentRAID expects it and fails with TypeError if it's not provided. Change-Id: Id84ac129bba97540338e25f0027aa0a0f51bde52 Story: #2006963
* | Allow erase_devices_metadata to be used as a deploy stepDmitry Tantsur2020-07-271-0/+6
|/ | | | | Change-Id: I75f156dd76b0e3aaa1592ba24fe42fb2a7057cc8 Story: #2006963
* Fix bootloader install issue with MDRAIDDoug Szumski2020-07-221-4/+26
| | | | | | | | | | | | | | When no root_device hint is set, an MDRAID partition can be incorrectly selected as the root device which causes installation of the bootloader to the physical disks behind the MDRAID volume to fail. See the notes in the referenced Story for more detail. This change adds a little more specificity to the listing of block devices. Change-Id: I66db457e71a0586723ee753bef961aec5bf58827 Story: 2007905 Task: 40303
* Ignore devices with size 0 when collecting inventoryDmitry Tantsur2020-07-091-2/+11
| | | | | | | | | delete_configuration still fetches all devices as it needs to clean ones with broken RAID. Story: #2007907 Task: #40307 Change-Id: I4b0be2b0755108490f9cd3c4f3b71a5e036761a1
* Limit Inspection->Lookup->Heartbeat lagJulia Kreger2020-07-031-0/+20
| | | | | | | | | | Caches hardware information collected during inspection so that the initial lookup can occur without any delay. Also adds logging to track how long inventory collection takes. Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com> Change-Id: I3e0d237d37219e783d81913fa6cc490492b3f96a
* Merge "Add a deploy step for writing an image"Zuul2020-06-201-0/+29
|\
| * Add a deploy step for writing an imageDmitry Tantsur2020-06-021-0/+29
| | | | | | | | | | | | | | The new step just invokes the appropriate method of the standby extension. Change-Id: Ic74f83ab2b7e58f8e4b46e0abfab79e221afeb3e Story: 2006963
* | Split and move logic for partition tablesRiccardo Pittau2020-05-251-15/+2
|/ | | | | | | Move and split the logic to create the partition tables when applying raid configuration. Change-Id: Ic76dd2067ace02dd02351caca0c7f9b05571e510
* Fix TypeError with newer version of lshwRiccardo Pittau2020-04-271-1/+2
| | | | | | | | | | | The issue with json output in lshw was fixed in version B.02.19 This patch makes the memory calculation compatible with that version and later versions that are included in recent distributions (e.g. Ubuntu 20.04, Fedora 31) Change-Id: Id5a30028b139c51cae6232cac73a50b917fea233 Story: 2007588 Task: 39527
* Add function to calculate memoryRiccardo Pittau2020-04-271-16/+22
| | | | | | Move logic to calculate memory to its own function. Change-Id: I5ab98b6450ff45dff35ddae093a83140f37047a8
* Merge "Add raid.apply_configuration deploy step"Zuul2020-04-211-12/+40
|\
| * Add raid.apply_configuration deploy stepDmitry Tantsur2020-04-201-12/+40
| | | | | | | | | | | | | | | | For compatibility with out-of-band RAID deploy steps, we need to have one apply_configuration step, not a create/delete pair. Change-Id: I55bbed96673c9fa247cafdac9a3ade3a6ff3f38d Story: #2006963
* | Merge "Simplify deduplicate_steps"Zuul2020-04-211-16/+5
|\ \ | |/ |/|
| * Simplify deduplicate_stepsDmitry Tantsur2020-04-061-16/+5
| | | | | | | | | | | | The same result can be achieved using a multi-component sorting key. Change-Id: Ieacf9fcecb2a6de7b4ccd8889f789099af39aa37
* | Move logic to calculate raid sectors to raid_utilsRiccardo Pittau2020-04-091-17/+3
| | | | | | | | | | | | Some more raid related logic moved to raid_utils. Change-Id: I08c73ad14e5b01ebac2490b83997c5452506d4a2
* | Merge "Move logic for raid start sector to raid_utils"Zuul2020-04-091-29/+2
|\ \
| * | Move logic for raid start sector to raid_utilsRiccardo Pittau2020-04-081-29/+2
| | | | | | | | | | | | | | | | | | A starting tentative in reducing size of raid related functions. Change-Id: I81f912d0dc0ad138d8cc776cdb4ee3b5251ec3ba
* | | Merge "Add an ability to run in-band deploy steps"Zuul2020-04-091-0/+163
|\ \ \ | |/ / |/| / | |/
| * Add an ability to run in-band deploy stepsMark Goddard2020-04-061-0/+163
| | | | | | | | | | | | | | | | | | Mostly adaptation of cleaning methods. Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com> Change-Id: Ife0502391bbece46d619a20a825dfdb191d5c2b4 Story: 2006963 Task: 37791
* | Editing follow-up for UEFI Software RAID supportArne Wiebalck2020-04-061-4/+5
| | | | | | | | | | | | | | | | This is a follow-up to https://review.opendev.org/#/c/696156/ Change-Id: I0fd2c09045ff07a57374934c35d4a3a8467f5e99 Story: #2006379 Task: #37635
* | Software RAID: Add UEFI supportRaphael Glon2020-04-021-9/+42
|/ | | | | | | | | | | | | | | | The proposed changes concern two steps: First, when creating the RAID configuration, have a GPT partition table type (this is not necessary, but more natural with UEFI). Also, leave some space, either for the EFI partitions or the BIOS boot partitions, outside the Software RAID. Secondly, when installing the bootloader, make sure the correct boot partitions are created or relocated. Change-Id: Icf0a76b0de89e7a8494363ec91b2f1afda4faa3b Story: #2006379 Task: #37635
* Merge "Only check for partitions on devices that are part of software RAID"Zuul2020-04-021-13/+13
|\
| * Only check for partitions on devices that are part of software RAIDDmitry Tantsur2020-04-011-13/+13
| | | | | | | | | | | | | | | | Now that an operator can pick the devices that participate in RAID, it no longer makes sense to verify all devices. Change-Id: Id5d8d539183f0db4ba3c4132ce6bc9919f9cd1ea Story: #2006369
* | Merge "Allow specifying target devices for software RAID"Zuul2020-04-011-13/+30
|\ \ | |/
| * Allow specifying target devices for software RAIDDmitry Tantsur2020-03-171-13/+30
| | | | | | | | | | | | | | | | | | This change adds support for the physical_disks RAID parameter in a form of device hints (same as for root device selection). Change-Id: I9751ab0f86ada41e3b668670dc112d58093b8099 Story: #2006369 Task: #39080
* | Bump hacking to 3.0.0Riccardo Pittau2020-03-301-11/+11
| | | | | | | | Change-Id: I1032ea6a2e9d79aeaecb1458c319cbeb15ac1fff
* | Improve debug logging around Raid/BootloaderJulia Kreger2020-03-281-0/+1
|/ | | | Change-Id: I7d34b918a859972a2d5650494824d3333016dd11
* Ignore pyudev errors about device numberJulia Kreger2020-02-111-0/+5
| | | | | | | | | | | | | | Pyudev is used to return extra data about a device using the udev interface. Sometimes that lookup doesn't quite work, like on md devices after restarting them. As such, we will now tollerate the failure and continue the process as before. Change-Id: Ibbc1759fe2cd3d7d09019b4e80d3c61d54c844dd Story: 2007281 Task: 38726
* Skip read-only devices with metadata eraseJulia Kreger2020-01-291-0/+38
| | | | | | | | | | | | | | | | | | HPE "Virtual Install Devices" appear as read-only block devices, and may... or may not be visible depending on the bios configuration state. These devices can no longer be disabled from the bios settings so the simplest course of action seems to be that we should handle the existence of a read-only device. In the event of secure erase, this is treated as a hard failure case and a driver_internal_info flag has been added to enable a future bypass method for knowledgable operators. Change-Id: Ief8b360d11e654d8fae3a04a2a9f8d474a06e167 Story: 2007229 Task: 38502
* Expose collector and hardware manager names via introspection dataDmitry Tantsur2020-01-221-17/+5
| | | | | | | This change adds a new introspection data field 'configuration' with two lists: managers and collectors. Change-Id: Ice0d7e6ecff3f319bc3a4f41617059fd6914e31c
* Merge "Allow reading root_device from instance_info"Zuul2020-01-141-1/+3
|\
| * Allow reading root_device from instance_infoDmitry Tantsur2020-01-031-1/+3
| | | | | | | | | | | | | | | | | | For the future deployment API we need to be able to set root_device per deployment in addition to per node. This change adds it. Change-Id: I1dd046c2e5fca211a84290bac8daa7550b21614f Story: #2006910 Task: #37955
* | Merge "Collect lsblk and /proc/mdstat with ramdisk logs"Zuul2020-01-101-0/+1
|\ \ | |/ |/|
| * Collect lsblk and /proc/mdstat with ramdisk logsDmitry Tantsur2019-10-141-0/+1
| | | | | | | | | | | | This should improve debugability of partitioning problems. Change-Id: I3c7ae3f2831c9900a3f0d24daec6dd6b8bea6a60
* | Merge "Stop using six library"Zuul2019-12-031-8/+3
|\ \
| * | Stop using six libraryRiccardo Pittau2019-11-291-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: I4795417aa649be75ba7162a8cf30eacbb88c7b5e
* | | Replace netaddr dependency with stdlib ipaddressDmitry Tantsur2019-12-021-7/+7
|/ / | | | | | | | | | | | | | | | | netaddr is quite a big library, and all we need is covered by the built-in ipaddress module (available in python 3). Also add a safeguard for invalid 'ip route' output. Change-Id: I9d76a8d1c1b6b1585e301a9c63b37fab3b98746f
* | RAID 5/6Julia Kreger2019-11-271-2/+12
| | | | | | | | | | | | | | | | | | | | | | Looks like adding RAID 5/6 support may be easier than most could immagine. The code, as written appears to be safe and logical creating a RAID 5 or RAID 6 volume. Not that we can really test this in CI, but it seems only validation code needs to be changed to loosen the constraint. Change-Id: Ib891b3c97f0bfb02af3b59581a451c4b25e03b85
* | Set rd.md.uuid kernel parameter when deploying on software raidAndrei Nistor2019-10-171-0/+18
|/ | | | | | | | | | | | When deploying an image to a software raid array, it is currently required that the deployed image assembles the md arrays automatically so that the rootfs can be mounted. In order to remove this requirement/limitation on the deployed image we can add rd.md.uuid to the kernel command line with the raid array's uuid. Story: 2006648 Task: 36884 Change-Id: I42cb198753ecd84b7eaef6b5aa7c2064535bfe0e
* Merge "Delete_configuration, consider removed raid members as well"Zuul2019-09-241-2/+64
|\