Skip to content

Commit 32dba0a

Browse files
committed
propose extra pre-provisioning kernel args
This commit: - Introduces the proposal for BMH support for additional node specific kernel command line arguments for non dynamically built pre-provisioning images. The motivation behind the commit can be found in the proposal. Signed-off-by: Adam Rozman <adam.rozman@est.tech>
1 parent b121d0a commit 32dba0a

File tree

1 file changed

+186
-0
lines changed

1 file changed

+186
-0
lines changed
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
<!--
2+
This work is licensed under a Creative Commons Attribution 3.0
3+
Unported License.
4+
5+
http://creativecommons.org/licenses/by/3.0/legalcode
6+
-->
7+
8+
# pre-provisioning kernel argument support
9+
10+
## Status
11+
12+
planned
13+
14+
## Summary
15+
16+
This document proposes a new BareMetalHost spec attribute intended for
17+
configuring the pre-provisioning image's (usually IPA) kernel arguments.
18+
19+
## Motivation
20+
21+
There are situations where a user would need node specific kernel arguments
22+
for the pre-provisioning image. The reason could be the use of a mixed set of
23+
hardware, troubleshooting provisioning or boot issues, selectively configuring
24+
custom logic e.g. enabling IPA plugins or other services embedded in the
25+
pre-provisioning image.
26+
27+
### Goals
28+
29+
1. Implement a string type optional spec field named `preprovisioningExtraKernelParams`
30+
2. Extend the generic `Provisioner` interface to support the new optional field
31+
3. Implement support for the `preprovisioningExtraKernelParams` in the Ironic provisioner
32+
33+
### Non-Goals
34+
35+
1. To implement any sort validation for the new optional field
36+
2. Providing a default value for the new spec field
37+
3. Implement conditional logic to overwrite default kernel parameters on
38+
per node basis
39+
40+
## Proposal
41+
42+
This document proposes a new BareMetalHost spec attribute intended for
43+
configuring the pre-provisioning image's (usually IPA) kernel arguments.
44+
45+
The proposal involves the introduction of a new spec field thus a modification
46+
to the BMO API. The API change is intended to be backward compatible as the
47+
new `preprovisioningExtraKernelParams` field is optional.
48+
49+
### Implementation Details/Notes/Constraints
50+
51+
The `preprovisioningExtraKernelParams` field would be located directly under `spec`
52+
section. The format of the new field would be a list/array of individual
53+
strings. The new field would be optional and it would be considered
54+
either a NOOP or a cleaning operation depending on the previous value of the
55+
field in case it would be not present or have no value or would have an empty
56+
array as a value.
57+
58+
The proposed BMH looks like the following:
59+
60+
```yaml
61+
apiVersion: metal3.io/v1alpha1
62+
kind: BareMetalHost
63+
metadata:
64+
name: bm0
65+
spec:
66+
online: true
67+
bmc:
68+
address: idrac://192.168.122.1:6230/
69+
credentialsName: bm0-bmc-secret
70+
preprovisioningExtraKernelParams: "--timeout 60000 systemd.journald.forward_to_console=yes ipa-debug=1"
71+
...
72+
...
73+
...
74+
bootMACAddress: 52:54:00:b7:b2:6f
75+
...
76+
...
77+
...
78+
79+
```
80+
81+
The example contains a snippet of a common IPA kernel argument list.
82+
The `preprovisioningExtraKernelParams` string would be received by the `Provisioner`
83+
interface as is. The handling of the list would be up to the particular
84+
implementations of the `Provisioner` interface.
85+
86+
Given the BMH snippet from above, the kernel parameter list generated by
87+
the `Ironic provisioner` and posted to the Ironic Node API would look like
88+
almost the same with one important addition. The ironic provisioner will
89+
always prepend the `%default%` substring to the `preprovisioningExtraKernelParams`.
90+
91+
The addition of the "%default%" will cause Ironic to inject the extra
92+
kernel parameters provided via the ironic config file and ironic-image
93+
environment variables. The inclusion of "%default%" is beneficial from
94+
multiple point of view, it makes the API based kernel parameter update logic
95+
consistent with the same feature used for dynamically built `preprovisioningImage`s.
96+
An other benefit is that kernel parameters coming from environment variables
97+
might contain credentials like ssh keys, or other sensitive information
98+
that would cause a security issue to display in a spec field.
99+
100+
It is possible to implement an annotation or an other spec field to
101+
force BMO to overwrite the node specific kernel arguments. Implementing
102+
logic to conditionally overwrite the parameters might prove useful in some
103+
scenarios but it would completely deviate from how users are applying
104+
kernel parameters both with pre built or with dynamically build pre provisioning
105+
images thus using this feature might cause unexpected issues.
106+
107+
In this proposal I am proposing the minimal viable feature to add node
108+
specific kernel arguments, in case in the future there will be interest in
109+
fully overwriting kernel parameters then the proposed feature can be extended
110+
with the relevant logic.
111+
112+
### Risks and Mitigations
113+
114+
Providing a faulty list kernel arguments might result in boot issues
115+
or unexpected behavior during the life cycle of the pre-provisioning image.
116+
117+
The user has to be aware that the kernel arguments supplied here will fully or
118+
partially overwrite the default arguments depending on how the particular
119+
`Provisioner` is handling the argument list. In case of Ironic provisioner
120+
the `preprovisioningExtraKernelParams` will completely replace the default argument
121+
list used by Ironic.
122+
123+
## Design Details
124+
125+
Most of the design is very straightforward and easy to combine with the
126+
reconcile logic, the support for node specific pre-provisioning kernel args
127+
also already exist in Ironic, so right after the feature is implemented in BMO
128+
it can be used without waiting for Ironic implementation to arrive.
129+
130+
The only challenge is the process of updating/cleaning the previously applied
131+
kernel argument list, this cleanup/update process highly depends on the
132+
particular provisioner.
133+
134+
This document proposes extending the existing "NodeUpdate" functions of the
135+
Ironic provisioner utilized during provisioning, inspection and registration
136+
with updating the kernel parameters of the Ironic driver_info. In case of
137+
servicing and preparing states/operations "NodeUpdate"s have to be added this
138+
based on the user's workflow there might be a few extra node updates based on
139+
how many tines are the servicing or preparing logic is run.
140+
141+
### Work Items
142+
143+
- Implement a string type optional spec field named `preprovisioningExtraKernelParams`
144+
- Extend the generic `Provisioner` interface to support the new optional field
145+
- Implement support for the `preprovisioningExtraKernelParams` in the Ironic driver
146+
- Extend the data types used in different operational states to hold
147+
an entry for `preprovisioningExtraKernelParams`
148+
- Implement unit tests, and align existing unit tests as needed
149+
- Add a check to the existing BMO e2e workflow that checks that the redfish
150+
images and the PXE config files to verify that the provisioner image will
151+
receive the correct parameters. Logging into a running IPA could also work
152+
but in e2e tests Metal3 CI is using upstream IPA images that don't allow
153+
users to log in via neither serial or ssh connections.
154+
155+
### Dependencies
156+
157+
- Ironic in case of the `Ironic Provisioner`
158+
159+
### Test Plan
160+
161+
- Unit tests for the functions
162+
- Integration testing with VMs, most likely as part of the existing
163+
e2e workflow.
164+
165+
### Upgrade / Downgrade Strategy
166+
167+
- In case of upgrade user would not need to do anything
168+
- In case of downgrade the user has to remove the field from the BMH
169+
to both make the BMH compatible with the older API and to allow the
170+
particular provisioner in use to return using the defaults arguments list.
171+
172+
### Version Skew Strategy
173+
174+
None
175+
176+
## Drawbacks
177+
178+
None
179+
180+
## Alternatives
181+
182+
None
183+
184+
## Reference
185+
186+
None

0 commit comments

Comments
 (0)