Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apis/v1alpha3/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ func Convert_v1beta1_VSphereMachineSpec_To_v1alpha3_VSphereMachineSpec(in *infra
func Convert_v1beta1_VSphereVMSpec_To_v1alpha3_VSphereVMSpec(in *infrav1.VSphereVMSpec, out *VSphereVMSpec, s conversion.Scope) error {
return autoConvert_v1beta1_VSphereVMSpec_To_v1alpha3_VSphereVMSpec(in, out, s)
}

// This is required as the v1beta1 topology has an additional `storagePolicy` field.
func Convert_v1beta1_Topology_To_v1alpha3_Topology(in *infrav1.Topology, out *Topology, s conversion.Scope) error {
return autoConvert_v1beta1_Topology_To_v1alpha3_Topology(in, out, s)
}
40 changes: 28 additions & 12 deletions apis/v1alpha3/zz_generated.conversion.go

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

5 changes: 5 additions & 0 deletions apis/v1alpha4/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ func Convert_v1beta1_VSphereMachineSpec_To_v1alpha4_VSphereMachineSpec(in *infra
func Convert_v1beta1_VSphereVMSpec_To_v1alpha4_VSphereVMSpec(in *infrav1.VSphereVMSpec, out *VSphereVMSpec, s conversion.Scope) error {
return autoConvert_v1beta1_VSphereVMSpec_To_v1alpha4_VSphereVMSpec(in, out, s)
}

// This is required as the v1beta1 topology has an additional `storagePolicy` field.
func Convert_v1beta1_Topology_To_v1alpha4_Topology(in *infrav1.Topology, out *Topology, s conversion.Scope) error {
return autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in, out, s)
}
40 changes: 28 additions & 12 deletions apis/v1alpha4/zz_generated.conversion.go

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

5 changes: 5 additions & 0 deletions apis/v1beta1/vspherefailuredomain_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ type Topology struct {
// virtual machine is created/located.
// +optional
Datastore string `json:"datastore,omitempty"`

// StoragePolicy is the name of the policy that is used to target a datastore
// in which the virtual machine is created/located.
// +optional
StoragePolicy string `json:"storagePolicy,omitempty"`
}

// FailureDomainHosts has information required for placement of machines on VSphere hosts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ spec:
items:
type: string
type: array
storagePolicy:
description: |-
StoragePolicy is the name of the policy that is used to target a datastore
in which the virtual machine is created/located.
type: string
required:
- datacenter
type: object
Expand Down
3 changes: 3 additions & 0 deletions pkg/services/vimmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ func (v *VimMachineService) generateOverrideFunc(ctx context.Context, vimMachine
if vsphereDeploymentZone.Spec.PlacementConstraint.ResourcePool != "" {
vm.Spec.ResourcePool = vsphereDeploymentZone.Spec.PlacementConstraint.ResourcePool
}
if vsphereFailureDomain.Spec.Topology.StoragePolicy != "" {
vm.Spec.StoragePolicyName = vsphereFailureDomain.Spec.Topology.StoragePolicy
}
if vsphereFailureDomain.Spec.Topology.Datastore != "" {
vm.Spec.Datastore = vsphereFailureDomain.Spec.Topology.Datastore
}
Expand Down