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

feat: add support for applying existing customization specs #2053

Merged

Conversation

vasilsatanasov
Copy link
Contributor

@vasilsatanasov vasilsatanasov commented Nov 3, 2023

Testing done:

  • make build

  • Verified that the folowing e2e tests pass:

    • TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname
    • TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool
    • TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone
    • TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore
  • Verified that the newly introduced e2e tests pass

Description

  • added vsphere_guest_os_customization data source for existing customization specs
  • added vsphere_guest_os_customization resource for CRUD operations on customization specs
  • added customization_spec attribute to VirtualMachineCloneSchema to enable vsphere_guest_os_customization usage on VM clone
  • virtual machine customization and guest os customization are using the same code for expanding/flattening specs sent to API
  • deleted the file containing the common code regarding guest OS customizations shared between VM and customizations
  • created e2e tests
  • added documentation for d/vsphere_guest_os_customization and r/vsphere_guest_os_customization

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ vasila@vasila2VDJN terraform-provider-vsphere % make testacc TESTARGS='-run="TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname|TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool|TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone|TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore|TestAccDataSourceVSphereGOSC_basic|TestAccResourceVSpherGOSC_windows_basic|TestAccResourceVSpherGOSC_windows_workGroup|TestAccResourceVSpherGOSC_linux|TestAccResourceVSpherGOSC_sysprep"'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run="TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname|TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool|TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone|TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore|TestAccDataSourceVSphereGOSC_basic|TestAccResourceVSpherGOSC_windows_basic|TestAccResourceVSpherGOSC_windows_workGroup|TestAccResourceVSpherGOSC_linux|TestAccResourceVSpherGOSC_sysprep" -timeout 360m
=== RUN   TestAccDataSourceVSphereGOSC_basic
--- PASS: TestAccDataSourceVSphereGOSC_basic (65.78s)
=== RUN   TestAccResourceVSpherGOSC_windows_basic
--- PASS: TestAccResourceVSpherGOSC_windows_basic (64.61s)
=== RUN   TestAccResourceVSpherGOSC_windows_workGroup
--- PASS: TestAccResourceVSpherGOSC_windows_workGroup (65.12s)
=== RUN   TestAccResourceVSpherGOSC_linux
--- PASS: TestAccResourceVSpherGOSC_linux (64.63s)
=== RUN   TestAccResourceVSpherGOSC_sysprep
--- PASS: TestAccResourceVSpherGOSC_sysprep (64.73s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool
--- PASS: TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool (181.88s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore
--- PASS: TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore (568.53s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone
--- PASS: TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone (168.61s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname
--- PASS: TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname (271.17s)
PASS

Release Note

Release note for CHANGELOG:

 - Added `d/vsphere_guest_os_customization` for read support of existing guest OS customizations
 - Added `r/vsphere_guest_os_customization` for CRUD operations over guest OS customizations
 - `customization_spec` attribute added to r/vsphere_virtual_machine clone spec to enable using existing customization specs during VM clone

References

Closes #1604

@vasilsatanasov vasilsatanasov requested a review from a team as a code owner November 3, 2023 11:21
@github-actions github-actions bot added documentation Type: Documentation provider Type: Provider size/xl Relative Sizing: Extra-Large labels Nov 3, 2023
@tenthirtyam tenthirtyam changed the title [fix #1604]Add support for applying existing customization specs to VM feat: add support for applying existing customization specs Nov 3, 2023
@tenthirtyam tenthirtyam added new-data-source Feature: New Data Source new-resource Feature: New Resource labels Nov 3, 2023
@tenthirtyam tenthirtyam added this to the v2.6.0 milestone Nov 3, 2023
@tenthirtyam tenthirtyam modified the milestones: v2.6.0, v2.7.0 Nov 10, 2023
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

  • Added suggestions for error and log messages.
  • Added suggestions for descriptions.
  • Noted a missing description.
  • Noted type is required.

Otherwise, this looks great!!! If you can make these changes I'll test tomorrow.

@vasilsatanasov vasilsatanasov force-pushed the topic/vasilsatanasov/issue-1604 branch 3 times, most recently from 830421a to f57cff9 Compare November 15, 2023 13:49
@tenthirtyam tenthirtyam self-requested a review November 15, 2023 19:31
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

Two open suggestion and merge conflicts need to be resolved.

…pecs to r/virtual_machine

- added `vsphere_guest_os_customization` data source for existing customization specs
- added `vsphere_guest_os_customization` resource for CRUD operations on
  customization specs
- added customization_spec attribute to VirtualMachineCloneSchema to
  enable `vsphere_guest_os_customization` usage on VM clone
- virtual machine customization and guest os customization are using the
  same code for expanding/flattening specs sent to API
- deleted the file containing the common code regarding guest OS
  customizations shared between VM and customizations
- created e2e tests
- added documentation for `d/vsphere_guest_os_customization` and `r/vsphere_guest_os_customization`
- addressed comments

Testing done:
 - `make build`

 - Verified that the folowing e2e tests pass:
   - TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname
   - TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool
   - TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone
   - TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore
 - Verified that the newly introduced e2e tests pass

Signed-off-by: Vasil Atanasov <[email protected]>
@tenthirtyam tenthirtyam force-pushed the topic/vasilsatanasov/issue-1604 branch from f57cff9 to a92a5b5 Compare November 16, 2023 03:01
@tenthirtyam
Copy link
Collaborator

Two open suggestion and merge conflicts need to be resolved.

I've rebased and resolved the conflicts.

Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Wonderful work, Vasil!

@tenthirtyam tenthirtyam force-pushed the topic/vasilsatanasov/issue-1604 branch from 3227efa to b0ed0b7 Compare November 16, 2023 15:42
@tenthirtyam tenthirtyam modified the milestones: v2.6.0, v2.7.0 Nov 16, 2023
@tenthirtyam tenthirtyam force-pushed the topic/vasilsatanasov/issue-1604 branch from b0ed0b7 to 5e215a5 Compare November 16, 2023 16:46
…pecs to r/virtual_machine

- added `vsphere_guest_os_customization` data source for existing customization specs
- added `vsphere_guest_os_customization` resource for CRUD operations on
  customization specs
- added customization_spec attribute to VirtualMachineCloneSchema to
  enable `vsphere_guest_os_customization` usage on VM clone
- virtual machine customization and guest os customization are using the
  same code for expanding/flattening specs sent to API
- deleted the file containing the common code regarding guest OS
  customizations shared between VM and customizations
- created e2e tests
- added documentation for `d/vsphere_guest_os_customization` and `r/vsphere_guest_os_customization`
- addressed comments

Testing done:
 - `make build`

 - Verified that the folowing e2e tests pass:
   - TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname
   - TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool
   - TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone
   - TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore
 - Verified that the newly introduced e2e tests pass

Signed-off-by: Vasil Atanasov <[email protected]>
@tenthirtyam tenthirtyam force-pushed the topic/vasilsatanasov/issue-1604 branch from 5e215a5 to 903db0a Compare November 17, 2023 20:46
@tenthirtyam tenthirtyam modified the milestones: v2.7.0, v2.6.0 Nov 17, 2023
@tenthirtyam tenthirtyam merged commit 97f3d80 into hashicorp:main Nov 17, 2023
5 checks passed
Copy link

This functionality has been released in v2.6.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

1 similar comment
Copy link

This functionality has been released in v2.6.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Type: Documentation new-data-source Feature: New Data Source new-resource Feature: New Resource provider Type: Provider size/xl Relative Sizing: Extra-Large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for applying existing customization specs to r/virtual_machine
3 participants