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 Sep 18, 2024
1 parent 07bccfd commit 682c24c
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 1 deletion.
1 change: 1 addition & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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> |
| VolumeGroupSnapshot| | | <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
7 changes: 7 additions & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ var (
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateVSphereMultiDisk = newFeatureGate("VSphereMultiDisk").
reportProblemsToJiraComponent("splat").
contactPerson("vr4manta").
productScope(ocpSpecific).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateVSphereMultiVCenters = newFeatureGate("VSphereMultiVCenters").
reportProblemsToJiraComponent("splat").
contactPerson("vr4manta").
Expand Down
16 changes: 16 additions & 0 deletions machine/v1beta1/types_vsphereprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
// +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"
// +optional
Disks []*VSphereDisk `json:"disks,omitempty"`
}

// CloneMode is the type of clone operation used to clone a VM from a template.
Expand Down Expand Up @@ -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.
// +optional
DeviceName *string `json:"deviceName,omitempty"`
// SizeGB is the size of the disk (in GB).
SizeGB int64 `json:"sizeGb"`
}

// WorkspaceConfig defines a workspace configuration for the vSphere cloud
// provider.
type Workspace struct {
Expand Down
32 changes: 32 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.

45 changes: 44 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.

26 changes: 26 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -22266,6 +22266,25 @@
}
}
},
"com.github.openshift.api.machine.v1beta1.VSphereDisk": {
"description": "VSphereDisk describes additional disks for vSphere.",
"type": "object",
"required": [
"sizeGb"
],
"properties": {
"deviceName": {
"description": "The device name exposed. Used to identify the disk.",
"type": "string"
},
"sizeGb": {
"description": "SizeGB is the size of the disk (in GB).",
"type": "integer",
"format": "int64",
"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 @@ -22291,6 +22310,13 @@
"type": "integer",
"format": "int32"
},
"disks": {
"description": "Disks is a list of non OS disks to be attached to the VM.",
"type": "array",
"items": {
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.VSphereDisk"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
{
"name": "UserNamespacesSupport"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@
{
"name": "UserNamespacesSupport"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
{
"name": "VSphereDriverConfiguration"
},
{
"name": "VSphereMultiDisk"
},
{
"name": "VSphereMultiNetworks"
},
Expand Down

0 comments on commit 682c24c

Please sign in to comment.