summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/drivers/modules/test_ipxe.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of nomodeset by defaultJulia Kreger2023-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | The troubleshooting kernel command line option nomodeset unfortunately changes the way framebuffer interactions work with graphics devices which in some cases can result in kernel memory to be used for graphics updates. When this happens on some specific hardware common in rack mount servers with baseboard management controllers, this can cause the memory bus to become locked for a brief time while the graphics update is occuring. This locked memory bus means disk IO can become blocked, and network cards can overflow their buffers resulting in packet loss on top of the latency incurred by the graphics update executing. As such, we've removed the nomodeset option from default usage and added a note describing its removal to the documentation along with a release note. Change-Id: I9084d88c3ec6f13bd64b8707892758fa87dd7f86
* Finally remove support for netboot and the boot_option capabilityDmitry Tantsur2022-08-021-317/+11
| | | | | | | | | | | Instance network boot (not to be confused with ramdisk, iSCSI or anaconda deploy methods) is insecure, underused and difficult to maintain. This change removes a lot of related code from Ironic. The so called "netboot fallback" is still supported for legacy boot when boot device management is not available or is unreliable. Change-Id: Ia8510e4acac6dec0a1e4f5cb0e07008548a00c52
* Remove support for trusted bootDmitry Tantsur2022-07-181-31/+8
| | | | | | | It requires network booting and legacy boot. While the latter will be supported for a long time, the former is being removed. Change-Id: Ie48e51fa95ba2059bd3cca6b8968f475934a75e5
* Merge "Explicit parameter to distinguish partition/whole-disk images"Zuul2022-02-071-1/+1
|\
| * Explicit parameter to distinguish partition/whole-disk imagesDmitry Tantsur2022-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | Using kernel/ramdisk makes no sense with local boot, we need a better way. We already have an internal image_type instance parameter, let's make it public. Glance support will be added in the next patch. Change-Id: I4ce5f7a2317d952f976194d2022328f4afbb0258
* | Add additional ramdisk testsJulia Kreger2022-01-261-0/+58
|/ | | | | | | | | | Noticed we're missing some test coverage in regards to booting from ramdisks when I was investigating an issue which was reported against wallaby. Adds tests which *should* catch the issue I'm chasing in wallaby. Change-Id: I4965d0cc3966c50fa0485b5e194248dd2072f7a8
* Ensure desired permissions on all written pxe filesSteve Baker2021-12-101-4/+4
| | | | | | | This change ensures all files written for pxe boot have permissions determined by the [pxe]file_permission config option. Change-Id: I1bc24e3871bae3ce070e7abe85fc4c48e844c317
* Add an option to create inspector-compatible boot.ipxeDmitry Tantsur2021-11-151-2/+4
| | | | | | | | | | | Currently the default boot.ipxe is not suitable for ironic-inspector in a standalone configuration. This change adds a new option [pxe]ipxe_fallback_script that makes boot.ipxe fall back to the provided script. Story: #2009294 Task: #43982 Change-Id: Id5547885e75beafb4423e9e2056c79c54b286275
* Yoga: Change default boot mode to uefiJulia Kreger2021-10-041-19/+212
| | | | | | | | Change the default boot mode to UEFI, as discussed during the end of the Wallaby release cycle and previously agreed a very long time ago by the Ironic community. Change-Id: I6d735604d56d1687f42d0573a2eed765cbb08aec
* Add ipxe ramdisk kernel append param testJulia Kreger2021-07-091-0/+54
| | | | | | | | While investigating a bug report, I noticed we didn't explicitly test passing arguments in with the ipxe interface and a ramdisk, and given the issue reported was precisely that, I wrote a test. Change-Id: I801b71d381a69e7b8678b9e60ff36dda0ae3f7fb
* Ramdisk: do not require image_sourceDmitry Tantsur2021-06-291-5/+7
| | | | | | | | | Because of the way validation works, the ramdisk deploy interface currently requires an image_source in addition to kernel/ramdisk. After 1d6441cc347cfe984721f34ebb0cd64fd9e4d876 it is no longer necessary, and this change removes this requirement. Change-Id: I59996fac059dade0ef186598be1e8971e073eb04
* Avoid unnecessary validation in boot interfacesDmitry Tantsur2021-05-041-9/+28
| | | | | | | | | | | | | | | | | | Interfaces should only validate values they're going to use. Boot interfaces do not care about image properties when local boot is used (which is the default), so they shouldn't validate them. The deploy interface has to provide validation for images. This change fixes PXE, iPXE and redfish-virtual-media, although other boot interfaces may need a similar change. We also need to refactor handling instance_info in deploy_utils, but that can wait until the iSCSI deploy removal. Also refactor unit tests for redfish-virtual-media. Story: #2008874 Task: #42418 Change-Id: Ida21f21d6435c0d7fa46cb5b1161f034ad8956ee
* Add anaconda support in the pxe boot driverArun S A G2021-03-231-5/+10
| | | | | | | | | | | | | | | To prepare for booting anaconda we need to generate a kickstart file from the kickstart template and pass it to the installer as a kernel command line argument (inst.ks). Similarly the second stage of the installer (stage2) needs to fetched and it's location needs to be passed as a kernel command line argument (inst.stage2) This change also adds 'boot_anaconda' target to pxe_config.template and ipxe_config.template and renders that target correctly. The pxe configuration will automatically switch to boot_anaconda target when the boot_option is 'kickstart'. Change-Id: I3ffe5a60684cdefe51c7a0a47acc1acedbb49145
* Apply force_persistent_boot_device to all boot interfacesDmitry Tantsur2021-02-011-74/+0
| | | | | | | | | For some (likely historical) reasons we only use it for PXE and iPXE, but the same logic applies to any boot interface (since it depends on how the management interface and the BMC work, not on the boot method). This change moves its handling to conductor utils. Change-Id: I948beb4053034d3c1b4c5b7c64100e41f6022739
* Common framework for configuring secure bootDmitry Tantsur2021-01-191-2/+11
| | | | | | | | | | 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
* iPXE ISO Ramdisk bootingJulia Kreger2020-07-161-0/+70
| | | | | | | | | Adds an iPXE interface to boot via a virtual media ISO as if it was virtual media. Story: 2007644 Task: 39823 Change-Id: Ie7971692758f3a5421f0826fdaf3d2366f652236
* Provide a path to set explicit ipxe bootloadersJulia Kreger2020-07-071-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I did something stupid when started driving forth the split of ipxe from the pxe interface: I didn't think about the need to actually separate bootloaders. In part, because the use case was a mixed Power8/Power9 and x86 cluster. Mainly because the Power hardware does not honor or care about the bootfile name provided over DHCP. The firmware knows how to read the PXELINUX boot file format and the machines are able to boot from there. Where this all goes sideways is when: * Enabled boot interfaces are set to ipxe,pxe * No default boot interface is set * Node is created without a default for x86 hardware. * Node uses ipxe boot_interface, and creates files under /httpboot * bootfile transmitted via DHCP is pxelinux.0. Fun right? The simple workaround for the power user is to just define the iPXE loader, or maybe use UEFI. But that is neither here nor there, this is still a bug and a possible use case is GRUB2 via PXE and iPXE. Not that would really work via ipxe, but hopefully people get the idea. The solution kind of seems clear, duplicate configuration and fallback if not defined. Story: #2007003 Task: #40282 Change-Id: I4419254c23095929e52a0fda11789f2f5167dc6b
* Networking boot fallback for local bootDmitry Tantsur2020-06-191-0/+35
| | | | | | | | | | | | Adds an ability to generate network boot templates even for nodes that use local boot via the new ``[pxe]enable_netboot_fallback`` option. This is required to work around the situation when switching boot devices does not work reliably. Depends-On: https://review.opendev.org/#/c/736191/ Change-Id: Id80f2d88f9c92ff102340309a526a9b3992c6038 Story: #2007610 Task: #39600
* Enforce autospec in test_ipxe and test_pxeRiccardo Pittau2020-06-051-4/+4
| | | | | | And remove corresponding H210 filters. Change-Id: I074eac9088f4739f540b57d07fc487cb87194599
* Merge "Remove [conductor]api_url"Zuul2020-05-081-1/+0
|\
| * Remove [conductor]api_urlKaifeng Wang2020-05-011-1/+0
| | | | | | | | | | | | It was deprecated long before. Change-Id: I05d8a90dbf6e92ef230b1a9624c6816fc96c6a7f
* | Switch to unittest mockIury Gregory Melo Ferreira2020-04-301-1/+1
|/ | | | | | | Python3 have a standard library for mock in the unittest module, let's drop the mock requirement and switch tests to unittest mock. Change-Id: I4f1b3e25c8adbc24cdda51c73da3b66967f7ef23
* Merge ""dual stack" support for PXE/iPXE"Zuul2020-04-211-3/+16
|\
| * "dual stack" support for PXE/iPXEJulia Kreger2020-04-131-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds functionality for dual stack capabilities and automatic population to neutron with the correct response based upon the IP version of the provisioning/cleaning/rescue or tenant ports. This was origianlly intended to be separated from removing the need for [pxe]ip_version, however the resulting code changes from doing both this and making ironic support dual stacks touched the same tests and some of the same code, so combined is simpler. Change-Id: If7a296001e204ae0c9a49495731052ab33379628
* | Change [deploy]/default_boot_option to localJulia Kreger2020-04-151-0/+10
|/ | | | | | | | | | | | | | The default value of "netboot" was introduced to this configuration variable as part of commit 93f947c852409af2c56a499428b09ff69ab345a1 in Ocata release. This patch changes the default value of configuration parameter '[deploy]/default_boot_option' and devstack variable 'IRONIC_DEFAULT_BOOT_OPTION' to 'local'. Change-Id: I9bf56a7088281bbe20b8b6c2e47c6ab6559bfea4 Story: #1619339 Task: #10505
* Fix the remaining hacking issuesDmitry Tantsur2020-03-311-6/+6
| | | | | | | | | | 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
* Finalize removal of ipxe_enabled optionKaifeng Wang2020-02-211-7/+1
| | | | | | | | | | | Remove the dynamically registered ipxe_enabled option and say goodbye. Further extracts common bits to the PXEBaseMixin, tuning tests here and there. Story: 2007003 Task: 37779 Change-Id: I7c1b2a984d45bd63b4e95b62ce02960924c2ce17
* Start removing ipxe support from the pxe interfaceKaifeng Wang2020-02-211-1/+2
| | | | | | | | | | This patch starts removing codes related to ipxe support from the pxe interface, and extract common logic to the PXEBaseMixin. Story: 2007003 Task: 37779 Change-Id: Ia621f38d9b6c4570ba6a62ddb8c72244ff3fe33b
* Refactoring: rename agent_base_vendor to agent_baseDmitry Tantsur2020-02-191-2/+2
| | | | | | | There is no longer a common vendor passthru, so the current name does not make much sense. Change-Id: I1610e54774826de369be0fef88e98bdf3f64ae1d
* Fix ipxe interface to perform ipxe boot without ipxe_enabled enabledKaifeng Wang2020-02-031-3/+3
| | | | | | | | | | When ipxe hardware interface is in use, the node should always be boot with iPXE disregards the deprecated configuration option [pxe]ipxe_enabled. Story: 2007003 Task: 37779 Change-Id: Ia658ddc966e13a7ce973eccd9c42e40a3da406f4
* Merge "Wire in in-band inspection for PXE boot and neutron-based networking"Zuul2019-11-261-0/+13
|\
| * Wire in in-band inspection for PXE boot and neutron-based networkingDmitry Tantsur2019-11-211-0/+13
| | | | | | | | | | | | | | | | | | This change implements in-band inspection support for PXE and iPXE boot interfaces and all in-tree network interfaces. Story: #1528920 Task: #23184 Change-Id: I470d55add73bae47a2755cde93d4b1e1f30e94a7
* | Pass correct flags during PXE cleanup in iPXEBootVladyslav Drok2019-11-191-3/+6
|/ | | | | | | | | They were not handled correctly and ipxe-related configs were left after node tear down. Story: 2006907 Task: 37549 Change-Id: I1ee6727d2fc52619544e327a10a62ae8a7e6f7fe
* Correct handling of ramdisk_params in (i)PXE bootDmitry Tantsur2019-10-281-2/+2
| | | | | | | | | | | | | Currently only ipa-api-url is recognized there, since it's hardcoded in the templates. Anything else is silently ignored. This patch fixes it by wiring all provided options in pxe_append_params and dropping the hardcoded ipa-api-url (provided by agent deploy). Add some logging to make debugging such issues easier. Change-Id: I573cf99d52a6965d64c2ed7a87cf901c12ea3fec Story: #1528920 Task: #37255
* Refactoring: flatten the glance service moduleDmitry Tantsur2019-06-181-10/+7
| | | | | | | | The current structure is designed to support several major versions. However, we only support V2 and in the future will use openstacksdk to abstract away major version differences. Change-Id: I99bcb0650ac609ae9f0a8bcff70429eb4a3b7274
* Optionally preserve original system boot order upon instance deploymentArne Wiebalck2019-02-071-3/+61
| | | | | | | | | | | | | | | By default, Ironic makes persistent changes to the system boot order at the end of an instance deployment. This may not be desired in all cases, e.g. when DC policies require to leave the persistent system boot order unchanged. While keeping the persistent approach as the default, this patch proposes to extent the existing 'force_persistent_boot_device' field in the node's driver_info for (i)PXE in a way that allows to have all boot device changes to be non-persistent. Change-Id: If3a19f74fb0dfbcff2cde4cd5a8cc1edf5de3058 Story: #2004846 Task: #29058
* Merge "Fix test for 'force_persistent_boot_device' (i)PXE driver_info option"Zuul2019-02-011-21/+19
|\
| * Fix test for 'force_persistent_boot_device' (i)PXE driver_info optionArne Wiebalck2019-01-311-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The string used for the 'force_persistent_boot_device' field in the node's driver_info is split by an additional blank and hence doesn't set the option to be tested. In addition, the test condition tests a mostly independent call (which also explains why the test succeeds despite the incorrect option). This patch removes the incorrect test and introduces new ones to test the signature of prepare_ramdisk() which is the function in which 'force_persistent_boot_device' is actually used. Change-Id: I0b6a298837306fb8c6a46c13612b003dc62a7850
* | Fix iPXE boot interface with ipxe_enabled=FalseDmitry Tantsur2019-01-311-1/+2
|/ | | | | | | | | If ipxe_enabled=False, Ironic still tried to download images into the TFTP location, which could fail. This patch fixes it. Story: #2004905 Task: #29253 Change-Id: I5958eeb0d9de59a34145dd899354bf2a1a115dde
* Cleanup of remaining pxe focused is_ipxe_enabledJulia Kreger2018-10-251-13/+24
| | | | | | | | | After this cleanup, only one use of is_ipxe_enabled remains which is in the storage interface. That will be removed in a separate patchset that I have been working on. Change-Id: I625ac56122ac4dd17d0c9e7dacc4444301a88e75 Story: 1628069
* Fix DHCPv6 supportJulia Kreger2018-10-241-6/+12
| | | | | | | | | | | | | | Adds logic to handle the appropriate replies for DHCPv6 responses. The IPv6 nature was discovered while researching differences and finding that the field ID value changes between IPv4 and IPv6 DHCP clients, as DHCPv6 is purely booting from a URL. Change-Id: I63572bea9bfb150aaeb4708dfa57e71adf4f64ab Task: 9788 Story: 1744620 Story: 2003934
* Wrap up PXE private method to pxe_utils moveJulia Kreger2018-10-221-19/+18
| | | | | | | | | | Moves the remaining private method test case code to pxe_utils and updates tests to remove the temporary method remappings in pxe.py. Change-Id: Ic9ae2ef2802f1f17b213d5a196dde3b65981f0d6 Task: 23029 Story: 1628069
* ipxe boot interfaceJulia Kreger2018-10-161-0/+824
A long time ago, in a galaxy not so far away, the ironic comunity reached consensus that we should refactor the PXE interface such that we had separate PXE and iPXE interfaces. In looking at what it would take for something like a standalone deployment to have multiarchitecture support in their environment, it seems even more urgent and necessary that we begin to make this delineation. This is because while some ARM iPXE support exists, the binary is not a commonly shipped artifiact, so operators are largely only left with grubaa64.efi as their bootloader. A similar issue exists with ppc64le deployments where they must disable iPXE, as the ppc64le hardware expects reading a syslinux compatible file, similarlly no iPXE loader exists. To start this effort, we need to promote iPXE functionality to a dedicated interface, and remove the necessity of setting the [pxe]ipxe_enabled setting. Next steps, beyond this patch, would be to begin to tease out the common private method code in the underlying PXE interface that both the iPXE and PXE interfaces use, and appropriately relocate and refactor that code as necesary. During this process, we can create an [ipxe] configuration section, and migrate settings. Finally, once the deprecation cycle is complete, we will be able to remove the ipxe logic with-in the PXE interface. Change-Id: I392616417c48986e84e50a3ddc7567344bfe3571 Story: #1628069 Task: #10516