-
Notifications
You must be signed in to change notification settings - Fork 522
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
SPLAT-1808: Add vSphere multi disk support #2028
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
Hello @vr4manta! Some important instructions when contributing to openshift/api: |
/test all |
Do you have a Jira ticket for this work? I'm trying to research disk support in openshift and this is of interest to me. |
/retest |
@kannon92 , We are investigating this as well. I am using our spike to track the work and am getting stories / epic information for you. I'll attach the JIRAs to the PR above as well. |
70f7f59
to
682c24c
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.
overall lgtm, i left a couple of comments. also, will there be a need for additional unit tests?
// Disks is a list of non OS disks to be attached to the VM. | ||
// +openshift:enable:FeatureGate=VSphereMultiDisk | ||
// +openshift:validation:FeatureGateAwareMaxItems:featureGate="",maxItems=0 | ||
// +openshift:validation:FeatureGateAwareMaxItems:featureGate=VSphereMultiDisk,maxItems=15 |
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.
is a max of 15 related to any documented limitation?
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.
just put it in place for now since scsi controller can only house up to 16 if I remember correctly (so 1 for OS disk). Current design was to keep it simple and we just auto add to primarly scsi controller.
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 limit will need to be explained in the godoc
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 will update godoc to contain this info.
@@ -172,6 +179,15 @@ type NetworkDeviceSpec struct { | |||
AddressesFromPools []AddressesFromPool `json:"addressesFromPools,omitempty"` | |||
} | |||
|
|||
// VSphereDisk describes additional disks for vSphere. | |||
type VSphereDisk struct { | |||
// The device name exposed. Used to identify the disk. |
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.
if not defined, what is the behavior? is a disk created for you?
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.
If you do not specify a device name, it will still create the disk with the size you defined. The deviceName field is to be used by admin to sort of remind them what disk is meant to be used for (if they so desire).
Unit tests are in the webhook for MAO. The CEL is being ignored based on current behavior of provider specs. |
/assign @JoelSpeed |
@vr4manta: This pull request references SPLAT-1808 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rvanderp3, vr4manta The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Is there a paired MAO PR that implements validations for this new API field that I can review?
reportProblemsToJiraComponent("splat"). | ||
contactPerson("vr4manta"). | ||
productScope(ocpSpecific). | ||
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). |
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.
Are you ready for techpreview or would you prefer just to start in dev preview for now?
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 can start in Dev if you prefer. I have the initial logic completed for creating extra disks for masters and workers. This is just the first step of the bigger picture, but i'll take your guidance on this.
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.
PR for MAO: openshift/machine-api-operator#1290. I'll also put up in top comment.
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.
Do you think this effort is likely to be long and span multiple releases?
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 think the initial implementation should be quick. I think its just a matter of making sure all cases are covered for creating the disks and complete testing is performed.
// +openshift:validation:FeatureGateAwareMaxItems:featureGate="",maxItems=0 | ||
// +openshift:validation:FeatureGateAwareMaxItems:featureGate=VSphereMultiDisk,maxItems=15 |
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.
Make the whole field featuregated, rather than feature gated limits (though note this isn't actually part of a CRD so these markers are just for show at the moment)
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.
Ok, I can do that. Yep, I had to make all this logic in the webhook of MAPI operator due to provider specs not being proper CRDs.
// Disks is a list of non OS disks to be attached to the VM. | ||
// +openshift:enable:FeatureGate=VSphereMultiDisk | ||
// +openshift:validation:FeatureGateAwareMaxItems:featureGate="",maxItems=0 | ||
// +openshift:validation:FeatureGateAwareMaxItems:featureGate=VSphereMultiDisk,maxItems=15 |
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 limit will need to be explained in the godoc
@@ -70,6 +70,13 @@ type VSphereMachineProviderSpec struct { | |||
// When using LinkedClone, if no snapshots exist for the source template, falls back to FullClone. | |||
// +optional | |||
CloneMode CloneMode `json:"cloneMode,omitempty"` | |||
// Disks is a list of non OS disks to be attached to the VM. |
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.
Godoc should explain validations, and should start with the serialised form (disks
) of the field name.
What does a user need to do for each disk here, do they need to specify any software side configuration?
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.
Currently the logic is to just create the disk and attach to vsphere VMs. What user does after that can be anything. They can use LSO (local storage operator) or the future auto mount that we are currently working on to put these disks into certain locations.
// +openshift:enable:FeatureGate=VSphereMultiDisk | ||
// +openshift:validation:FeatureGateAwareMaxItems:featureGate="",maxItems=0 | ||
// +openshift:validation:FeatureGateAwareMaxItems:featureGate=VSphereMultiDisk,maxItems=15 | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf | size(self) == size(oldSelf)",message="additional disks cannot be added or removed once set" |
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 does this actually mean? This is part of the vSphere providerSpec on the Machine right? So, we don't expect it to be changed once the machine is created anyway, that's true of most fields
When this is present on a MachineSet though, then it should be mutable right?
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.
Yes that is correct. I expect machines to be not mutable, but for machineset, I'll follow the patterns of other fields in the machine def section.
// The device name exposed. Used to identify the disk. | ||
// +optional | ||
DeviceName *string `json:"deviceName,omitempty"` | ||
// SizeGB is the size of the disk (in GB). |
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.
Serialised version to start.
What's the minimum and maximum values here?
Do we mean GB or GiB?
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.
Good catch. I'll update that.
Is this feature currently supported in Cluster API? |
No. CAPI only supports additional disks that are created in the template. |
@vr4manta: This pull request references SPLAT-1808 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
682c24c
to
ec53929
Compare
New changes are detected. LGTM label has been removed. |
So, if we merge this feature, this will create a feature gap between MAPV and CAPV? How would you suggest we migrate users using this feature? We likely need to implement this upstream in CAPV before we can do any migration right? |
Yes. We will need to work with CAPV to see what they have thought about in the past for dynamic disk configs for VMs. The installer enhancement for this feature currently uses the postProvision hook after CAPI machines (control plane) are created and adds the disks to the VMs. I have been trying to follow what some of the other providers have for naming conventions, but each platform seems to use slightly different field names. For vSphere specific, it would be good to see if we can use the current |
ec53929
to
434fb5d
Compare
/hold |
434fb5d
to
acc042b
Compare
d552e8b
to
acd91e6
Compare
78abbaa
to
e09483b
Compare
e09483b
to
a206d3e
Compare
a206d3e
to
b8357fa
Compare
@vr4manta: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@vr4manta How are you getting on with upstream WRT this feature? |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
SPLAT-1808
Changes
Blocks
Notes