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

Add VDC group support for NSX-T Edge Gateway #793

Merged
merged 17 commits into from
Mar 21, 2022

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Feb 25, 2022

This PR adds support for VDC Groups to NSX-T Edge Gateway resources and data sources
vcd_nsxt_edgegateway.

VDC Group support requires VCD 10.2+ and API v35.0+.

The main difference is types.OpenAPIEdgeGateway.OrgVdc.ID is deprecated and replaced by types.OpenAPIEdgeGateway.OwnerRef.ID which supports VDC Groups.

Our resource has two new fields owner_id (which supports VDC or VDC Group) and starting_vdc_id. It also deprecates vdc field at resource level as well as provider level.

Note. NSX-T Edge Gateway cannot be created directly in VDC Group (it must at first be created in a VDC which is a member of VDC Group). starting_vdc_id allows to (optionally) specify a VDC, in which the Edge Gateway should be created while the final destination will be what is specified in owner_id. When starting_vdc_id is not specified, but owner_id is a VDC Group - this resource will pick random VDC in the group and then move Edge Gateway to it.

The most ugly part here is backwards compatibility, migration path, and the field pick priority. Such field priority is meant to be set:

  • owner_id (ignores other values)
  • vdc at resource level
  • vdc inherited from provider section

Docs are adjusted accordingly and also all examples with using vdc field are removed.

Additional things:

  • Minimally patched Org Network resources using OpenAPI (full VDC support to come out in other PR to
    split cognitive load). The only change for now is VDC specification field switched from OrgVdc to
    OwnerId. The reason is that API switched to V35.0 and OrgVdc ID cannot be created anymore (API
    returns error)

  • Changed a few MetadataFields from deprecated to new format, because staticcheck complains

Ran tests with tag nsxton 10.2.2.1, 10.3.1

a
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius force-pushed the vdc-grp-pr branch 2 times, most recently from cf7080a to 6136be6 Compare February 25, 2022 07:18
Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius force-pushed the vdc-grp-pr branch 7 times, most recently from 037826a to 68afac1 Compare February 27, 2022 19:45
Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius marked this pull request as ready for review February 27, 2022 20:25
.changes/v3.6.0/793-improvements.md Show resolved Hide resolved
vcd/datasource_vcd_nsxt_edgegateway.go Outdated Show resolved Hide resolved
vcd/datasource_vcd_nsxt_edgegateway.go Outdated Show resolved Hide resolved
website/docs/r/nsxt_edgegateway.html.markdown Show resolved Hide resolved
website/docs/d/nsxt_edgegateway.html.markdown Outdated Show resolved Hide resolved
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
website/docs/d/nsxt_edgegateway.html.markdown Outdated Show resolved Hide resolved
website/docs/r/nsxt_edgegateway.html.markdown Outdated Show resolved Hide resolved
website/docs/r/nsxt_edgegateway.html.markdown Outdated Show resolved Hide resolved
website/docs/r/nsxt_edgegateway.html.markdown Outdated Show resolved Hide resolved
website/docs/r/nsxt_edgegateway.html.markdown Outdated Show resolved Hide resolved
@lvirbalas lvirbalas removed the request for review from vbauzys March 1, 2022 10:41
Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius force-pushed the vdc-grp-pr branch 2 times, most recently from 3eba566 to 1f89e90 Compare March 1, 2022 20:59
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius removed the request for review from dataclouder March 9, 2022 13:09
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all the adjustments. Noticed one more thing, but LGTM otherwise!

website/docs/d/nsxt_edgegateway.html.markdown Show resolved Hide resolved
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
Copy link
Contributor

@vbauzys vbauzys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will test it.

Copy link
Contributor

@vbauzys vbauzys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok in manual testing. LGTM

Copy link
Contributor

@mikeletux mikeletux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested manually and worked as a charm!
Many thanks for the effort to improve this resource and allow vdc groups!

Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants