Commit c9f413e
Cherry-pick VNA, distributed VxLAN, route controller fixes into branch_3121 (#2168)
* Fix state drift on VNA cluster when advanced_configuration omitted (#2114)
NSX auto-populates advanced_configuration (high_availability_profile,
overlay_transport_zone_path, core_allocation_profile) when the block is
absent from the manifest. The previous schema lacked Computed:true on the
TypeList and on overlay_transport_zone_path, causing Terraform to plan a
perpetual in-place update to remove the server-populated values.
Add Computed:true to the advanced_configuration list block and to
overlay_transport_zone_path so Terraform preserves server-side defaults
without generating a diff on subsequent plans.
Add TestAccResourceNsxtPolicyVirtualNetworkApplianceCluster_noAdvancedConfig
to verify zero drift on re-plan when the block is omitted.
Fixes: https://bugzilla-vcf.lvn.broadcom.net/show_bug.cgi?id=3713480
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit c7d1f42)
* Bug 3713478: move member to data source, drop from resource (#2115)
The member list fields in the VNA cluster OpenAPI spec are all
read-only: NSX populates AppliancePath, ApplianceUniqueId, and
EdgeTransportNodePath only after VNA appliances are physically
deployed. Keeping member as a user-configurable block in the
resource was misleading and caused import drift because NSX never
returns the configured EdgeTransportNodePath in the GET response
until deployment completes.
Changes:
- Remove member block and helpers (setVNAClusterMembersInSchema,
getVNAClusterMembersFromSchema) from the resource; the PATCH body
no longer sends Members.
- Add member (Computed) to the data source so callers can read the
deployed cluster members once NSX populates them.
- Update resource acceptance tests: drop NSXT_TEST_EDGE_TRANSPORT_NODE
pre-check, member blocks from templates, and member state assertions;
import verify no longer needs to ignore member.
- Update data source acceptance test: remove member from resource
template; no longer requires NSXT_TEST_EDGE_TRANSPORT_NODE.
- Add by_id_with_members unit test to the data source mock suite.
- Update docs for both resource and data source accordingly.
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 8d480be)
* Fix VNA credential drift after terraform import (bug 3715433) (#2130)
After 'terraform import' the NSX API does not return passwords, leaving
the credentials block absent from state and causing every subsequent
'terraform plan' to report +credentials drift.
Two provider changes fix this:
1. Importer seeds an empty credentials block before Read is called.
setVNACredentialsInSchema already skips its early return when a block
is present, so it then writes NSX-returned usernames into state.
2. Add suppressIfEmptyPriorState DiffSuppressFunc on cli_password and
root_password. When old=="" (state has no password after import) and
d.Id()!="" (resource already exists), the diff is suppressed so the
subsequent plan shows "No changes." The d.Id()!="" guard ensures
the suppression does not fire during Create or in unit tests.
Testing:
- Add unit tests covering the importer-seeded path and the
DiffSuppressFunc behaviour (TestSuppressIfEmptyPriorState,
Read_with_importer_seeded_block_writes_usernames_to_state).
- Add acceptance test TestAccResourceNsxtPolicyVirtualNetworkAppliance_
importWithCredentials that reproduces the exact FVT failure: create
with credentials → import → assert plan is empty.
- Add withImportIdempotencyChecks helper to utils_test.go (companion to
withIdempotencyChecks) that auto-inserts a PlanOnly step after each
ImportState step; reusable for any resource with write-only fields.
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 7ba0400)
* Fix VNA import panic on nil credentials list element (#2134)
The Terraform Plugin SDK v2 normalises an empty TypeList element set by
the importer to nil on the subsequent d.Get call. setVNACredentialsInSchema
then panicked with an unsafe type-assertion on c[0]. Switch to a
nil-safe assertion and add a unit test that exercises this path directly.
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit ad67355)
* Fix parallel test race in DistributedVlanConnection acceptance tests (#2136)
_basic and _importBasic both resolved display_name from the static
package-level accTestPolicyDistributedVlanConnectionCreateAttributes/
UpdateAttributes maps. Running in parallel, both created an NSX object
with the same display_name; the data source lookup then found two
matches and failed with "Found multiple DistributedVlanConnection".
Give _basic its own createName/updateName local variables and thread
them through testAccNsxtPolicyDistributedVlanConnectionTemplate.
Give _importBasic its own updateName (the existing `name` local) and
thread it through testAccNsxtPolicyDistributedVlanConnectionMinimalistic.
Each test now operates on uniquely-named resources with no shared names.
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit de64f9c)
* fix(nsxt_policy_virtual_network_appliance_cluster): mark appliance_form_factor as Computed (#2154)
The NSX API always returns appliance_form_factor in read responses (defaulting
to "MEDIUM" when not explicitly set). The schema field was Optional-only, so
Terraform perpetually detected drift (MEDIUM -> null) when the field was omitted
from a minimal config.
Add Computed: true, consistent with the other server-defaulted fields in this
resource (appliance_type, service_type, password_managed_by_vcf). Update docs
to reflect (Optional, Computed).
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit ca61c91)
* fix: address route controller interface acc test failures on LM 9.1 (#2147)
Two distinct backend changes broke 7 acceptance tests:
1. NSX now enforces (code 640171) that interface_address subnets must
belong to the same network as floating_ip_subnets. Fix the BGP
neighbor test helper: align both to 192.168.200.0/24, consistent
with the source_addresses used in the BGP neighbor configs.
2. NSX always returns mtu=1500 (default) in read responses. The mtu
schema field was Optional-only, causing a perpetual diff (1500->null)
after every apply. Add Computed:true so Terraform accepts the
API-returned default when the user has not explicitly set the field.
3. nsxt_node_user's password_change_frequency attribute is set by VCF
password policy, beginning v9.2.0
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 624fdf5)
* fix(nsxt_policy_route_controller_bgp_neighbor): mark source_addresses as Required (#2153)
The NSX API enforces source_addresses as a required field on
RouteControllerBgpNeighbor objects (error code 255: required property
missing), but the Terraform schema declared it Optional. This caused
updates to fail at the API layer with no prior Terraform-level validation.
- Change source_addresses from Optional to Required with MinItems: 1
- Update docs to reflect the requirement
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 1f34b57)
* fix(nsxt_policy_route_controller_bgp_neighbor): suppress password drift after import (#2160)
NSX never returns password on GET, so terraform import leaves it
empty in state, causing a spurious diff/re-apply on every plan.
Reuse the suppressIfEmptyPriorState DiffSuppressFunc already used by
nsxt_policy_virtual_network_appliance for the same write-only-field
import issue.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 70b77bd)
* Fix version references in virtual_network_appliance_cluster doc (#2167)
Signed-off-by: Kobi Samoray <kobi.samoray@broadcom.com>
(cherry picked from commit f89e30c)
---------
Signed-off-by: Kobi Samoray <kobi.samoray@broadcom.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 30aee4b commit c9f413e
15 files changed
Lines changed: 297 additions & 243 deletions
File tree
- docs
- data-sources
- resources
- nsxt
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
Lines changed: 4 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 28 | | |
37 | 29 | | |
38 | 30 | | |
| |||
55 | 47 | | |
56 | 48 | | |
57 | 49 | | |
58 | | - | |
| 50 | + | |
59 | 51 | | |
60 | 52 | | |
61 | 53 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 54 | | |
67 | | - | |
| 55 | + | |
68 | 56 | | |
69 | 57 | | |
70 | 58 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
50 | 74 | | |
51 | 75 | | |
52 | 76 | | |
| |||
151 | 175 | | |
152 | 176 | | |
153 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
154 | 194 | | |
155 | 195 | | |
Lines changed: 3 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | | - | |
| 29 | + | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| |||
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | | - | |
| 42 | + | |
45 | 43 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
| |||
57 | 51 | | |
58 | 52 | | |
59 | 53 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 54 | | |
65 | 55 | | |
66 | 56 | | |
| |||
69 | 59 | | |
70 | 60 | | |
71 | 61 | | |
72 | | - | |
| 62 | + | |
73 | 63 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
69 | | - | |
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
| |||
82 | 78 | | |
83 | 79 | | |
84 | 80 | | |
85 | | - | |
86 | 81 | | |
87 | 82 | | |
88 | 83 | | |
| |||
193 | 188 | | |
194 | 189 | | |
195 | 190 | | |
196 | | - | |
197 | 191 | | |
198 | | - | |
| 192 | + | |
199 | 193 | | |
200 | 194 | | |
201 | 195 | | |
| |||
206 | 200 | | |
207 | 201 | | |
208 | 202 | | |
209 | | - | |
210 | 203 | | |
211 | | - | |
| 204 | + | |
212 | 205 | | |
0 commit comments