Skip to content

Commit

Permalink
add to [num_vcpus, memory_size_bytes, data_disk_size_bytes] resource_…
Browse files Browse the repository at this point in the history
…config for deploy pc
  • Loading branch information
Haroon-Dweikat-Ntx committed Dec 18, 2024
1 parent 5b82749 commit fce46ed
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion nutanix/services/prismv2/resource_nutanix_deploy_pc_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,17 @@ func schemaForPcConfig() *schema.Schema {
},
"num_vcpus": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
},
"memory_size_bytes": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
},
"data_disk_size_bytes": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
},
},
Expand Down Expand Up @@ -669,7 +672,7 @@ func expandPCConfig(configData map[string]interface{}) *config.DomainManagerClus
if credentials, ok := configData["credentials"]; ok {
domainManagerClusterConfig.Credentials = expandCredentials(credentials.([]interface{}))
}
if resourceConfig, ok := configData["resource_config"]; ok {
if resourceConfig, ok := configData[" "]; ok {
domainManagerClusterConfig.ResourceConfig = expandResourceConfig(resourceConfig.([]interface{})[0].(map[string]interface{}))
}

Expand Down Expand Up @@ -977,6 +980,15 @@ func expandResourceConfig(resourceConfig map[string]interface{}) *config.DomainM
}
resourceConfigObj.ContainerExtIds = containerExtIdsListObj
}
if numVcpus, ok := resourceConfig["num_vcpus"]; ok {
resourceConfigObj.NumVcpus = utils.IntPtr(numVcpus.(int))
}
if memorySizeBytes, ok := resourceConfig["memory_size_bytes"]; ok {
resourceConfigObj.MemorySizeBytes = utils.Int64Ptr(int64(memorySizeBytes.(int)))
}
if dataDiskSizeBytes, ok := resourceConfig["data_disk_size_bytes"]; ok {
resourceConfigObj.DataDiskSizeBytes = utils.Int64Ptr(int64(dataDiskSizeBytes.(int)))
}

return resourceConfigObj
}
Expand Down

0 comments on commit fce46ed

Please sign in to comment.