summaryrefslogtreecommitdiff
path: root/ironic_python_agent
Commit message (Collapse)AuthorAgeFilesLines
* Force immediate NTP time sync with chronyd at IPA startup7.0.2Arne Wiebalck2021-08-103-46/+13
| | | | | | | | | | | | | | | In order to make sure we have the correct time early, e.g. by the time we create a TLS certificate, this patch proposes to force an immediate NTP update when using chronyd. While the previous approach uses the passed NTP server as well, the update may happen only after chronyd has performed measurements (which may be too late). Story: #2009058 Task: #42843 Change-Id: I6edafe8edeb8549f324959e7a1ec175c3049a515 (cherry picked from commit 5531d5cee744f90ff24231a9ef467282b254adc2)
* Merge "Only mount the ESP if not yet mounted" into stable/wallabyZuul2021-06-282-7/+13
|\
| * Only mount the ESP if not yet mountedArne Wiebalck2021-06-252-7/+13
| | | | | | | | | | | | | | | | Check if the ESP is already mounted before attempting to mount it for the bootloader installation. Change-Id: Ifd738b2c5663f1a211d7e13b5ba386be631d8db1 (cherry picked from commit 27568204aeb7f063bf236ad7f2f8043db627baa9)
* | Coalesce heartbeatsDmitry Tantsur2021-06-252-9/+56
|/ | | | | | | | | | | | | | | | | | | The IPA sends heartbeats to the conductor periodically and when requested, e.g. at the end of asynchronous commands. In order to avoid to send such notifications in too quick succession, e.g. when two asynchronous commands finish at the same time or when the periodic heartbeat was just sent right before a command ended, this patch proposes to coalesce heartbeats which are close together timewise and send only one for all of them in a time interval of 5 seconds. Co-Authored-By: Arne Wiebalck <arne.wiebalck@cern.ch> Story: #2008983 Task: 42633 Change-Id: Idfbce44065e1e5a8b730b94741b2604c51f0ab14 (cherry picked from commit b605943796c24a174f0709b84170e0c6de7f4238)
* Reduce logging verbosity when collecting logsDmitry Tantsur2021-06-141-2/+1
| | | | | | | | | It's not uncommon that some commands fail when collecting logs. We already log all failures in utils.execute, no need to duplicate them with a non-fatal ERROR logging. Change-Id: If151b3a3be979bd2b3ce01030e5d6242ad74eaa3 (cherry picked from commit 2fcf35e56d578d98d77ffc97b6441f83548d7704)
* Utilize CSV file for EFI loader selectionJulia Kreger2021-06-112-14/+115
| | | | | | | | | | | | | | | | | | | | | | | Adds support to identify and utilize a CSV file to signal which bootloader to utilize, and set it when the OS is running as opposed to when EFI is running. This works around EFI loader potentially crashing some vendors hardware types when entry stored in the image does not match the EFI loader record which was utilzied to boot. Grub2+shim specifically specifically needs the CSV file name and entry label to match what the system was booted with in order to prevent the machine from potentially crashing. See https://storyboard.openstack.org/#!/story/2008962 and https://bugzilla.redhat.com/show_bug.cgi?id=1966129#c37 for more information. Change-Id: Ibf1ef4fe0764c0a6f1a39cb7eebc23ecc0ee177d Story: 2008962 Task: 42598 Co-Authored-By: Bob Fournier <bfournie@redhat.com> (cherry picked from commit 2fab70c36ba40a345a9dd01aeb5019681e567aa5)
* Make _get_efi_bootloaders return relative pathsSteve Baker2021-06-112-17/+27
| | | | | | | | | | | | | | | | To make this function useful for purposes other than efibootmgr entries, this change moves the path manipulation to _run_efibootmgr. This change also adds boot*.efi entries to BOOTLOADERS_EFI so that it includes every entry in the UEFI Spec 2.9[1] Table 3-2 UEFI Image Types. [1] https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf Story: 2008923 Task: 42521 Change-Id: Ibe02786609aa0de65115897d8f4a9b4f36c8aed2 (cherry picked from commit 10d18c41136cc645ee99d41acfb6031b9158e1fb)
* Merge "Software RAID: RAID the ESPs" into stable/wallabyZuul2021-06-012-126/+117
|\
| * Software RAID: RAID the ESPsArne Wiebalck2021-05-112-126/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For software RAID in UEFI mode, we create ESPs on all holder disks and copy the bootloader there. Since there is no mechanism to keep the ESPs in sync, e.g. on kernel upgrades or when kernel parameters are updated, the ESPs will get out of sync eventually. This may lead to a situation where a node boots with outdated parameters or does not have any of the installed kernels in the boot menu anymore. This change proposes to RAID the ESPs. While the UEFI firmware will find an ESP partition (one leg of the mirror), the node will see an md device and all subsequent updates will go to all member disks. Also, remove the source ESP after copying in order to avoid mount confusion (same UUID!). Story: #2008745 Task: #42103 Change-Id: I9078ef37f1e94382c645ae98ce724ac9ed87c287 (cherry picked from commit c2d04dc1566bb947d0e6afd040b82be55c925b11)
* | Limit qemu-img execution arenasJulia Kreger2021-05-271-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qemu-img attempts to launch multiple threads by default *and* attempts to have multiple memory allocation arenas to operate from. While multithreading can be good for performance, this pattern and the memory footprint for process launch and dependencies can turn the memory footprint for a cirros image conversion (16MB) into 1.2GB of memory being asked for by the qemu-img tool. In order to limit this impact, as the default number of arenas is governed by the number of CPUs times the number 8, it seems reasonable to lower this to a more reasonable number which also helps keep our possible memory footprint from being exceeded. NOTE: This change is largely different than the original change as an intermediate change converted write_image.sh to python. As it is unlikely for us to backport the intermediate change, it is logical for us to just modify the original script. Otherwise the release note is ultimately what is backported for release note tooling continutity. Change-Id: I71a28ec59ec31c691205eb34d9fcab63a2ccb682 Story: 2008928 Task: 42528 (cherry picked from commit 9e4c7052a2fd9aac03858db696bf1ea9487f15e6)
* | Fix NVMe Partition image on UEFIJulia Kreger2021-05-262-1/+45
|/ | | | | | | | | | | | | | | | | | | | | | | | The _manage_uefi code has a check where it attempts to just identify the precise partition number of the device, in order for configuration to be parsed and passed. However, the same code did not handle the existence of a `p1` partition instead of just a partition #1. This is because the device naming format is different with NVMe and Software RAID. Likely, this wasn't an issue with software raid due to how complex the code interaction is, but the docs also indicate to use only whole disk images in that case. This patch was pulled down my one RH's professional services folks who has confirmed it does indeed fix the issue at hand. This is noted as a public comment on the Red Hat bugzilla. https://bugzilla.redhat.com/show_bug.cgi?id=1954096 Story: 2008881 Task: 42426 Related: rhbz#1954096 Change-Id: Ie3bd49add9a57fabbcdcbae4b73309066b620d02 (cherry picked from commit fe825fa97ed1f3c9fa8b1461b63ab133fec20b72)
* Merge "Fix getting memory size in some lshw output" into stable/wallabyZuul2021-05-033-7/+201
|\
| * Fix getting memory size in some lshw outputZane Bitter2021-04-303-7/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a regression in lshw introduced by https://github.com/lyonel/lshw/pull/60, there are some versions in the wild that do not return sizes for memory banks <32GiB. In those cases, work around the problem by looking at the top-level size (if available) to find the total size. Previously we assumed that we only needed the top-level size when there was no list of memory banks. The issue is fixed upstream by https://github.com/lyonel/lshw/pull/65, but the erroneous patch is still present in the lshw-B.02.19.2-5.el8 package in CentOS 8.4 and 8.5. Change-Id: I6eb5981d28b9ae368239af0c1d0ec32ff79d95b3 Story: #2008865 Task: 42395 (cherry picked from commit ed791d97786f4ed37bf7b9f18eac8e2af46c3766)
* | Fix missing data in log messagesZane Bitter2021-04-301-2/+2
|/ | | | | Change-Id: I5d08deed86d79a7ea0b7a1625122af595037dab5 (cherry picked from commit c56cd4abc08840ba3670fbb024d3fe3e3b37209e)
* Always fall back to sysrq when power off failsDmitry Tantsur2021-04-292-10/+20
| | | | | | | | The line we're looking for is not there when IPA is in a container, at least for CentOS based containers. Just fall back to sysrq on errors. Change-Id: Ie4ee605ad9c6cda58808512a563247175859c71e (cherry picked from commit b395181b1b1381ff0802744807a981df8453bc40)
* Do not fail network interface collection on unsupported interface7.0.1Dmitry Tantsur2021-04-222-6/+14
| | | | | | | | Currently if one interface cannot be handled (e.g. it has empty MAC), the whole collection fails. Ignore unsupported interfaces instead. Change-Id: Ibdaad62b39c239d4f3fb3111c2fae9e31e877b28 (cherry picked from commit 1ab405b5095975c3cf1334477fd40f738f7105b8)
* Add a call to "udevadm settle" in write_image.shDerek Higgins2021-04-211-0/+1
| | | | | | | | | | After GPT and MBR are destroyed systemd-udevd gets triggered which may hold /dev/sda open preventing qemu-img from writting its image. Story: 2008830 Task: 42312 Change-Id: I6105192a16fcb7f6898910e8d0ab824d731d491d
* Capture the early loggingJulia Kreger2021-04-083-2/+36
| | | | | | | | | | | | _early_log prints to stdout, which is fine in some cases, however in other cases it gets lost in the shuffle of process launch by things like systemd. Lets try to save everything, and re-log it so it is easy to debug early issues. Change-Id: I334a9073d17cccec4c669fae82edc3e388debc5c (cherry picked from commit df418984f037856813b6bc5e495ef602a6737ee3)
* Fix incorrect lsblk tag and add a virtual media jobDmitry Tantsur2021-03-302-16/+18
| | | | | | | | | | | Follow-up to 8dd6589e66d03e45e1d510601da9531a30842cff: PATH is not a valid lsblk tag, we need to use KNAME with -p flag. Also add a vmedia job to avoid breakages in the future. It's added non-voting because we have a deadlock with this change: https://review.opendev.org/c/openstack/ironic/+/783722 Change-Id: Ifffeac9c1c4d394526d655eaa14c9fe7bd3a1e5e
* Merge "Validate vmedia for vmedia usage"Zuul2021-03-292-61/+307
|\
| * Validate vmedia for vmedia usageJulia Kreger2021-03-292-61/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Virtual media devices based logic needs to be guarded from being used or considered based upon if the machine actually booted from virtual media, or not. At the same time, actual devices need to be checked in order to make sure they align with what we expect in order to prevent consideration of content which should not be leveraged. Change-Id: If2d5c6f4815c9e42798a2d96d59015e1b1dbd457 Story: 2008749 Task: 42108
* | Do not permit IPA standalone to be enabled by confJay Faulkner2021-03-252-7/+1
|/ | | | | | | | | | IPA standalone mode is a developer-only option, and if enabled accidentally on a production agent could cause undesired behavior. Developers who need this behavior should build a purpose-built agent, with standalone hardcoded to True in cmd/agent.py. Change-Id: Icc67dbe15acbbf6fee886f274d2169a0769a5053
* typo chanages -> changesBernd Mueller2021-03-241-1/+1
| | | | Change-Id: Ifb75a5f6f01bd98011464eb05f98d8db001dcd54
* Refactor: use mounted from ironic-libDmitry Tantsur2021-03-232-186/+53
| | | | Change-Id: I0b597ddbc71c133abe6c0acfd8f49e3af4e896bb
* Fix root UUID for streamed partition imagesSteve Baker2021-03-192-1/+15
| | | | | | | | | | | | | | The root UUID changes after a streamed partition image is written to the block device, causing later deployment failure when assuming the old UUID. This change updates the root UUID after streaming the partition image is complete. This issue may have been missed in local testing because deploying the same image repeatedly will result in stable root UUID across runs. Change-Id: Ice4630c16fc216980488d1427f3b02e1b8a417fa
* Check the base device if the read-only file cannot be readBob Fournier2021-03-092-2/+32
| | | | | | | | | | | For some drives, the partition e.g. `/dev/sda1` will not have the 'ro' file which can result in a metadata erasure failure but the base device (`/dev/sda`) will have this file. Add an additional check for the base device. Change-Id: Ia01bdbf82cee6ce15fabdc42f9c23036df55b4c5 Story: 2008696 Task: 42004
* Merge "Remove default parameter from execute"Zuul2021-03-034-31/+18
|\
| * Remove default parameter from executeRiccardo Pittau2021-03-024-31/+18
| | | | | | | | | | | | | | | | | | The param check_exit_code from the processutils extension execute has default already at [0] See: https://opendev.org/openstack/oslo.concurrency/src/branch/master/oslo_concurrency/processutils.py#L214 Change-Id: Iedff5325e0737556d5eb3da601c984ddfc633873
* | Merge "Increase the memory limit for qemu-img"Zuul2021-03-021-2/+2
|\ \ | |/ |/|
| * Increase the memory limit for qemu-imgDerek Higgins2021-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We appear to be bumping up against this limit when deploying RHCOS images(currently 977MB). Curiously the problem isn't happening all the time but increasing the limit eliminates it. This limit was intruduced to guard against a malicious image allocating an arbitrary amount of memory. Nothing else runs on hosts when IPA is running so we should be ok bumping up the limit. Story: #2008667 Task: #41955 Change-Id: I9405995915a874b00b7177c9642c5469d05d66a8
* | Remove nvme-cli warning and delay on nvme-formatJacob Anders2021-03-022-3/+3
|/ | | | | | | | | | This change adds '-f' flag to nvme-cli calls during NVMe Secure Erase. This removes nvme-cli output warning that the device is about to be irreversibly deleted as well as the related 10 second delay which is pointlessly increasing NVMe cleaning time. Story: 2008290 Change-Id: I7b7b8b7d4f643b07d5c9dcf7ec35cf7ebedf44d1
* Merge "Use try_execute from ironic-lib"Zuul2021-03-013-62/+47
|\
| * Use try_execute from ironic-libRiccardo Pittau2021-02-253-62/+47
| | | | | | | | | | | | Also adapt unit tests Change-Id: I37d050877daabc9dc0a5821cf20a689652b26f34
* | Allow clean_configuration to run against full-device arraysMohammed Naser2021-02-273-0/+50
|/ | | | | | | | | | | | At the moment, it is not possible for Ironic to clean up a RAID array that is built from an entire device. This patch allows it to do so by overriding the behaviour of attempting to find the device name if the device names does not end with a number and is a real block device. Story: #2008663 Task: #41948 Change-Id: I66b0990acaec45b1635795563987b99f9fa04ac7
* Merge "New deploy step for injecting arbitrary files"Zuul2021-02-226-0/+773
|\
| * New deploy step for injecting arbitrary filesDmitry Tantsur2021-02-166-0/+773
| | | | | | | | | | | | | | | | | | This change adds a deploy step inject_files that adds a flexible way to inject files into the instance. Change-Id: I0e70a2cbc13744195c9493a48662e465ec010dbe Story: #2008611 Task: #41794
* | Merge "Add support for using NVMe specific cleaning"Zuul2021-02-193-8/+638
|\ \
| * | Add support for using NVMe specific cleaningJacob Anders2021-02-183-8/+638
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support for utilising NVMe specific cleaning tools on supported devices. This will remove the neccessity of using shred to securely delete the contents of a NVMe drive and enable using nvme-cli tools instead, improving cleaning performance and reducing wear on the device. Story: 2008290 Task: 41168 Change-Id: I2f63db9b739e53699bd5f164b79640927bf757d7
* | | Merge "Move some raid specific functions to raid_utils"Zuul2021-02-184-103/+213
|\ \ \
| * | | Move some raid specific functions to raid_utilsRiccardo Pittau2021-02-174-103/+213
| |/ / | | | | | | | | | | | | | | | | | | To reduce size of the hardware module and separate the raid specific code in raid_utils, we move some functions and adapt the tests. Change-Id: I73f6cf118575b627e66727d88d5567377c1999a0
* | | Fixes local boot for partition imageskartikeyaj02021-02-171-1/+1
|/ / | | | | | | | | | | | | | | | | | | IPA is not properly checking if the root partition is already mounted. Device is being passed to os.path.ismount() instead of the mount point. Story: 2008631 Task: 41839 Change-Id: I37a6e7e6bbe0bbbb0317c6e55bb822dafe7cce20
* | Remove samples from the hardware test moduleRiccardo Pittau2021-02-122-887/+905
|/ | | | | | | They take a lot of space and tehy're mainly static data. Move them to a separate module that can also be shared with other tests. Change-Id: I9c76c014430d524da7fa331c922976d283b870c3
* Fix error message with UEFI-incompatible imagesDmitry Tantsur2021-02-102-21/+39
| | | | | | | | It's somewhat confusing at the moment, since we're trying to find a UEFI partition by UUID "None". Don't search for partition if we don't know its UUID, and provide a better error message. Change-Id: Ief874084132797a445ddae8009264712a05facfd
* Merge "Use variable for lsblk columns device info"Zuul2021-02-082-34/+42
|\
| * Use variable for lsblk columns device infoRiccardo Pittau2021-02-032-34/+42
| | | | | | | | | | | | | | | | Adjusted unit tests accordingly. Also removed redundant parenthesis. Change-Id: I8e2cac5172f009d5204f83bd83e1f27cfd721f09
* | Mock tests to return bios boot modeIury Gregory Melo Ferreira2021-02-031-0/+3
|/ | | | | | | | When running IPA unit tests on machines configured with UEFI and GPT partition table, some tests will fail. Change-Id: I155a47242b526b8f243a5e94bc14da8431f1ab91
* Fix UEFI boot entry creation for aarch64Xinliang Liu2021-01-271-1/+2
| | | | | | | | | | | | | | | | | | Diskimage-builder installs grub with option '--removable'[1], thus for aarch64 no 'grubaa64.efi' file in efi directory only got 'BOOTAA64.EFI': linaro@bm-ubuntu:~$ tree /boot/efi /boot/efi └── EFI └── BOOT └── BOOTAA64.EFI 2 directories, 1 file [1]: https://github.com/openstack/diskimage-builder/blob/8f12d9530ed79359fb988688caadfa6dc318f7a5/diskimage_builder/elements/bootloader/finalise.d/50-bootloader#L158 Task: #41698 Story: #2008560 Change-Id: I9fc55c068ea980beae273411db9d3568eec25eb8
* Remove lldp-timeout supportKaifeng Wang2021-01-152-9/+1
| | | | | | The kernel parameter lldp-timeout was deprecated removed in this patch. Change-Id: I98da49e61d9ed3236cc495d1ab351eba0931473b
* Merge "Handle situation when a configdrive is already mounted"6.5.0Zuul2020-12-212-24/+92
|\
| * Handle situation when a configdrive is already mountedDmitry Tantsur2020-12-162-24/+92
| | | | | | | | | | | | | | Glean mounts the configdrive and does not unmount it afterwards. If a mount point already exists, just use it. Change-Id: Ia62279afbb9fd9770864942dc40629b69ae8f4ae