293 Commits

Author SHA1 Message Date
Bob Fournier
6e3f28d720 Bring up VLAN interfaces and include in introspection report
Add the ability to bring up VLAN interfaces and include them in the
introspection report.  A new configuration field is added -
``ipa-enable-vlan-interfaces``, which defines either the VLAN interface
to enable, the interface to use, or 'all' - which indicates all
interfaces.  If the particular VLAN is not provided, IPA will
use the lldp info for the interface to determine which VLANs should
be enabled.

Change-Id: Icb4f66a02b298b4d165ebb58134cd31029e535cc
Story: 2008298
Task: 41183
2020-11-20 10:17:00 -05:00
Zuul
4762aca077 Merge "Add clean step 'erase_pstore'" 2020-11-18 17:38:00 +00:00
Arne Wiebalck
92e26b01e9 Add clean step 'erase_pstore'
Add an automatic clean step to clean the Linux kernel's pstore.
The step is disabled by default.

Story: #2008317
Task: #41214

Change-Id: Ie1a42dfff4c7e1c7abeaf39feca956bb9e2ea497
2020-11-17 18:00:16 +01:00
Vladyslav Drok
3761a44800 Fix vendor info retrieval for some versions of lshw
There is one more place that relies on lshw json output being a dict,
so let's fix the function that gets the dict rather than places it is
being used in.

Change-Id: Ia1c2c2e6a32c76ac0249e6a46e4cced18d6093a9
Task: 39527
Story: 2007588
2020-11-16 15:25:12 +01:00
Zuul
c33b3fff66 Merge "Add UUID to BlockDevice object" 2020-11-11 21:42:51 +00:00
Vladyslav Drok
c7858d3cc8 Add UUID to BlockDevice object
It'd allow for example custom ansible playbooks to use UUIDs of the
introspected node's disks. In future it might also enable agent
to use UUID (or by_path value) to refer to a device instead of
name, as it happens currently.

Change-Id: Id00437d2295c39fb12f3c25a92b30b56a58eef13
2020-11-11 17:25:59 +00:00
Vladyslav Drok
448ded43fe Fix physical memory calculation with new lshw
It seems that fix Id5a30028b139c51cae6232cac73a50b917fea233 was
dealing with a different issue. According to the description
in the story, and the linked commit there, the problem is the
fact that output is changed from dictionary to a list (with just
one value supposedly?). This commit changes the isinstance call
to check if an output of lshw is a list, and if so, we just use
the first element of the list.

Story: 2007588
Task: 39527
Change-Id: I87d87fd035701303e7d530a47b682db84e72ccb9
2020-11-06 19:09:28 +01:00
Zuul
f52863a4d8 Merge "Updated Implementation of string interpolation delay on LOG messages" 2020-11-04 10:45:32 +00:00
ebagakis
35d412e9d5 Updated Implementation of string interpolation delay on LOG messages
This is a follow up to https://review.opendev.org/#/c/756300/

Change-Id: Ifba8a57b58d61ede169c60f6d51f224d134c7708
2020-11-03 15:27:27 +01:00
Arne Wiebalck
c7f6baf7f4 [trivial] Remove redundant list conversion
Follow-up to https://review.opendev.org/#/c/756300/

Change-Id: Ibc6c044e24dde82928f19a9b9a7eaf68be53fb0e
2020-10-13 08:29:53 +02:00
Zuul
80b0a9a132 Merge "Software RAID: Re-add missing devices" 2020-10-12 12:24:24 +00:00
Dmitry Tantsur
420ebc0d73 Do not silently swallow errors in the write_image deploy step
Calling join() does not raise, we need to explicitly check the result.

Change-Id: I81d3d727af220c2b50358edab8139f07874611f0
Story: #2008240
Task: #41083
2020-10-09 11:24:12 +02:00
Arne Wiebalck
253b4887d5 Software RAID: Re-add missing devices
Upon md device creation, component devices are sometimes removed
immediately again due to a "disk failure". The disks seem healthy,
though. This patch re-adds compoenent devices in such cases to
prevent that the md device will remain in a degraded state (which
would cause issues later, e.g. during ESP creation).

Story: #2008164
Task: #40914

Change-Id: I2ac7cb4a546de84686d5c3435e850c14b3f6c1d7
2020-10-06 14:00:57 +02:00
Zuul
99dee5067e Merge "Software RAID: Get component devices by md UUID" 2020-09-30 18:30:56 +00:00
Arne Wiebalck
044c64dbc0 Software RAID: Get component devices by md UUID
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
2020-09-29 17:08:40 +02:00
Arne Wiebalck
c7aec775ff Software RAID: Don't delete partitions too early
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
2020-09-28 10:35:12 +02:00
Zuul
11a87365fb Merge "Generate a TLS certificate and send it to ironic" 2020-09-23 12:14:38 +00:00
Dmitry Tantsur
021e0a6a46 Generate a TLS certificate and send it to ironic
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
2020-09-11 17:46:52 +02:00
Julia Kreger
3426963552 Fix backup node lookup
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
2020-09-09 15:19:38 -07:00
Julia Kreger
d3c3d4dabe Update the cache if we don't have a root device hint
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
2020-08-25 19:34:48 +00:00
Zuul
cda5467839 Merge "Examples: add deploy_steps examples" 2020-08-07 15:55:30 +00:00
Dmitry Tantsur
ce53863361 Examples: add deploy_steps examples
Change-Id: Ifacd8fb05a80f34029965156334fbb707468f1f6
2020-08-04 16:51:54 +02:00
Zuul
ad9c54f55c Merge "Return the final RAID configuration from apply_configuration" 2020-07-29 14:00:08 +00:00
Dmitry Tantsur
f03d72019a Return the final RAID configuration from apply_configuration
AgentRAID expects it and fails with TypeError if it's not provided.

Change-Id: Id84ac129bba97540338e25f0027aa0a0f51bde52
Story: #2006963
2020-07-29 10:10:18 +02:00
Dmitry Tantsur
eb87651496 Allow erase_devices_metadata to be used as a deploy step
Change-Id: I75f156dd76b0e3aaa1592ba24fe42fb2a7057cc8
Story: #2006963
2020-07-27 17:57:37 +02:00
Doug Szumski
5e95b1321d Fix bootloader install issue with MDRAID
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
2020-07-22 11:16:13 -07:00
Dmitry Tantsur
1f3b70c4e9 Ignore devices with size 0 when collecting inventory
delete_configuration still fetches all devices as it needs to clean
ones with broken RAID.

Story: #2007907
Task: #40307
Change-Id: I4b0be2b0755108490f9cd3c4f3b71a5e036761a1
2020-07-09 18:28:20 +02:00
Julia Kreger
c76b8b2c21 Limit Inspection->Lookup->Heartbeat lag
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
2020-07-03 10:32:26 +02:00
Zuul
46bf7e0ef4 Merge "Add a deploy step for writing an image" 2020-06-20 00:00:10 +00:00
Dmitry Tantsur
9d4cf5532f Add a deploy step for writing an image
The new step just invokes the appropriate method of the standby extension.

Change-Id: Ic74f83ab2b7e58f8e4b46e0abfab79e221afeb3e
Story: 2006963
2020-06-02 15:23:54 +02:00
Riccardo Pittau
557d5603a2 Split and move logic for partition tables
Move and split the logic to create the partition tables when
applying raid configuration.

Change-Id: Ic76dd2067ace02dd02351caca0c7f9b05571e510
2020-05-25 08:11:28 +00:00
Riccardo Pittau
8d210638a8 Fix TypeError with newer version of lshw
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
2020-04-27 15:07:54 +02:00
Riccardo Pittau
2738e57f2a Add function to calculate memory
Move logic to calculate memory to its own function.

Change-Id: I5ab98b6450ff45dff35ddae093a83140f37047a8
2020-04-27 10:46:05 +02:00
Zuul
5dcff4d2b3 Merge "Add raid.apply_configuration deploy step" 2020-04-21 09:32:40 +00:00
Zuul
6a95e216f6 Merge "Simplify deduplicate_steps" 2020-04-21 00:37:15 +00:00
Dmitry Tantsur
c0502649ba Add raid.apply_configuration deploy step
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
2020-04-20 12:50:14 +02:00
Riccardo Pittau
3966871f47 Move logic to calculate raid sectors to raid_utils
Some more raid related logic moved to raid_utils.

Change-Id: I08c73ad14e5b01ebac2490b83997c5452506d4a2
2020-04-09 15:03:37 +02:00
Zuul
83b5a8b202 Merge "Move logic for raid start sector to raid_utils" 2020-04-09 12:31:29 +00:00
Zuul
b9e320e76f Merge "Add an ability to run in-band deploy steps" 2020-04-09 09:31:49 +00:00
Riccardo Pittau
f32a4a2b29 Move logic for raid start sector to raid_utils
A starting tentative in reducing size of raid related functions.

Change-Id: I81f912d0dc0ad138d8cc776cdb4ee3b5251ec3ba
2020-04-08 17:32:38 +02:00
Arne Wiebalck
66c32784af Editing follow-up for UEFI Software RAID support
This is a follow-up to https://review.opendev.org/#/c/696156/

Change-Id: I0fd2c09045ff07a57374934c35d4a3a8467f5e99
Story: #2006379
Task: #37635
2020-04-06 18:03:25 +02:00
Dmitry Tantsur
079f61d09c Simplify deduplicate_steps
The same result can be achieved using a multi-component sorting key.

Change-Id: Ieacf9fcecb2a6de7b4ccd8889f789099af39aa37
2020-04-06 10:30:31 +02:00
Mark Goddard
1b4ce47921 Add an ability to run in-band deploy steps
Mostly adaptation of cleaning methods.

Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: Ife0502391bbece46d619a20a825dfdb191d5c2b4
Story: 2006963
Task: 37791
2020-04-06 10:24:08 +02:00
Raphael Glon
9343348106 Software RAID: Add UEFI support
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
2020-04-02 18:02:19 +02:00
Zuul
d71a8375fa Merge "Only check for partitions on devices that are part of software RAID" 2020-04-02 14:56:45 +00:00
Zuul
ab8c7c05bc Merge "Allow specifying target devices for software RAID" 2020-04-01 17:36:50 +00:00
Dmitry Tantsur
34b58f6024 Only check for partitions on devices that are part of software RAID
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
2020-04-01 16:02:05 +02:00
Riccardo Pittau
a332a19a57 Bump hacking to 3.0.0
Change-Id: I1032ea6a2e9d79aeaecb1458c319cbeb15ac1fff
2020-03-30 12:55:46 +02:00
Julia Kreger
bf0bb7a87a Improve debug logging around Raid/Bootloader
Change-Id: I7d34b918a859972a2d5650494824d3333016dd11
2020-03-28 08:55:32 -07:00
Dmitry Tantsur
ddbba07021 Allow specifying target devices for software RAID
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
2020-03-17 13:03:24 +01:00