Closed pradeep17j closed 7 months ago
@pradeep17j is this the value you used when the provider failed?
Can you confirm that "var.wld_cluster_settings["tep_vlan"]" was set? The only way for this bug to occur is for you to have provided an empty string to the geneve_vlan_id input.
Please upload the exact configuration you used to reproduce, variable values inlcuded and then re-open the ticket
@stoyanzhelyazkov ,
To avoid introducing errors in variable referencing , I directly hard coded the value in main.tf as below
geneve_vlan_id = "0"
only change between failure case and working case is the hard coded value that geneve_vlan_id is assigned to as below.
FAILURE CASE : geneve_vlan_id = "0"
SUCCESS_CASE : geneve_vlan_id = "200"
Got it Pradeep, thanks. I am re-openning the issue
@pradeep17j I identified the bug. The problem is caused by incorrect serialization into JSON. I will have to make the fix in the SDK project https://github.com/vmware/vcf-sdk-go/tree/main
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.
Code of Conduct
Terraform
1.7.3
Terraform Provider
1.7.3
VMware Cloud Foundation
0.8.1
Description
geneve_vlan_id is a required arg for workload domain creation.
For use with Nimbus, we need to pass geneve_vlan_id = "0" When "0" is passed, the workload domain spec validation fails because the nextClusterSpec is empty as below
,"nsxClusterSpec":{"nsxTClusterSpec":{}}},
But when the geneve_vlan_id is set to 200, all goes well. It generates proper spec and workload domain creation succeeds
"nsxClusterSpec":{"nsxTClusterSpec":{"geneveVlanId":200}}}
Affected Resources or Data Sources
workload domain create
Terraform Configuration
-----------------------------------------------
SDDC Workload Domain Deployment Module
[] Assumes 'Host Commisioning' is completed
[] Assumes pre-existing Network Pool(s) for vSAN and vMotion
[] Creates Workload Domain, vCenter and NSX instance, Datacenter and Cluster
[] Configures hosts into newly defined cluster and prepares with NSX VIBs
-----------------------------------------------
-----------------------------------------------
VCF Configuration - Workload Domain
-----------------------------------------------
resource "vcf_domain" "workload_domain" { name = "sfo-w01-vc01"
vCenter Settings
vcenter_configuration { name = var.vcenter_configuration["name"] fqdn = var.vcenter_configuration["fqdn"] vm_size = var.vcenter_configuration["vm_size"] storage_size = var.vcenter_configuration["storage_size"] ip_address = var.vcenter_configuration["ip"] subnet_mask = var.vcenter_configuration["subnet_mask"] gateway = var.vcenter_configuration["gateway"] datacenter_name = "${var.workload_domain_name}-dc" root_password = var.wld_passwords["vcenter"] }
NSX Settings
nsx_configuration { form_factor = var.nsx_settings["size"] vip = var.nsx_settings["vip"] vip_fqdn = var.nsx_settings["vip_fqdn"] license_key = var.license_keys["nsx"] nsx_manager_admin_password = var.wld_passwords["nsx_admin"] nsx_manager_audit_password = var.wld_passwords["nsx_audit"]
} cluster { name = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}"
} }
Debug Output
The error will be seen in domainmanager.log
2024-02-22T19:43:25.273+0000 INFO [vcf_dm,65d7a3dc956e4b5bc075a0f229f76e7d,05a6] [c.vmware.vcf.vimanager.utils.DnsUtil,http-nio-127.0.0.1-7200-exec-1] DNS name resolves to IP(s) [wld1-nsxt-vip.vrack.vsphere] 2024-02-22T19:43:25.273+0000 ERROR [vcf_dm,65d7a3dc956e4b5bc075a0f229f76e7d,05a6] [c.v.v.v.c.v1.DomainController,http-nio-127.0.0.1-7200-exec-1] Failed to validate DomainCreationSpec java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "com.vmware.evo.sddc.clustermanager.is.rest.model.spec.NsxTClusterSpec.getGeneveVlanId()" is null at com.vmware.vcf.clustermanager.controller.ClusterAssembler.getGeneveVlanId(ClusterAssembler.java:1167) at com.vmware.vcf.clustermanager.controller.ClusterAssembler.toNsxTClusterSpec(ClusterAssembler.java:1131) at com.vmware.vcf.clustermanager.controller.ClusterAssembler.toClusterSpecBase(ClusterAssembler.java:769) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
Panic Output
No response
Expected Behavior
WLD create should succeed
Actual Behavior
WLD create fails
Steps to Reproduce
create wld with terraform apply
Environment Details
No response
Screenshots
No response
References
No response