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 fails to create edge with two standard_host_switch entries #1146

Closed
martinrohrbach opened this issue Mar 12, 2024 · 3 comments · Fixed by #1163
Closed
Assignees
Labels
bug Bug

Comments

@martinrohrbach
Copy link
Contributor

Describe the bug

We've eagerly awaited the release of the new provider to test nsx_edge_transport_node to deploy new edges. The challenge for us is that we use two switches per edge and that did not work with the nsx_transport_node resource.

This is what we tested with:

resource "nsxt_edge_transport_node" "test2” {
  description  = "edge-test"
  display_name = "edge-test"

  standard_host_switch {
    host_switch_id = "xxx"
    ip_assignment {
      static_ip_pool = nsxt_policy_ip_pool.ip-pool-for-test-edge.realized_id
    }
    transport_zone_endpoint {
      transport_zone          = "xxx“
      transport_zone_profiles = ["xxx"]
    }
    host_switch_profile = ["xxx"]
    pnic {
      device_name = "fp-eth0"
      uplink_name = "uplink"
    }
  }

  standard_host_switch {
    host_switch_id = "yyy"
    ip_assignment {
      assigned_by_dhcp = true
    }
    transport_zone_endpoint {
      transport_zone          = "yyy“
      transport_zone_profiles = ["yyy“]
    }
    host_switch_profile = ["yyy"]
    pnic {
      device_name = "fp-eth0"
      uplink_name = "uplink"
    }
  }

  deployment_config {
    form_factor = "SMALL"
    node_user_settings {
      cli_password  = "VMware1!VMware1!"
      root_password = "VMware1!VMware1!"
    }
    vm_deployment_config {
        <redacted>
    }
  }
 
  node_settings {
    hostname             = "edge-test"
    allow_ssh_root_login = true
    enable_ssh           = true
  }
}

Note that those two switches have completey different configs, i.e. they are on a different transport zone, have different host_switch_ids and everything.

Deploying the test edge with just either one of the standard_host_switch configs works find and we end up with a new edge and a switch called "nsxDefaultHostSwitch".

However, if we use both standard_host_switch at the same time, we get the following API error:

Failed to create Transport node edge-test: Multiple HostSwitches were found with the same HostSwitch nsxDefaultHostSwitch in TransportNode.

If we do this through the API or in the GUI, we can specify a distinct name for each switch, obviously some default is used here which leads to the clash.

Can you expose a property to actually set a distinct name for each switch (while keeping the default as it is)?

Reproduction steps

  1. Create a nsxt_edge_transport_node with multiple standard_host_switch blocks

Expected behavior

Edge node is created with two switches and no error.

Additional context

No response

@martinrohrbach martinrohrbach added the bug Bug label Mar 12, 2024
@annakhm
Copy link
Collaborator

annakhm commented Mar 14, 2024

Hi @martinrohrbach, thanks for filing this, indeed there is host_switch_name attribute which we didn't expose since its deprecated on nsx.
Can you please provide your nsx version?

@martinrohrbach
Copy link
Contributor Author

Hi @annakhm, good point, I meant to include that info, sorry.

We're testing against NSX 4.1.1.0 in our test environment.

@liftconfig
Copy link

Also facing this issue particularly when deploying v2t edge nodes which require a switch assigned to an overlay TZ, and a second switch assigned to a VLAN TZ. Another concern is IP assignment is always a required field in the host switch block. If the switch is only assigned to a VLAN TZ, there are no IPs required as there aren't any TEPs.

ksamoray added a commit to ksamoray/terraform-provider-nsxt that referenced this issue Mar 25, 2024
NSX requires host_switch_name specification even though this attribute
is marked as deprecated.
Without it, NSX issues an error when using multiple host switches.
As this is an issue even if NSX addresses this later, it's better to add
this attribute to the provider resources.

Fixes: vmware#1146

Signed-off-by: Kobi Samoray <[email protected]>
ksamoray added a commit to ksamoray/terraform-provider-nsxt that referenced this issue Mar 26, 2024
NSX requires host_switch_name specification even though this attribute
is marked as deprecated.
Without it, NSX issues an error when using multiple host switches.
As this is an issue even if NSX addresses this later, it's better to add
this attribute to the provider resources.

Fixes: vmware#1146

Signed-off-by: Kobi Samoray <[email protected]>
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.

4 participants