vmware / terraform-provider-vcf

Terraform Provider for VMware Cloud Foundation
https://registry.terraform.io/providers/vmware/vcf/
Mozilla Public License 2.0
23 stars 10 forks source link

Network pool creation with zero VLAN for VMotion and VSAN pools fails #175

Closed pradeep17j closed 5 months ago

pradeep17j commented 5 months ago

Code of Conduct

Terraform

v1.7.3

Terraform Provider

v0.9.0

VMware Cloud Foundation

5.2

Description

This bug is similar to https://github.com/vmware/terraform-provider-vcf/issues/128.

Creating Network Pools with zero VLAN ID for vMOTION and vSAN is not allowed because the provider passes a NULL value to SDDC Network Pool creation API.

The fix will be same as the fix for https://github.com/vmware/terraform-provider-vcf/issues/128 where in it was not allowing zero vlan for GeneveID during bringup. The fix will be in SDK

Affected Resources or Data Sources

network_pool

Terraform Configuration

resource "vcf_network_pool" "eng_pool" { name = "engineering-pool" network { gateway = "10.0.4.253" mask = "255.255.255.0" mtu = 8940 subnet = "10.0.4.0" type = "VSAN" vlan_id = 0 ip_pools { start = "10.0.4.51" end = "10.0.4.81" } } network { gateway = "10.0.8.253" mask = "255.255.255.0" mtu = 8940 subnet = "10.0.8.0" type = "vMotion" vlan_id = 0 ip_pools { start = "10.0.8.51" end = "10.0.8.81" } } }

Debug Output

2024-05-28T12:12:06.330-0700 [ERROR] provider.terraform-provider-vcf_v0.9.0: Response contains error diagnostic: tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_severity=ERROR tf_resource_type=vcf_network_pool diagnostic_detail="" tf_req_id=fd84f6c2-4b57-ab5e-28c4-b0bfa318a276 @module=sdk.proto diagnostic_summary="[POST /v1/network-pools][400] createNetworkPoolBadRequest &{Arguments:[] Causes:[] Context:map[] ErrorCode:REST_INVALID_API_INPUT ErrorType: Message:Invalid input NestedErrors:[0xc000464e60] ReferenceToken:R345HG RemediationMessage:}" tf_provider_addr=provider tf_proto_version=5.6 timestamp=2024-05-28T12:12:06.330-0700 2024-05-28T12:12:06.331-0700 [ERROR] vertex "vcf_network_pool.eng_pool" error: [POST /v1/network-pools][400] createNetworkPoolBadRequest &{Arguments:[] Causes:[] Context:map[] ErrorCode:REST_INVALID_API_INPUT ErrorType: Message:Invalid input NestedErrors:[0xc000464e60] ReferenceToken:R345HG RemediationMessage:} ā•· ā”‚ Error: [POST /v1/network-pools][400] createNetworkPoolBadRequest &{Arguments:[] Causes:[] Context:map[] ErrorCode:REST_INVALID_API_INPUT ErrorType: Message:Invalid input NestedErrors:[0xc000464e60] ReferenceToken:R345HG RemediationMessage:}

Panic Output

No response

Expected Behavior

Successful network pool creation

Actual Behavior

Network pool creation fails

Steps to Reproduce

Fails to create Network pool

Environment Details

No response

Screenshots

No response

References

No response

spacegospod commented 5 months ago

Thanks @pradeep17j I found one more occurrence of this problem while working on https://github.com/vmware/terraform-provider-vcf/issues/147

I'll update the SDK and make the necessary changes to the provider

github-actions[bot] commented 4 months ago

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.