Skip to content

Commit 4af6c63

Browse files
committed
Added multi disk support
1 parent 5cde143 commit 4af6c63

14 files changed

+246
-0
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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,23 @@ 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+
// +listType=map
209+
// +listMapKey=name
210+
// +kubebuilder:validation:MaxItems=29
211+
DataDisks []VSphereDisk `json:"dataDisks,omitempty"`
212+
}
213+
214+
// VSphereDisk is an additional disk to add to the VM that is not part of the VM OVA template.
215+
type VSphereDisk struct {
216+
// Name is used to identify the disk definition. Name is required and needs to be unique so that it can be used to
217+
// clearly identify purpose of the disk.
218+
// +kubebuilder:validation:Required
219+
Name string `json:"name,omitempty"`
220+
// SizeGiB is the size of the disk in GiB.
221+
// +kubebuilder:validation:Required
222+
SizeGiB int32 `json:"sizeGiB"`
206223
}
207224

208225
// 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)