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 VM Group and Logical VM Group support to facilitate VM Placement Policy creation; Update Compute Policies to v2.0.0 #504

Merged
merged 52 commits into from
Sep 23, 2022

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Aug 30, 2022

This PR builds on top of #502.

Description

Same as #502, this PR aims to serve as the foundation for vmware/terraform-provider-vcd#904.
This PR contains the required changes to be able to create the vcd_vm_placement_policy resource to be able to test it.

As vcd_vm_placement_policy requires to handle VM Groups and Logical VM Groups in VCD, there are additions of some functions for that purpose.

It also updates Compute Policies OpenAPI support from v1.0.0 to v2.0.0, marking v1.0.0 as deprecated and leaving it untouched, while creating a new set of functions for the new version to avoid breaking compatibility. This change was done to support more filtering options of the v2.0.0 endpoint and prepare for the future.

Other changes

  • Description field in VdcComputePolicy is now a pointer and is not omitted when empty. This is because we need to send an explicit nil/null value to the VCD API to be able to declare empty descriptions. Otherwise, if the parameter is omitted, VCD puts a default description.

Testing

Tests require a new field in govcd_test_config.yaml:

vcd:
    ...
    nsxt_provider_vdc:
      ...
      placementPolicyVmGroup: testVmGroup

abarreiro added 18 commits August 25, 2022 12:13
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
fmt
Signed-off-by: abarreiro <abarreiro@vmware.com>
Fix
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
…ctor into add-placement-policy-support

Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
abarreiro added 2 commits August 30, 2022 16:15
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
…ctor into extend-placement-policy-support

Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro self-assigned this Aug 31, 2022
abarreiro added 2 commits September 1, 2022 09:57
…ctor into extend-placement-policy-support

Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro changed the title Extend placement policy support Add VM Group and Logical VM Group support to facilitate VM Placement Policy creation Sep 1, 2022
@adambarreiro adambarreiro marked this pull request as ready for review September 1, 2022 08:02
@adambarreiro adambarreiro changed the title Add VM Group and Logical VM Group support to facilitate VM Placement Policy creation Add VM Group and Logical VM Group support to facilitate VM Placement Policy creation; Update Compute Policies to v2.0.0 Sep 5, 2022
govcd/vdccomputepolicy_v2.go Show resolved Hide resolved
govcd/vdccomputepolicy_v2.go Outdated Show resolved Hide resolved
govcd/vdccomputepolicy_v2.go Outdated Show resolved Hide resolved
govcd/vdccomputepolicy_v2_test.go Outdated Show resolved Hide resolved
abarreiro added 2 commits September 5, 2022 16:39
fmt
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

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

Thanks - a few comments need addressing but approving ahead.

govcd/vm_groups.go Show resolved Hide resolved
types/v56/openapi.go Outdated Show resolved Hide resolved
govcd/vm_groups.go Outdated Show resolved Hide resolved
abarreiro added 2 commits September 6, 2022 10:15
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro marked this pull request as ready for review September 6, 2022 08:16
abarreiro added 4 commits September 6, 2022 12:16
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
fmt
Signed-off-by: abarreiro <abarreiro@vmware.com>
abarreiro added 3 commits September 8, 2022 09:58
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

First pass. A few suggestions, in addition to the test result review

govcd/openapi_endpoints.go Outdated Show resolved Hide resolved
govcd/vdccomputepolicy_v2.go Show resolved Hide resolved
govcd/vdccomputepolicy_v2_test.go Show resolved Hide resolved
govcd/vdccomputepolicy_v2_test.go Outdated Show resolved Hide resolved
abarreiro added 4 commits September 12, 2022 09:35
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
abarreiro added 2 commits September 21, 2022 14:38
…ctor into extend-placement-policy-support

Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
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.

5 participants