Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workload Domain create with geneve_vlan=0 does not work #128

Closed
4 tasks done
pradeep17j opened this issue Feb 22, 2024 · 5 comments · Fixed by #130
Closed
4 tasks done

Workload Domain create with geneve_vlan=0 does not work #128

pradeep17j opened this issue Feb 22, 2024 · 5 comments · Fixed by #130
Assignees
Labels
bug Bug

Comments

@pradeep17j
Copy link

Code of Conduct

  • I have read and agree to the Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

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"]

nsx_manager_node {
  name        = var.nsx_settings["appliance1_name"]
  fqdn        = "${var.nsx_settings["appliance1_name"]}.${var.domain_suffix}"
  ip_address  = var.nsx_settings["appliance1_ip"]
  subnet_mask = var.nsx_settings["subnet_mask"]
  gateway     = var.nsx_settings["gateway"]
}
nsx_manager_node {
  name        = var.nsx_settings["appliance2_name"]
  fqdn        = "${var.nsx_settings["appliance2_name"]}.${var.domain_suffix}"
  ip_address  = var.nsx_settings["appliance2_ip"]
  subnet_mask = var.nsx_settings["subnet_mask"]
  gateway     = var.nsx_settings["gateway"]
}
nsx_manager_node {
  name        = var.nsx_settings["appliance3_name"]
  fqdn        = "${var.nsx_settings["appliance3_name"]}.${var.domain_suffix}"
  ip_address  = var.nsx_settings["appliance3_ip"]
  subnet_mask = var.nsx_settings["subnet_mask"]
  gateway     = var.nsx_settings["gateway"]
}

}
cluster {
name = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}"

vds {
  name           = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}-vds"
  is_used_by_nsx = true
  portgroup {
    name           = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}-mgmt"
    transport_type = "MANAGEMENT"
  }
  portgroup {
    name           = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}-vmotion"
    transport_type = "VMOTION"
  }
  portgroup {
    name           = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}-vsan"
    transport_type = "VSAN"
  }
}

dynamic "host" {
  for_each = var.wld_hosts
  content {
    id          = host.value[0] // update
    license_key = var.license_keys["esxi"]
    vmnic {
      id       = host.value[2] // update
      vds_name = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}-vds"
    }
    vmnic {
      id       = host.value[3] // update
      vds_name = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}-vds"
    }
  }
}

vsan_datastore {
  datastore_name       = "${var.workload_domain_name}-${var.wld_cluster_settings["name"]}-vsan-ds"
  failures_to_tolerate = var.wld_cluster_settings["vsan_ftt"]
  license_key          = var.license_keys["vsan"]
}

#geneve_vlan_id = var.wld_cluster_settings["tep_vlan"]
geneve_vlan_id = "200"

}
}

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

@pradeep17j pradeep17j added bug Bug needs-triage Needs Triage labels Feb 22, 2024
@github-actions github-actions bot added the pending-review Pending Review label Feb 22, 2024
@spacegospod
Copy link
Contributor

@pradeep17j is this the value you used when the provider failed?

#geneve_vlan_id = var.wld_cluster_settings["tep_vlan"]

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

@spacegospod spacegospod removed needs-triage Needs Triage pending-review Pending Review labels Feb 23, 2024
@pradeep17j
Copy link
Author

@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"

@spacegospod
Copy link
Contributor

Got it Pradeep, thanks.
I am re-openning the issue

@spacegospod spacegospod reopened this Feb 26, 2024
@spacegospod spacegospod self-assigned this Feb 26, 2024
@spacegospod
Copy link
Contributor

@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

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants