-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
root device hints #495
root device hints #495
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhellmann The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9a3c4df
to
ede242b
Compare
Looks good, I guess unit test updates in the same PR? |
This should be backward compatible, no ? we should be able to add it without waiting for the next version. I am not sure I get the reason for postponing it. |
The validation for updating the CRD is broken. I think we should prioritize fixing that over extending the API further so that when we do work on the API changes we can trust that we're making all of the necessary changes. That doesn't necessarily assume waiting for the next API version, but since I plan to do that right away as part of fixing the current issue (see #434 for the todo list) I don't think the wait will be very long. |
ok, that's good! thank you |
I posted this in the other PR but not sure if anybody saw it
I'm worried this functionality will need to be duplicated(in the installer and in ironic itself) for provisioning master nodes is that the case? and if so could we just passthrough of the json to ironic? |
Yes, the OpenShift installer is going to need to do its own thing. We should talk about that over on that PR, since it's not really relevant to metal3 upstream. |
ede242b
to
5612e35
Compare
/test-integration |
5612e35
to
74c613d
Compare
530c040
to
df37555
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks basically good
Add a new field spec.rootDeviceHints to the API with sub-fields for different types of hints based on what Ironic supports today. Add a new field status.rootDeviceHints to record the values used when provisioning the host. Change the Provisioner API to return the new public struct with the more detailed device hints so that the values in the hard-coded profiles can be stored directly in the new status field. If the user does not provide explicit hints, use the values from the profile. Implements https://github.com/metal3-io/metal3-docs/blob/master/design/user-defined-root-device-hints.md Co-Authored-By: Mika Koskimaki <mika.koskimaki@est.tech> Co-Authored-By: Doug Hellmann <dhellmann@redhat.com> Signed-off-by: Doug Hellmann <dhellmann@redhat.com>
df37555
to
86ffcc8
Compare
/test-integration |
that looks good to me |
I need to update the API docs. /hold |
/hold cancel |
/test-integration |
Add a missing reference to the hardwareProfile in the spec section so that we can include a deprecation warning. Add missing fields in the provisioning status section so that we can extend it with the root device hints field. Signed-off-by: Doug Hellmann <dhellmann@redhat.com>
c74e342
to
592d826
Compare
/test-integration |
type: string | ||
sizeGigabytes: | ||
description: Size of the device in Gigabytes | ||
type: integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ironic this may include an operator, like ">= 4". I think it makes sense to support it here as well, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the default behavior if only a number is provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have minSizeGigabytes and maxSizeGigabytes.
I agree it's a bit hard on the user forcing them to guess the exact integral number of gigabytes that the disk size will be rounded to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strict equality (yeah, not exactly convenient).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having 2 fields makes sense. That's more in line with what we've done in other similar APIs where we don't want to embed expressions in fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear that we can support both min and max at the same time. I have renamed the field to MinSizeGigabytes
and updated the behavior to always include >=
in the value sent to ironic. If we can have an expression with both >=
and <=
then we can add a MaxSizeGigabytes
field as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also raises the question of what operators we should be assuming for the other fields. And whether we need to allow variations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest version sets an explicit operator for each value we pass to ironic and does not allow the operators to be modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Dmitry's comment, but other than that this looks ready to go.
type: string | ||
sizeGigabytes: | ||
description: Size of the device in Gigabytes | ||
type: integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have minSizeGigabytes and maxSizeGigabytes.
I agree it's a bit hard on the user forcing them to guess the exact integral number of gigabytes that the disk size will be rounded to.
The default for ironic is to treat the value as an exact match, but we want to use it as a minimum value. Rename the field and update the code that produces the map to send to the ironic API to always add the '>=' operator. Signed-off-by: Doug Hellmann <dhellmann@redhat.com>
/test-integration |
Instead of relying on ironic's default behavior, pass explicit operators with each hint. Signed-off-by: Doug Hellmann <dhellmann@redhat.com>
f3ae7c4
to
c2513a6
Compare
/test-integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
SerialNumber string `json:"serialNumber,omitempty"` | ||
|
||
// The minimum size of the device in Gigabytes. | ||
MinSizeGigabytes int `json:"minSizeGigabytes,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that omitempty does anything unless this is a pointer.
Because it's MinSize it doesn't matter that the default is 0 though, so maybe we don't care.
This supercedes #442
Add a new field spec.rootDeviceHints to the API with sub-fields for different types of hints based on what Ironic supports today.
Add a new field status.rootDeviceHints to record the values used when provisioning the host.
Change the Provisioner API to return the new public struct with the more detailed device hints so that the values in the hard-coded profiles can be stored directly in the new status field.
If the user does not provide explicit hints, use the values from the profile.
Implements https://github.com/metal3-io/metal3-docs/blob/master/design/user-defined-root-device-hints.md