diff --git a/CHANGELOG.md b/CHANGELOG.md index 01655a41..fc13eea1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.14 (TBA) + +Breaking changes +* Removing support for r5.metal instances [\#205](https://github.com/vmware/terraform-provider-vmc/pull/205) +* removing `storage_capacity` field from sddc and cluster resources schema [\#205](https://github.com/vmware/terraform-provider-vmc/pull/205) + ## 1.13.3 (Aug 21, 2023) BUG FIXES: diff --git a/examples/README.md b/examples/README.md index 060cbab0..a56f111a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -22,8 +22,6 @@ To add delay after SDDC has been created, update SDDC resource in [main.tf](http host_instance_type = var.host_instance_type - storage_capacity = var.storage_capacity - account_link_sddc_config { customer_subnet_ids = [data.vmc_customer_subnets.my_subnets.ids[0]] connected_account_id = data.vmc_connected_accounts.my_accounts.id diff --git a/examples/cluster/main.tf b/examples/cluster/main.tf index 34a00044..19209f91 100644 --- a/examples/cluster/main.tf +++ b/examples/cluster/main.tf @@ -37,8 +37,6 @@ resource "vmc_sddc" "sddc_1" { host_instance_type = var.host_instance_type - storage_capacity = var.storage_capacity - account_link_sddc_config { customer_subnet_ids = [data.vmc_customer_subnets.my_subnets.ids[0]] connected_account_id = data.vmc_connected_accounts.my_accounts.id diff --git a/examples/main.tf b/examples/main.tf index 16726e94..e69447f4 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -38,8 +38,6 @@ resource "vmc_sddc" "sddc_1" { host_instance_type = var.host_instance_type - storage_capacity = var.storage_capacity - account_link_sddc_config { customer_subnet_ids = [data.vmc_customer_subnets.my_subnets.ids[0]] connected_account_id = data.vmc_connected_accounts.my_accounts.id diff --git a/examples/public_ip/main.tf b/examples/public_ip/main.tf index c45a72d9..87a55b5d 100644 --- a/examples/public_ip/main.tf +++ b/examples/public_ip/main.tf @@ -38,8 +38,6 @@ resource "vmc_sddc" "sddc_1" { host_instance_type = var.host_instance_type - storage_capacity = var.storage_capacity - account_link_sddc_config { customer_subnet_ids = [data.vmc_customer_subnets.my_subnets.ids[0]] connected_account_id = data.vmc_connected_accounts.my_accounts.id diff --git a/examples/sddc/main.tf b/examples/sddc/main.tf index fe86bd6d..994a0784 100644 --- a/examples/sddc/main.tf +++ b/examples/sddc/main.tf @@ -36,7 +36,6 @@ resource "vmc_sddc" "sddc_1" { deployment_type = var.deployment_type size = var.size host_instance_type = var.host_instance_type - storage_capacity = var.storage_capacity account_link_sddc_config { customer_subnet_ids = [data.vmc_customer_subnets.my_subnets.ids[0]] diff --git a/examples/site_recovery/main.tf b/examples/site_recovery/main.tf index 9bd1b25d..0829ea8f 100644 --- a/examples/site_recovery/main.tf +++ b/examples/site_recovery/main.tf @@ -37,8 +37,6 @@ resource "vmc_sddc" "sddc_1" { host_instance_type = var.host_instance_type - storage_capacity = var.storage_capacity - account_link_sddc_config { customer_subnet_ids = [data.vmc_customer_subnets.my_subnets.ids[0]] connected_account_id = data.vmc_connected_accounts.my_accounts.id diff --git a/examples/srm_node/main.tf b/examples/srm_node/main.tf index be66cd69..3474ba7f 100644 --- a/examples/srm_node/main.tf +++ b/examples/srm_node/main.tf @@ -37,8 +37,6 @@ resource "vmc_sddc" "sddc_1" { host_instance_type = var.host_instance_type - storage_capacity = var.storage_capacity - account_link_sddc_config { customer_subnet_ids = [data.vmc_customer_subnets.my_subnets.ids[0]] connected_account_id = data.vmc_connected_accounts.my_accounts.id diff --git a/vmc/constants/constants.go b/vmc/constants/constants.go index 0554b339..039afc89 100644 --- a/vmc/constants/constants.go +++ b/vmc/constants/constants.go @@ -21,7 +21,6 @@ const ( // ESX Host instance types supported for SDDC creation. HostInstancetypeI3 string = "I3_METAL" - HostInstancetypeR5 string = "R5_METAL" HostInstancetypeI3EN string = "I3EN_METAL" HostInstancetypeI4I string = "I4I_METAL" diff --git a/vmc/resource_vmc_cluster.go b/vmc/resource_vmc_cluster.go index c0533d58..078053eb 100644 --- a/vmc/resource_vmc_cluster.go +++ b/vmc/resource_vmc_cluster.go @@ -56,22 +56,6 @@ func resourceCluster() *schema.Resource { Update: schema.DefaultTimeout(20 * time.Minute), }, Schema: clusterSchema(), - CustomizeDiff: func(c context.Context, d *schema.ResourceDiff, meta interface{}) error { - newInstanceType := d.Get("host_instance_type").(string) - - switch newInstanceType { - case constants.HostInstancetypeI3, constants.HostInstancetypeI3EN, constants.HostInstancetypeI4I: - if d.Get("storage_capacity").(string) != "" { - return fmt.Errorf("storage_capacity is not supported for host_instance_type %q", newInstanceType) - } - case constants.HostInstancetypeR5: - if d.Get("storage_capacity").(string) == "" { - return fmt.Errorf("storage_capacity is required for host_instance_type %q "+ - "Possible values are 15TB, 20TB, 25TB, 30TB, 35TB per host", newInstanceType) - } - } - return nil - }, } } @@ -100,14 +84,7 @@ func clusterSchema() map[string]*schema.Schema { Optional: true, Description: "The instance type for the esx hosts added to this cluster.", ValidateFunc: validation.StringInSlice( - []string{constants.HostInstancetypeI3, constants.HostInstancetypeR5, constants.HostInstancetypeI3EN, constants.HostInstancetypeI4I}, false), - }, - "storage_capacity": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - "15TB", "20TB", "25TB", "30TB", "35TB"}, false), + []string{constants.HostInstancetypeI3, constants.HostInstancetypeI3EN, constants.HostInstancetypeI4I}, false), }, "edrs_policy_type": { Type: schema.TypeString, @@ -449,17 +426,12 @@ func buildClusterConfig(d *schema.ResourceData) (*model.ClusterConfig, error) { // since host_instance_type field is optional in schema return nil, err } - var storageCapacityConverted int64 - storageCapacity := d.Get("storage_capacity").(string) - if len(strings.TrimSpace(storageCapacity)) > 0 { - storageCapacityConverted = ConvertStorageCapacityToInt(storageCapacity) - } + msftLicensingConfig := expandMsftLicenseConfig(d.Get("microsoft_licensing_config").([]interface{})) return &model.ClusterConfig{ NumHosts: numHosts, HostCpuCoresCount: &hostCPUCoresCount, HostInstanceType: &hostInstanceType, - StorageCapacity: &storageCapacityConverted, MsftLicenseConfig: msftLicensingConfig, }, nil } diff --git a/vmc/resource_vmc_cluster_test.go b/vmc/resource_vmc_cluster_test.go index ac41eb94..fe9dbdd9 100644 --- a/vmc/resource_vmc_cluster_test.go +++ b/vmc/resource_vmc_cluster_test.go @@ -332,9 +332,6 @@ func TestBuildClusterConfig(t *testing.T) { {instanceType: constants.HostInstancetypeI4I, expectedHostInstanceType: model.SddcConfig_HOST_INSTANCE_TYPE_I4I_METAL, expectedErr: nil}, - {instanceType: constants.HostInstancetypeR5, - expectedHostInstanceType: model.SddcConfig_HOST_INSTANCE_TYPE_R5_METAL, - expectedErr: nil}, {instanceType: "RandomString", expectedHostInstanceType: "", expectedErr: fmt.Errorf("unknown host instance type: RandomString"), diff --git a/vmc/resource_vmc_sddc.go b/vmc/resource_vmc_sddc.go index 29a16a80..1ba7c3b5 100644 --- a/vmc/resource_vmc_sddc.go +++ b/vmc/resource_vmc_sddc.go @@ -41,21 +41,6 @@ func resourceSddc() *schema.Resource { Delete: schema.DefaultTimeout(180 * time.Minute), }, Schema: sddcSchema(), - CustomizeDiff: func(c context.Context, d *schema.ResourceDiff, meta interface{}) error { - newInstanceType := d.Get("host_instance_type").(string) - switch newInstanceType { - case constants.HostInstancetypeI3, constants.HostInstancetypeI3EN, constants.HostInstancetypeI4I: - if d.Get("storage_capacity").(string) != "" { - return fmt.Errorf("storage_capacity is not supported for host_instance_type %q", newInstanceType) - } - case constants.HostInstancetypeR5: - if d.Get("storage_capacity").(string) == "" { - return fmt.Errorf("storage_capacity is required for host_instance_type %q "+ - "Possible values are 15TB, 20TB, 25TB, 30TB, 35TB per host", newInstanceType) - } - } - return nil - }, } } @@ -63,13 +48,6 @@ func resourceSddc() *schema.Resource { // it's made available for mocking in tests. func sddcSchema() map[string]*schema.Schema { return map[string]*schema.Schema{ - "storage_capacity": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - "15TB", "20TB", "25TB", "30TB", "35TB"}, false), - }, "sddc_name": { Type: schema.TypeString, Required: true, @@ -183,7 +161,7 @@ func sddcSchema() map[string]*schema.Schema { Optional: true, ForceNew: true, ValidateFunc: validation.StringInSlice( - []string{constants.HostInstancetypeI3, constants.HostInstancetypeR5, constants.HostInstancetypeI3EN, constants.HostInstancetypeI4I}, false), + []string{constants.HostInstancetypeI3, constants.HostInstancetypeI3EN, constants.HostInstancetypeI4I}, false), }, "edrs_policy_type": { Type: schema.TypeString, @@ -775,12 +753,6 @@ func updateMsftLicenseConfig(d *schema.ResourceData, m interface{}, msftLicenseC // buildAwsSddcConfig extracts the creation of the model.AwsSddcConfig, so that it's // available for testing func buildAwsSddcConfig(d *schema.ResourceData) (*model.AwsSddcConfig, error) { - var storageCapacityConverted int64 - storageCapacity := d.Get("storage_capacity").(string) - if len(strings.TrimSpace(storageCapacity)) > 0 { - storageCapacityConverted = ConvertStorageCapacityToInt(storageCapacity) - } - sddcName := d.Get("sddc_name").(string) vpcCidr := d.Get("vpc_cidr").(string) numHost := d.Get("num_host").(int) @@ -826,7 +798,6 @@ func buildAwsSddcConfig(d *schema.ResourceData) (*model.AwsSddcConfig, error) { } return &model.AwsSddcConfig{ - StorageCapacity: &storageCapacityConverted, Name: sddcName, VpcCidr: &vpcCidr, NumHosts: int64(numHost), diff --git a/vmc/resource_vmc_sddc_test.go b/vmc/resource_vmc_sddc_test.go index 28e28e76..e8521ca9 100644 --- a/vmc/resource_vmc_sddc_test.go +++ b/vmc/resource_vmc_sddc_test.go @@ -279,12 +279,6 @@ func TestBuildAwsSddcConfigHostInstanceType(t *testing.T) { expected: model.SddcConfig_HOST_INSTANCE_TYPE_I4I_METAL, err: nil, }, - {input: map[string]interface{}{ - "host_instance_type": constants.HostInstancetypeR5, - }, - expected: model.SddcConfig_HOST_INSTANCE_TYPE_R5_METAL, - err: nil, - }, {input: map[string]interface{}{ "host_instance_type": "RandomString", }, diff --git a/vmc/utils.go b/vmc/utils.go index db345afc..d4e1dd42 100644 --- a/vmc/utils.go +++ b/vmc/utils.go @@ -119,8 +119,6 @@ func toHostInstanceType(userPassedHostInstanceType string) (string, error) { return model.SddcConfig_HOST_INSTANCE_TYPE_I3EN_METAL, nil case constants.HostInstancetypeI4I: return model.SddcConfig_HOST_INSTANCE_TYPE_I4I_METAL, nil - case constants.HostInstancetypeR5: - return model.SddcConfig_HOST_INSTANCE_TYPE_R5_METAL, nil default: return "", fmt.Errorf("unknown host instance type: %s", userPassedHostInstanceType) } diff --git a/vmc/utils_test.go b/vmc/utils_test.go index 772b2ce8..a04d0d1b 100644 --- a/vmc/utils_test.go +++ b/vmc/utils_test.go @@ -25,7 +25,6 @@ func TestToHostInstanceType(t *testing.T) { {input: constants.HostInstancetypeI3, want: result{converted: model.SddcConfig_HOST_INSTANCE_TYPE_I3_METAL, err: nil}}, {input: constants.HostInstancetypeI3EN, want: result{converted: model.SddcConfig_HOST_INSTANCE_TYPE_I3EN_METAL, err: nil}}, {input: constants.HostInstancetypeI4I, want: result{converted: model.SddcConfig_HOST_INSTANCE_TYPE_I4I_METAL, err: nil}}, - {input: constants.HostInstancetypeR5, want: result{converted: model.SddcConfig_HOST_INSTANCE_TYPE_R5_METAL, err: nil}}, {input: "RandomString", want: result{converted: "", err: fmt.Errorf("unknown host instance type: RandomString")}}, } diff --git a/website/docs/r/cluster.html.markdown b/website/docs/r/cluster.html.markdown index f070204d..65f23ddf 100644 --- a/website/docs/r/cluster.html.markdown +++ b/website/docs/r/cluster.html.markdown @@ -88,8 +88,6 @@ The following arguments are supported for vmc_cluster resource: * `host_instance_type` - (Optional) The instance type for the esx hosts added to this cluster. Possible values are: I3_METAL, I3EN_METAL, I4I_METAL, and R5_METAL. Default value: I3_METAL. -* `storage_capacity` - (Optional) For EBS-backed instances i.e: for R5_METAL only, the requested storage capacity in GiB. - * `microsoft_licensing_config` - (Optional) Indicates the desired licensing support, if any, of Microsoft software. ## Attributes Reference diff --git a/website/docs/r/sddc.html.markdown b/website/docs/r/sddc.html.markdown index aaf1e9fc..93e99761 100644 --- a/website/docs/r/sddc.html.markdown +++ b/website/docs/r/sddc.html.markdown @@ -172,9 +172,6 @@ The following arguments are supported: * `sddc_name` - (Required) Name of the SDDC. -* `storage_capacity` - (Optional) The storage capacity value to be requested for the SDDC primary cluster. - This variable is only for R5_METAL. Possible values are 15TB, 20TB, 25TB, 30TB, 35TB per host. - * `num_host` - (Required) The number of hosts in the primary Cluster of the SDDC. * `size` - (Optional) The size of the vCenter and NSX appliances. 'large' or 'LARGE' SDDC size corresponds to a large vCenter appliance and large NSX appliance. 'medium' or 'MEDIUM' SDDC size corresponds to medium vCenter appliance and medium NSX appliance. Default : 'medium'.