From fce46ed1bdcbed1c536d543cdb438f4a49ab83ab Mon Sep 17 00:00:00 2001 From: Haroon-Dweikat-Ntx Date: Wed, 18 Dec 2024 15:44:27 +0200 Subject: [PATCH] add to [num_vcpus, memory_size_bytes, data_disk_size_bytes] resource_config for deploy pc --- .../prismv2/resource_nutanix_deploy_pc_v2.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nutanix/services/prismv2/resource_nutanix_deploy_pc_v2.go b/nutanix/services/prismv2/resource_nutanix_deploy_pc_v2.go index a8bbf1d4..a9df4872 100644 --- a/nutanix/services/prismv2/resource_nutanix_deploy_pc_v2.go +++ b/nutanix/services/prismv2/resource_nutanix_deploy_pc_v2.go @@ -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, }, }, @@ -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{})) } @@ -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 }