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

nsx_edge_transport_node deploy failure (root object absent) #1204

Closed
martinrohrbach opened this issue May 3, 2024 · 6 comments · Fixed by #1206
Closed

nsx_edge_transport_node deploy failure (root object absent) #1204

martinrohrbach opened this issue May 3, 2024 · 6 comments · Fixed by #1206
Assignees
Labels
bug Bug

Comments

@martinrohrbach
Copy link
Contributor

martinrohrbach commented May 3, 2024

Describe the bug

Followup on #1186 since the second part of the issue hasn't been fixed yet.

We still have problems creating new edges with our desired configuration. Given the following resource:

resource "nsxt_edge_transport_node" "edge" {
  description  = var.edge.display_name
  display_name = var.edge.display_name

  standard_host_switch {
    host_switch_name = "Overlay"
    ip_assignment {
      static_ip_pool = nsxt_policy_ip_pool.ip_pool_edge.realized_id
    }
    transport_zone_endpoint {
      transport_zone = data.nsxt_policy_transport_zone.policy_overlay_transport_zone.id
    }
    host_switch_profile = [data.nsxt_policy_uplink_host_switch_profile.uplink_host_switch_profile.id]
    pnic {
      device_name = "fp-eth0"
      uplink_name = "uplink"
    }
  }

  standard_host_switch {
    host_switch_name = "VLAN"
    ip_assignment {
      assigned_by_dhcp = true
    }
    transport_zone_endpoint {
      transport_zone = data.nsxt_policy_transport_zone.policy_vlan_transport_zone.id
    }

    host_switch_profile = [data.nsxt_policy_uplink_host_switch_profile.uplink_host_switch_profile.id]
    pnic {
      device_name = "fp-eth1"
      uplink_name = "uplink"
    }
  }

  deployment_config {
    form_factor = var.edge.form_factor
    node_user_settings {
      cli_password  = var.edge.deploy_creds
      root_password = var.edge.deploy_creds
    }
    vm_deployment_config {
      management_network_id = data.vsphere_network.edge_mgmt_network.id
      data_network_ids = [
        data.vsphere_network.edge_geneve_network.id,
        data.vsphere_network.edge_uplink_network.id
      ]
      compute_id = data.vsphere_compute_cluster.edge_compute_cluster.id
      storage_id = data.vsphere_datastore.datastore_edges.id
      vc_id      = data.nsxt_compute_manager.compute_mgr.id
      host_id    = data.vsphere_host.edge_deployment_target_host.id
      management_port_subnet {
        ip_addresses  = [var.edge.mgmt_ip]
        prefix_length = 24
      }
      default_gateway_address = [var.edge.mgmt_default_gateway]
    }
  }

  node_settings {
    hostname             = var.edge.host_name
    allow_ssh_root_login = true
    enable_ssh           = false
    dns_servers          = var.edge.dns_servers
    ntp_servers          = var.edge.ntp_servers
    search_domains       = var.edge.search_domains
    syslog_server {
      name      = var.edge.syslog_server
      log_level = "INFO"
      protocol  = "TCP"
      server    = var.edge.syslog_server
      port      = 514
    }
  }

  depends_on = [
    nsxt_policy_ip_pool_static_subnet.static_subnet_edge,
  ]
}

The edge is deployed, but terraform throws an error at the end and the edge is not persisted in the state:

Error: Provider produced inconsistent result after apply
When applying changes to nsxt_edge_transport_node.edge,
provider "provider[\"registry.terraform.io/vmware/nsxt\"]" produced an
unexpected new value: Root object was present, but now absent.
This is a bug in the provider, which should be reported in the provider's
own issue tracker.

Reproduction steps

  1. Deploy nsx_edge_transport_node with the above config
  2. Observe error(s)

Expected behavior

No errors on deploy.

Additional context

We're testing against NSX-T 4.1.2.3 with the newest provider 3.6.1.

@martinrohrbach martinrohrbach added the bug Bug label May 3, 2024
@annakhm
Copy link
Collaborator

annakhm commented May 3, 2024

Hi @martinrohrbach, does this happen with clean state, or is this a result of apply on state that resulted from previous error (after upgrading the provider)? Thank you

@martinrohrbach
Copy link
Contributor Author

martinrohrbach commented May 3, 2024

@annakhm The repo had a clean apply before without any nsxt_edge_transport_node in the state. I then updated from provider 3.6.0 to to provider 3.6.1, added the nsxt_edge_transport_node and applied it which resulted in the error above. Does that answer the question? Or did I get the question wrong?

If you think this has to do with the previous state, I could test this again with a completely empty state, I'll see if I find some time for this on monday.

@martinrohrbach
Copy link
Contributor Author

@annakhm Update: I just tested this with a blank terraform state, creation of the edge resource only.

Same result, edge is being created just fine, terraform (1.8.2) errors out with the error above, state is empty afterwards.

@annakhm
Copy link
Collaborator

annakhm commented May 6, 2024

Thank you, this helps!

@annakhm annakhm self-assigned this May 10, 2024
@annakhm annakhm linked a pull request May 10, 2024 that will close this issue
@martinrohrbach
Copy link
Contributor Author

@annakhm
I don't think this fix has made to a released version yet, any chance to get an update on when the next release is due?

@annakhm
Copy link
Collaborator

annakhm commented Jul 15, 2024

Hi @martinrohrbach, we expect next release to be before end of July

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

Successfully merging a pull request may close this issue.

2 participants