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

Segment with "None" QoS Profile #1136

Closed
adarobin opened this issue Feb 29, 2024 · 0 comments · Fixed by #1139
Closed

Segment with "None" QoS Profile #1136

adarobin opened this issue Feb 29, 2024 · 0 comments · Fixed by #1139
Assignees
Labels
bug Bug

Comments

@adarobin
Copy link

Describe the bug

It appears that the provider does not work correctly with segments that have the QoS profile set to what is called "None" in the GUI along with other segment profile types. This results in a change being shown for a segment when there should not be.

For example, a segment configured like this:

resource "nsxt_policy_segment" "test" {
  display_name        = "test"
  transport_zone_path = data.nsxt_policy_transport_zone.overlay.path
  connectivity_path   = data.nsxt_policy_tier1_gateway.tier1_gw.path

  subnet {
    cidr = "10.10.10.0/24"
  }

  discovery_profile {
    ip_discovery_profile_path  = data.nsxt_policy_ip_discovery_profile.default_vlan_ip_discovery_profile.path
    mac_discovery_profile_path = data.nsxt_policy_mac_discovery_profile.default_mac_discovery_profile.path
  }

  security_profile {
    security_profile_path   = nsxt_policy_segment_security_profile.segment_security_allow_dhcp.path
    spoofguard_profile_path = data.nsxt_policy_spoofguard_profile.default_spoofguard_profile.path
  }
}

Results in a plan showing this:

      - qos_profile {
          
-
 binding_map_path = "/infra/segments/31168961-a467-40b7-ba5c-c911a4970f25/segment-qos-profile-binding-maps/26cff0a8-ddd4-4944-8d79-f905e96030e6" 
-> null
          - revision         = 0 -> null
        }

Poking around with the API a bit, it appears that qos_profile_path is set to "". If I attempt to add a block like this to the segment, terraform throws an error for "Invalid policy path" before the plan runs:

qos_profile {
  qos_profile_path = ""
}

Reproduction steps

  1. Create a segment with a custom security profile and the QoS profile set to "None" manually in the GUI.
  2. Import the segment to Terraform and run a plan.
  3. The plan output will show that terraform wants to make a change to the network's qos_profile
    ...

Expected behavior

Terraform allows the qos_profile_path on the segment to be set to "" or handles the qos_block missing differently.

Additional context

No response

@adarobin adarobin added the bug Bug label Feb 29, 2024
@annakhm annakhm linked a pull request Mar 6, 2024 that will close this issue
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