Skip to content

Commit

Permalink
vsphere: Add ResourcePoolPath information in the machineset
Browse files Browse the repository at this point in the history
Vcenter can have multiple datacenters and clusters. When a new cluster
is created, the machine-api operator fails to find a default resource
pool because there are multiple and there is ambiguity in choice.

This will specify the exact path to reference the resources which will
remove this ambiguity and will not cause failure in the installation
process.
  • Loading branch information
rna-afk committed Jul 8, 2020
1 parent 8224f9d commit 50b8801
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/asset/machines/vsphere/machines.go
Expand Up @@ -65,6 +65,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine

func provider(clusterID string, platform *vsphere.Platform, mpool *vsphere.MachinePool, osImage string, userDataSecret string) (*vsphereapis.VSphereMachineProviderSpec, error) {
folder := fmt.Sprintf("/%s/vm/%s", platform.Datacenter, clusterID)
resourcePool := fmt.Sprintf("/%s/host/%s/Resources", platform.Datacenter, platform.Cluster)
if platform.Folder != "" {
folder = platform.Folder
}
Expand All @@ -85,10 +86,11 @@ func provider(clusterID string, platform *vsphere.Platform, mpool *vsphere.Machi
},
},
Workspace: &vsphereapis.Workspace{
Server: platform.VCenter,
Datacenter: platform.Datacenter,
Datastore: platform.DefaultDatastore,
Folder: folder,
Server: platform.VCenter,
Datacenter: platform.Datacenter,
Datastore: platform.DefaultDatastore,
Folder: folder,
ResourcePool: resourcePool,
},
NumCPUs: mpool.NumCPUs,
NumCoresPerSocket: mpool.NumCoresPerSocket,
Expand Down

0 comments on commit 50b8801

Please sign in to comment.