2263 Commits

Author SHA1 Message Date
Riccardo Pittau
23e67b5fea Re-read the partition table with partx -a, part 2
Use add instead of update to re-read the partition table with partx.

See [1] for more details.

Co-authored-by: Arne Wiebalck <arne.wiebalck@cern.ch>

[1] https: //opendev.org/openstack/ironic-python-agent/commit/dc8c1f16f9a00e2bff21612d1a9cf0ea0f3addf0

Change-Id: I2336e22dadc790cfbde87904612fcaa3b8c501db
2021-11-09 13:03:14 +01:00
Arne Wiebalck
dc8c1f16f9 Re-read the partition table with partx -a
Re-read the partition table with 'partx -a', rather than 'partx -u'.

This should fix an timing issue where the bootloader installation
fails to mount the EFI partition from a whole disk image since it
is not yet aware of the new partitions (observed with both, the
iscsi and the direct deploy interface).

Change-Id: If5da3075e813ae01df3decf8f0647aba111b0515
2021-11-06 13:43:48 +01:00
Zuul
0b56cca7f0 Merge "Fix UEFI record regex" 2021-11-05 14:59:35 +00:00
Julia Kreger
c5268bbdbb Fix UEFI record regex
I accidently put colons on the test data and remembered taking the
colon character out of the regex I was working on, but apparently
left it in, and accounted for the active entry indicator flag
which appears to have inconsistent support across vendors.

The regex has been fixed, and a test added from a Lenovo SR650
which has some additional string entry data in the UEFI output
which may separate entries.

Change-Id: I1f67b0fb1f645fa82e98bd7c7bba3ffc7755cc74
2021-11-04 09:45:25 -07:00
Zuul
a4b73058ee Merge "Always include the oslo_log log file in ramdisk logs" 2021-11-04 15:14:33 +00:00
Zuul
65827b3015 Merge "Stop requiring mocking of utils.execute if ironic-lib execute is mocked" 2021-11-03 14:19:52 +00:00
Julia Kreger
67eddfa7e3 Delete EFI boot entry duplicate labels first
Some firmware seems to take an objection with EFI nvram
entries being deleted after one is added, resulting in the
entire entry table being reset to the last known good state.

This is problematic, as ultimately deployments can time out
if we previously booted with Networking, and the machine, while
commanded to do other wise, reboots back to networking regardless.

We will now delete entries first, before proceeding.

Additionally, for general use, this pattern may serve the
community better by avoiding cases where we would have
previously just relied upon efibootmgr[0] to warn us of duplicate
entries.

[0]: 103aa22ece/src/efibootmgr.c (L228)

Change-Id: Ib61a7100a059e79a8b0901fd8f46b9bc41d657dc
Story: 2009649
Task: 43808
2021-11-01 06:59:26 -07:00
Dmitry Tantsur
2cedaa53c2 Always include the oslo_log log file in ramdisk logs
Even if journald is present, there is no guarantee that IPA logs there
(this is the case in container-based ramdisks).

Change-Id: Iceeab0010827728711e19e5b031ccac55fe1efde
2021-10-28 18:32:40 +02:00
Dmitry Tantsur
b360214cf2 Stop requiring mocking of utils.execute if ironic-lib execute is mocked
Based on unit tests, this was done intentionally, but I don't see
reasons for that. It makes refactoring much harder, because sometimes
you need to mock both execute functions and test them separately.

In the end, utils.execute should be removed.

Change-Id: I5a9c694ebe626c54f219d4870eab0a592777518d
2021-10-27 14:24:00 +02:00
Zuul
c824dda7a5 Merge "Fix error messages in burnin code" 2021-10-26 19:50:15 +00:00
Dmitry Tantsur
9a8c6a831a Fix error messages in burnin code
Change-Id: Ib920b6f8da2c2c9d72dbb8bbd8915bde767bddd2
2021-10-26 11:33:01 +02:00
Dmitry Tantsur
8a66978666 Respect global parameters when downloading a configdrive
* Use the same TLS parameters as everything else
* Respect image_download_connection_timeout
* Do not ignore HTTP errors

Change-Id: I84f8021f731186d82e44ac3d4ef2d12df13f830a
2021-10-20 15:11:16 +02:00
Arne Wiebalck
333ed70c94 Assert EFI part UUID is not None before editing fstab
The EFI partition UUID may be None and this will break
the fstab editing. While this is not necessarily fatal when
instantiating a node, it creates an exception at the end of
bootloader installation, so only attempt to add a line to
fstab when the UUID is not None.

Change-Id: I68799980e67c05afe4ca68ca9733605dd166d54d
2021-10-08 08:35:29 +02:00
Arne Wiebalck
9d707e9f4b Software RAID: Call udev_settle before creation
This patch fixes a race during software RAID creation:
we create the partition with parted, the kernel then
notifies udev, but we need to wait for udevd to create
the device files before calling mdadm to create the
md device.

Credits to jcosmao for finding this.

Change-Id: I642f28acc351cf50263e37dfbc8468bf59de2cc5
2021-10-05 11:42:49 +02:00
8d901ff0dc Add Python3 yoga unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for yoga.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: Ia08ee369e2925b2c313dcfaa8975fe023ec1c07a
2021-09-22 18:38:17 +00:00
1665abca04 Update master for stable/xena
Add file to the reno documentation build to show release notes for
stable/xena.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/xena.

Sem-Ver: feature
Change-Id: If28b1df9c76469062e6d9ce28edcf3026fdbfbaa
2021-09-22 18:38:15 +00:00
Zuul
47a7fb5ff7 Merge "Trivial: minor fixes in error messages" 2021-09-09 01:02:18 +00:00
Dmitry Tantsur
cb836a29bf Trivial: minor fixes in error messages
Change-Id: I06b32c2eb576520cddff88074e4619070731017d
2021-09-07 14:41:38 +02:00
Zuul
2acdf3cd17 Merge "Trivial: better debugging in list_all_block_devices" 2021-09-03 13:20:11 +00:00
Zuul
667e83da0e Merge "Check the network burnin roles and partner" 2021-09-02 12:43:39 +00:00
Dmitry Tantsur
07ff3b8bbc Trivial: better debugging in list_all_block_devices
One debug message only specified "Skipping" without any details.
Another did not log the whole line from lsblk. Fix both.

Change-Id: I9f8f4edad88ba2df5abc6a45a74ebdb3c7afcf97
2021-08-27 12:19:28 +02:00
Zuul
438a1f4445 Merge "Move loading of IPMI module loading to a single point" 2021-08-23 16:14:14 +00:00
Zuul
c616b4dba3 Merge "Output verbose info from efibootmgr" 2021-08-11 11:08:34 +00:00
Zuul
71f54b7f98 Merge "Increase version of hacking and pycodestyle" 2021-08-11 10:02:24 +00:00
Arne Wiebalck
a86e21e4f4 Check the network burnin roles and partner
The network burnin roles are 'reader' and 'writer'. Raise an error
if the role is not provided or if the role is unknown. Equally,
raise an error if the partner is not provided.

Change-Id: I6259a7b0d15d62e68b1dc27f0cb511f8563c02ce
2021-08-10 16:37:40 +02:00
Zuul
91f0248164 Merge "Add lower-constraints job to current development branch" 2021-08-10 07:51:52 +00:00
Zuul
ab026da95b Merge "Expose BMC MAC address in inventory data" 2021-08-08 17:21:25 +00:00
Jonas Schäfer
6441db61ce Move loading of IPMI module loading to a single point
This means we do not have to rely on modprobe idempotency as
much and it's less code duplication, which is always nice.

Signed-off-by: Jonas Schäfer <jonas.schaefer@cloudandheat.com>

Change-Id: I996aba47bc54309e15e7d56e4a96b23b8deb5c9c
2021-08-06 13:14:45 +02:00
Jonas Schäfer
61af712fe5 Expose BMC MAC address in inventory data
This exposes the MAC address of the first LAN channel with an assigned
IP address in the inventory data. This is useful for inventory
processes where the asset number is not discoverable from the software
side: the BMC MAC is going to be unique (at least within an
organization).

Change-Id: I8a4bee0c25743befd7f2033e4e0cba26895c8926
2021-08-06 13:14:45 +02:00
Riccardo Pittau
22b538d61c Add lower-constraints job to current development branch
The lower-constraints test was removed because of an issue where pip
could not correctly determine the required packages versions to install,
ending in an almost infinite loop that would end up in timeout, failure,
and general mayhem.
Recently the issue has been fixed and, if properly configured, the
lower-constraints test can provide good indication of which minimum
versions are required to support the current code.
This patch adds the test back to the current development branch, and it
runs only on master.
The lower-constraints file will stay in the future stable branches.

Change-Id: Ic9cef3e56266c6e9de0936b5f113e8b38d705a9b
2021-08-04 11:35:51 +02:00
Derek Higgins
caf695f70a Output verbose info from efibootmgr
When debugging boot manager problems it can be advantageous to
see all the full entries rather then just their labels.

Change-Id: I6a1bb78acaf5a4284727bdf533d4be6db2099f50
2021-08-03 12:01:17 +00:00
Riccardo Pittau
efbbc86f53 Increase version of hacking and pycodestyle
Fix H904 "Delay string interpolations at logging calls" errors

Change-Id: I331808d0132094faf739998a6984440787d3ebf8
2021-07-30 14:34:33 +02:00
Zuul
9b42b08edd Merge "Force immediate NTP time sync with chronyd at IPA startup" 2021-07-20 09:38:59 +00:00
Zuul
21c24abe61 Merge "Catch ismount not being handled" 2021-07-16 14:20:56 +00:00
Arne Wiebalck
5531d5cee7 Force immediate NTP time sync with chronyd at IPA startup
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
2021-07-16 10:28:31 +02:00
Arne Wiebalck
cacdd9bab3 Burn-in: Add network step
Add a clean step for network burn-in via fio. Get basic
run parameters from the node's driver_info.

Story: #2007523
Task: #42385

Change-Id: I2861696740b2de9ec38f7e9fc2c5e448c009d0bf
2021-07-13 11:36:31 +02:00
Julia Kreger
e5d552474b Catch ismount not being handled
While investigating another grub issue, I was confused by the path
taken in the logs reported, and noticed that on a ramdisk, we might
not actually have a valid response to os.path.ismount, I'm guessing
depending on what in memory filesystem is in use while also coupled
with attempting to check a filesystem.

Adds a test to validate that exceptions raised on these commands
where this issue can be encountered, are properly bypassed, and also
adds additional logging to make it easier to figure out what is
going on in the entire bootloader setup sequence.

Change-Id: Ibd3060bef2e56468ada6b1a5c1cc1632a42803c3
2021-06-29 14:14:52 -07:00
Zuul
20e145e4da Merge "Only mount the ESP if not yet mounted" 2021-06-25 15:25:33 +00:00
Arne Wiebalck
27568204ae Only mount the ESP if not yet mounted
Check if the ESP is already mounted before attempting to mount it
for the bootloader installation.

Change-Id: Ifd738b2c5663f1a211d7e13b5ba386be631d8db1
2021-06-21 12:10:54 +02:00
Dmitry Tantsur
b605943796 Coalesce heartbeats
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
2021-06-18 17:19:30 +02:00
Zuul
8afc176c28 Merge "Reduce logging verbosity when collecting logs" 2021-06-14 09:22:53 +00:00
Zuul
12dbe3ddb7 Merge "Remove lower-constraints job" 2021-06-11 15:19:58 +00:00
Dmitry Tantsur
2fcf35e56d Reduce logging verbosity when collecting logs
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
2021-06-11 16:04:59 +02:00
likui
5473700f9c Remove lower-constraints job
As discussed during the upstream ironic community meeting on
Monday Dec 14 2020, the lower-constraints job is being removed.

Change-Id: I9392117ccdef8fc6ff3d95d667107d752459cb24
2021-06-11 15:36:21 +08:00
Julia Kreger
2fab70c36b Utilize CSV file for EFI loader selection
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>
2021-06-10 11:23:14 -07:00
Zuul
32e3b435bc Merge "Burn-in: Add disk step" 2021-06-07 12:46:15 +00:00
Zuul
434de569e6 Merge "Ignore efi grub2-install failure" 2021-06-07 09:47:12 +00:00
Zuul
6be440eb3b Merge "Refactor: use convert_image from ironic_lib" 2021-06-04 16:35:00 +00:00
Steve Baker
a057be7dad Ignore efi grub2-install failure
Recent releases of redhat grub2 will always fail when installing to
EFI paths, to encourage a transition to the signed shim bootloader.

Partition image deploys avoid calling grub2-install with the
preserve-efi-assets functions. Deploying whole disk images doesn't
require grub2-install. This leaves whole disk images installed onto
softraid devices, which still attempts to call grub2-install.

This change will still attempt to run grub2-install in this
one remaining case, but will ignore any failure.

A future enhancement can avoid calling grub2-install entirely so that
non-redhat secure-boot capable images can keep their signed
bootloaders.

Story: 2008923
Task: 42521
Change-Id: If432ef795d64d76442d739eb4f7d155ff847041e
2021-06-04 10:03:55 +12:00
likui
e27cdb3673 Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I434a6330defbc5cc65788f4d64b7f2d4d2b37db7
2021-06-03 16:51:06 +08:00