Skip to content

Commit

Permalink
Add vSphere multi disk support
Browse files Browse the repository at this point in the history
  • Loading branch information
vr4manta committed Nov 14, 2024
1 parent 4c27e61 commit e09483b
Show file tree
Hide file tree
Showing 13 changed files with 149 additions and 1 deletion.
1 change: 1 addition & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
| UpgradeStatus| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| UserNamespacesPodSecurityStandards| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| UserNamespacesSupport| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| VSphereMultiDisk| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| VSphereMultiNetworks| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| VSphereMultiVCenters| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| VolumeAttributesClass| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
8 changes: 8 additions & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ var (
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateVSphereMultiDisk = newFeatureGate("VSphereMultiDisk").
reportProblemsToJiraComponent("splat").
contactPerson("vr4manta").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1709").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateVSphereMultiVCenters = newFeatureGate("VSphereMultiVCenters").
reportProblemsToJiraComponent("splat").
contactPerson("vr4manta").
Expand Down
18 changes: 18 additions & 0 deletions machine/v1beta1/types_vsphereprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ type VSphereMachineProviderSpec struct {
// When using LinkedClone, if no snapshots exist for the source template, falls back to FullClone.
// +optional
CloneMode CloneMode `json:"cloneMode,omitempty"`
// dataDisks is a list of non OS disks to be created and attached to the VM. The max number of disk allowed to be attached is
// currently 15. This limitation is being applied to allow no more than 16 disks on the default scsi controller for the VM.
// The first disk on that SCSI controller will be the OS disk from the template.
// +openshift:enable:FeatureGate=VSphereMultiDisk
// +optional
DataDisks []VSphereDisk `json:"dataDisks,omitempty"`
}

// CloneMode is the type of clone operation used to clone a VM from a template.
Expand Down Expand Up @@ -172,6 +178,18 @@ type NetworkDeviceSpec struct {
AddressesFromPools []AddressesFromPool `json:"addressesFromPools,omitempty"`
}

// VSphereDisk describes additional disks for vSphere.
type VSphereDisk struct {
// name is a name to be used to identify the disk definition. If name is not specified,
// the disk will still be created. The name should be unique so that it can be used to clearly
// identify purpose of the disk, but is not required to be unique.
// +optional
Name string `json:"name,omitempty"`
// sizeGiB is the size of the disk (in GiB).
// +kubebuilder:validation:Required
SizeGiB int32 `json:"sizeGiB"`
}

// WorkspaceConfig defines a workspace configuration for the vSphere cloud
// provider.
type Workspace struct {
Expand Down
21 changes: 21 additions & 0 deletions machine/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions machine/v1beta1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 45 additions & 1 deletion openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -22248,6 +22248,25 @@
}
}
},
"com.github.openshift.api.machine.v1beta1.VSphereDisk": {
"description": "VSphereDisk describes additional disks for vSphere.",
"type": "object",
"required": [
"sizeGiB"
],
"properties": {
"name": {
"description": "name is a name to be used to identify the disk definition. If name is not specified, the disk will still be created. The name should be unique so that it can be used to clearly identify purpose of the disk, but is not required to be unique.",
"type": "string"
},
"sizeGiB": {
"description": "sizeGiB is the size of the disk (in GiB).",
"type": "integer",
"format": "int32",
"default": 0
}
}
},
"com.github.openshift.api.machine.v1beta1.VSphereMachineProviderSpec": {
"description": "VSphereMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field for an VSphere virtual machine. It is used by the vSphere machine actuator to create a single Machine. Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).",
"type": "object",
Expand All @@ -22268,6 +22287,14 @@
"description": "CredentialsSecret is a reference to the secret with vSphere credentials.",
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
},
"dataDisks": {
"description": "dataDisks is a list of non OS disks to be created and attached to the VM. The max number of disk allowed to be attached is currently 15. This limitation is being applied to allow no more than 16 disks on the default scsi controller for the VM. The first disk on that SCSI controller will be the OS disk from the template.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.VSphereDisk"
}
},
"diskGiB": {
"description": "DiskGiB is the size of a virtual machine's disk, in GiB. Defaults to the analogue property value in the template from which this machine is cloned. This parameter will be ignored if 'LinkedClone' CloneMode is set.",
"type": "integer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
{
"name": "UserNamespacesSupport"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
{
"name": "UserNamespacesSupport"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down

0 comments on commit e09483b

Please sign in to comment.