Skip to content

Commit 13eb94d

Browse files
committed
Added multi disk support
1 parent e31580e commit 13eb94d

15 files changed

+469
-20
lines changed

apis/v1alpha3/vspheremachine_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (src *VSphereMachine) ConvertTo(dstRaw conversion.Hub) error {
4646
dst.Spec.Network.Devices[i].DHCP6Overrides = restored.Spec.Network.Devices[i].DHCP6Overrides
4747
dst.Spec.Network.Devices[i].SkipIPAllocation = restored.Spec.Network.Devices[i].SkipIPAllocation
4848
}
49+
dst.Spec.DataDisks = restored.Spec.DataDisks
4950

5051
return nil
5152
}

apis/v1alpha3/vspheremachinetemplate_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func (src *VSphereMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {
4949
dst.Spec.Template.Spec.Network.Devices[i].DHCP6Overrides = restored.Spec.Template.Spec.Network.Devices[i].DHCP6Overrides
5050
dst.Spec.Template.Spec.Network.Devices[i].SkipIPAllocation = restored.Spec.Template.Spec.Network.Devices[i].SkipIPAllocation
5151
}
52+
dst.Spec.Template.Spec.DataDisks = restored.Spec.Template.Spec.DataDisks
5253

5354
return nil
5455
}

apis/v1alpha3/vspherevm_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (src *VSphereVM) ConvertTo(dstRaw conversion.Hub) error {
4646
dst.Spec.Network.Devices[i].DHCP6Overrides = restored.Spec.Network.Devices[i].DHCP6Overrides
4747
dst.Spec.Network.Devices[i].SkipIPAllocation = restored.Spec.Network.Devices[i].SkipIPAllocation
4848
}
49+
dst.Spec.DataDisks = restored.Spec.DataDisks
4950

5051
return nil
5152
}

apis/v1alpha3/zz_generated.conversion.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha4/vspheremachine_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (src *VSphereMachine) ConvertTo(dstRaw conversion.Hub) error {
4646
dst.Spec.Network.Devices[i].DHCP6Overrides = restored.Spec.Network.Devices[i].DHCP6Overrides
4747
dst.Spec.Network.Devices[i].SkipIPAllocation = restored.Spec.Network.Devices[i].SkipIPAllocation
4848
}
49+
dst.Spec.DataDisks = restored.Spec.DataDisks
4950

5051
return nil
5152
}

apis/v1alpha4/vspheremachinetemplate_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func (src *VSphereMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {
4949
dst.Spec.Template.Spec.Network.Devices[i].DHCP6Overrides = restored.Spec.Template.Spec.Network.Devices[i].DHCP6Overrides
5050
dst.Spec.Template.Spec.Network.Devices[i].SkipIPAllocation = restored.Spec.Template.Spec.Network.Devices[i].SkipIPAllocation
5151
}
52+
dst.Spec.Template.Spec.DataDisks = restored.Spec.Template.Spec.DataDisks
5253

5354
return nil
5455
}

apis/v1alpha4/vspherevm_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (src *VSphereVM) ConvertTo(dstRaw conversion.Hub) error {
4646
dst.Spec.Network.Devices[i].DHCP6Overrides = restored.Spec.Network.Devices[i].DHCP6Overrides
4747
dst.Spec.Network.Devices[i].SkipIPAllocation = restored.Spec.Network.Devices[i].SkipIPAllocation
4848
}
49+
dst.Spec.DataDisks = restored.Spec.DataDisks
4950

5051
return nil
5152
}

apis/v1alpha4/zz_generated.conversion.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1beta1/types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,21 @@ type VirtualMachineCloneSpec struct {
203203
// Check the compatibility with the ESXi version before setting the value.
204204
// +optional
205205
HardwareVersion string `json:"hardwareVersion,omitempty"`
206+
// DataDisks are additional disks to add to the VM that are not part of the VM's OVA template.
207+
// +optional
208+
DataDisks []VSphereDisk `json:"dataDisks,omitempty"`
209+
}
210+
211+
// VSphereDisk is an additional disk to add to the VM that is not part of the VM OVA template.
212+
type VSphereDisk struct {
213+
// Name is used to identify the disk definition. If Name is not specified, the disk will still be created.
214+
// The Name should be unique so that it can be used to clearly identify purpose of the disk, but is not
215+
// required to be unique.
216+
// +optional
217+
Name string `json:"name,omitempty"`
218+
// SizeGiB is the size of the disk in GiB.
219+
// +kubebuilder:validation:Required
220+
SizeGiB int32 `json:"sizeGiB"`
206221
}
207222

208223
// VSphereMachineTemplateResource describes the data needed to create a VSphereMachine from a template.

apis/v1beta1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)