@@ -20,8 +20,8 @@ type config struct {
2020 NumCoresPerSocket int64 `json:"nutanix_control_plane_cores_per_socket"`
2121 ProjectUUID string `json:"nutanix_control_plane_project_uuid"`
2222 Categories map [string ]string `json:"nutanix_control_plane_categories"`
23- PrismElementUUID string `json:"nutanix_prism_element_uuid "`
24- SubnetUUID string `json:"nutanix_subnet_uuid "`
23+ PrismElementUUIDs [] string `json:"nutanix_prism_element_uuids "`
24+ SubnetUUIDs [] string `json:"nutanix_subnet_uuids "`
2525 Image string `json:"nutanix_image"`
2626 ImageURI string `json:"nutanix_image_uri"`
2727 BootstrapIgnitionImage string `json:"nutanix_bootstrap_ignition_image"`
@@ -49,6 +49,7 @@ func TFVars(sources TFVarsSources) ([]byte, error) {
4949
5050 bootstrapIgnitionImageName := nutanixtypes .BootISOImageName (sources .ClusterID )
5151 controlPlaneConfig := sources .ControlPlaneConfigs [0 ]
52+ cpCount := len (sources .ControlPlaneConfigs )
5253 cfg := & config {
5354 Port : sources .Port ,
5455 PrismCentralAddress : sources .PrismCentralAddress ,
@@ -58,14 +59,19 @@ func TFVars(sources TFVarsSources) ([]byte, error) {
5859 DiskSizeMiB : controlPlaneConfig .SystemDiskSize .Value () / (1024 * 1024 ),
5960 NumCPUs : int64 (controlPlaneConfig .VCPUSockets ),
6061 NumCoresPerSocket : int64 (controlPlaneConfig .VCPUsPerSocket ),
61- PrismElementUUID : * controlPlaneConfig . Cluster . UUID ,
62- SubnetUUID : * controlPlaneConfig . Subnets [ 0 ]. UUID ,
62+ PrismElementUUIDs : make ([] string , cpCount ) ,
63+ SubnetUUIDs : make ([] string , cpCount ) ,
6364 Image : * controlPlaneConfig .Image .Name ,
6465 ImageURI : sources .ImageURI ,
6566 BootstrapIgnitionImage : bootstrapIgnitionImageName ,
6667 BootstrapIgnitionImageFilePath : bootstrapIgnitionImagePath ,
6768 }
6869
70+ for i , cpcfg := range sources .ControlPlaneConfigs {
71+ cfg .PrismElementUUIDs [i ] = * cpcfg .Cluster .UUID
72+ cfg .SubnetUUIDs [i ] = * cpcfg .Subnets [0 ].UUID
73+ }
74+
6975 if controlPlaneConfig .Project .Type == machinev1 .NutanixIdentifierUUID {
7076 cfg .ProjectUUID = * controlPlaneConfig .Project .UUID
7177 }
0 commit comments