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

r/vcf_edge_cluster creation fails when compute_cluster_id is set #245

Open
4 tasks done
pradeep17j opened this issue Oct 14, 2024 · 8 comments
Open
4 tasks done

r/vcf_edge_cluster creation fails when compute_cluster_id is set #245

pradeep17j opened this issue Oct 14, 2024 · 8 comments
Labels
breaking-change Breaking Change bug Bug
Milestone

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.2

Terraform Provider

0.11.0

VMware Cloud Foundation

5.2.1

Description

Edge Cluster creation fails with error

module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Still creating... [1h21m42s elapsed]
module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Creation complete after 1h21m46s [id=af99f426-36f5-4815-88bc-317d08536556]
╷
│ Error: you cannot set compute_cluster_id and compute_cluster_name at the same time
│
│   with module.vcf_edge_cluster.vcf_edge_cluster.cluster_1,
│   on ../../modules/vcf_edge_cluster/vcf_edge_cluster.tf line 18, in resource "vcf_edge_cluster" "cluster_1":
│   18: resource "vcf_edge_cluster" "cluster_1" {
│
╵

Affected Resources or Data Sources

resource\vcf_edge_cluster

Terraform Configuration

Snippet of HCL code is here.
A link to internal repo will be provided through secure channels

module "wld4_vcf_workload_domain" {
  source = "../../modules/vcf_workload_domain"

  # --------------------------------------------------------------- #
  # Fourth JPMC WLD, share NSXT with WLD2
  # --------------------------------------------------------------- #

  domain_suffix        = "vrack.vsphere.local"
  workload_domain_name = "wld4"
  share_nsxt_with_workload_domain = "wld2"
  license_keys         = var.license_keys
  #
  #wld_passwords         = var.wld_passwords
  vcenter_configuration = var.wld4_vcenter_configuration
  nsx_settings          = var.wld2_nsx_settings
  #
  #wld_cluster_settings  = var.wld_cluster_settings
  #network_pool_host_tep = var.network_pool_host_tep
  #wld_hosts             = var.wld_hosts
  wld_hosts = tomap(module.wld4_host_comm.host_id)


  depends_on = [ module.wld2_vcf_workload_domain ]
}


module "clus02_host_comm" {
  source = "../../modules/vcf_host_commission"

  net_pool_id = var.net_pool_id
  comm_hosts = var.clus02_comm_hosts

}



module "wld1_cluster02" {
    source = "../../modules/vcf_cluster_add"


    domain_id = module.wld4_vcf_workload_domain.domain_id
    wld_hosts = tomap(module.clus02_host_comm.host_id)


}


module "vcf_edge_cluster" {
  source = "../../modules/vcf_edge_cluster"

  compute_cluster_id = module.wld1_cluster02.clus_id
  edge_cluster_name = var.edge_cluster_name
  edge_node_fqdn_ip = var.edge_node_fqdn_ip

  #sddc_manager_host = var.sddc_manager_host
  #sddc_manager_username = var.sddc_manager_username
  #sddc_manager_password  = var.sddc_manager_password

  edge_uplink_iface_ips = var.edge_uplink_iface_ips
  edge_tep_vlan = var.edge_tep_vlan
  edge_uplink_vlans = var.edge_uplink_vlans
  edge_bgp_peer_ips = var.edge_bgp_peer_ips

  edge_mgmt_gw = var.edge_mgmt_gw
  edge_tep_ips = var.edge_tep_ips

  edge_tep_gw = var.edge_tep_gw
}

Debug Output

module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Still creating... [1h21m2s elapsed]
module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Still creating... [1h21m12s elapsed]
module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Still creating... [1h21m22s elapsed]
module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Still creating... [1h21m32s elapsed]
module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Still creating... [1h21m42s elapsed]
module.wld3_vcf_workload_domain.vcf_domain.workload_domain: Creation complete after 1h21m46s [id=af99f426-36f5-4815-88bc-317d08536556]
╷
│ Error: you cannot set compute_cluster_id and compute_cluster_name at the same time
│
│   with module.vcf_edge_cluster.vcf_edge_cluster.cluster_1,
│   on ../../modules/vcf_edge_cluster/vcf_edge_cluster.tf line 18, in resource "vcf_edge_cluster" "cluster_1":
│   18: resource "vcf_edge_cluster" "cluster_1" {
│

Panic Output

No response

Expected Behavior

Successful creation of edge cluster

Actual Behavior

Fails to create edge cluster.

In the HCL file only compute_cluster_id is provided.
There is no compute_cluster_name provided.

Steps to Reproduce

terraform apply with full HCL file

Environment Details

No response

Screenshots

No response

References

No response

@pradeep17j pradeep17j added bug Bug needs-triage Needs Triage labels Oct 14, 2024
@github-actions github-actions bot added the pending-review Pending Review label Oct 14, 2024
@tenthirtyam tenthirtyam removed the pending-review Pending Review label Oct 14, 2024
@tenthirtyam tenthirtyam added this to the v0.11.0 milestone Oct 14, 2024
@spacegospod
Copy link
Contributor

I came across this problem recently, it's due to this line and the fact that the cluster name defaults to an empty string. The condition that checks it should not treat an empty string as a valid value.

To unblock yourself @pradeep17j use a cluster name instead of an ID for now.

And even though this problem is not related to the version of VCF you're using, I want to use the opportunity to remind you that we only support VCF up to version 5.1.
We are actively working on moving up to 5.2.X

@spacegospod spacegospod removed the needs-triage Needs Triage label Oct 15, 2024
@spacegospod spacegospod changed the title Edge Cluster creation fails r/vcf_edge_cluster creation fails when compute_cluster_id is set Oct 15, 2024
@tenthirtyam tenthirtyam modified the milestones: v0.11.0, v0.12.0, On Deck Oct 15, 2024
@pradeep17j
Copy link
Author

I came across this problem recently, it's due to this line and the fact that the cluster name defaults to an empty string. The condition that checks it should not treat an empty string as a valid value.

To unblock yourself @pradeep17j use a cluster name instead of an ID for now.

And even though this problem is not related to the version of VCF you're using, I want to use the opportunity to remind you that we only support VCF up to version 5.1. We are actively working on moving up to 5.2.X

@spacegospod ,

I cannot use compute_cluster_name instead of compute_cluster_id.
This looks like regressions from 0.10.0.
I was able to use compute_cluster_id and get the edge created there

  [root@template day2_ops]# terraform plan -var-file=comcast_nimbus_vcf521.tfvar
╷
│ Error: Missing required argument
│
│   on comcast_wld_operations.tf line 70, in module "mgmt_edge_cluster":
│   70: module "mgmt_edge_cluster" {
│
│ The argument "compute_cluster_id" is required, but no definition was found.
╵
╷
│ Error: Unsupported argument
│
│   on comcast_wld_operations.tf line 73, in module "mgmt_edge_cluster":
│   73:   compute_cluster_name = "sddcId-10011"
│
│ An argument named "compute_cluster_name" is not expected here.
╵

@tenthirtyam
Copy link
Collaborator

Please verify that v0.11.0 is in use because "The argument "compute_cluster_id" is required" would only be applicable before v0.11.0.

Perhaps pin the version and test both and let's compare.

@spacegospod
Copy link
Contributor

It is, in fact, a regression that happened when I introduced compute_cluster_name

I sneaked a fix in the API bump before this issue was reported https://github.com/vmware/terraform-provider-vcf/pull/246/files#diff-327c984054af451a57f7ac44d72654961c37d1e0f6273f7619bfe2a56bce752eR172

Using compute_cluster_name is the only workaround until we release 0.12.0

@pradeep17j
Copy link
Author

It is, in fact, a regression that happened when I introduced compute_cluster_name

I sneaked a fix in the API bump before this issue was reported https://github.com/vmware/terraform-provider-vcf/pull/246/files#diff-327c984054af451a57f7ac44d72654961c37d1e0f6273f7619bfe2a56bce752eR172

Using compute_cluster_name is the only workaround until we release 0.12.0

Using compute_cluster_name , I get this error

An argument named "compute_cluster_name" is not expected here.

I guess , the only option now is to have a local provider excluding the regression

@tenthirtyam
Copy link
Collaborator

You can pin the version pulled from the registry, too.

@tenthirtyam tenthirtyam added the breaking-change Breaking Change label Oct 30, 2024
@spacegospod
Copy link
Contributor

It is, in fact, a regression that happened when I introduced compute_cluster_name
I sneaked a fix in the API bump before this issue was reported https://github.com/vmware/terraform-provider-vcf/pull/246/files#diff-327c984054af451a57f7ac44d72654961c37d1e0f6273f7619bfe2a56bce752eR172
Using compute_cluster_name is the only workaround until we release 0.12.0

Using compute_cluster_name , I get this error

An argument named "compute_cluster_name" is not expected here.

I guess , the only option now is to have a local provider excluding the regression

That is alarming, do you mind sharing your configuration?
If there's a problem with this input too we'd better know about it

compute_cluster_name should be accepted for edge nodes
https://github.com/vmware/terraform-provider-vcf/blob/main/internal/nsx_edge_cluster/edge_node_subresource.go#L25

@pradeep17j
Copy link
Author

It is, in fact, a regression that happened when I introduced compute_cluster_name
I sneaked a fix in the API bump before this issue was reported https://github.com/vmware/terraform-provider-vcf/pull/246/files#diff-327c984054af451a57f7ac44d72654961c37d1e0f6273f7619bfe2a56bce752eR172
Using compute_cluster_name is the only workaround until we release 0.12.0

Using compute_cluster_name , I get this error

An argument named "compute_cluster_name" is not expected here.

I guess , the only option now is to have a local provider excluding the regression

That is alarming, do you mind sharing your configuration? If there's a problem with this input too we'd better know about it

compute_cluster_name should be accepted for edge nodes https://github.com/vmware/terraform-provider-vcf/blob/main/internal/nsx_edge_cluster/edge_node_subresource.go#L25

@spacegospod ,
Will share the code base on secure channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Breaking Change bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants