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

Support creating templates from existing vApps #1215

Merged
merged 11 commits into from
Mar 8, 2024

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Mar 2, 2024

This PR adds support for creating (capturing) vApp templates from existing vApps.
The main functionality is added to resource vcd_catalog_vapp_template via new configuration block capture_vapp. Previously this resource was able to upload a vApp template using ova_path or pass ovf_url and now it has third option capture_vapp.

Additionally a few convenience features were added to better acomodate vApp capturing support:

  • Resources and data sources vcd_vapp_vm/vcd_vm expose computed field vapp_id - this is especially important for Standalone VMs (vcd_vm) as they do have a parent vApp that is hidden. When creating a vApp template from standalone VM, one must supply that parent vApp ID (new vapp_id field), not the VM ID.
  • Resource vcd_catalog_vapp_template exposes additional attribute catalog_item_id for related Catalog Item
    ID. It can be useful if one wishes to overwrite existing template when usingcapture_vapp.0.overwrite_catalog_item_id functionality

Acceptance tests passed on 10.4.0, 10.4.2, 10.5.1

Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
@Didainius Didainius marked this pull request as ready for review March 5, 2024 05:12
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.

Nice!! Few suggestions inline.

website/docs/r/catalog_vapp_template.html.markdown Outdated Show resolved Hide resolved
website/docs/r/catalog_vapp_template.html.markdown Outdated Show resolved Hide resolved
website/docs/r/catalog_vapp_template.html.markdown Outdated Show resolved Hide resolved
website/docs/r/catalog_vapp_template.html.markdown Outdated Show resolved Hide resolved
Copy link
Collaborator

@adambarreiro adambarreiro left a comment

Choose a reason for hiding this comment

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

First scan, need to run the tests

vcd/config.go Show resolved Hide resolved
vcd/resource_vcd_catalog_vapp_template.go Outdated Show resolved Hide resolved
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Copy link
Collaborator

@adambarreiro adambarreiro left a comment

Choose a reason for hiding this comment

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

Finished the review. LGTM! Will approve once my tests run finishes.

vcd/resource_vcd_catalog_vapp_template.go Outdated Show resolved Hide resolved
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Copy link
Collaborator

@adambarreiro adambarreiro left a comment

Choose a reason for hiding this comment

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

Ran vm tag tests with 10.5.1, all OK!

Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
@Didainius Didainius merged commit fb7d5ff into vmware:main Mar 8, 2024
3 checks passed
@Didainius Didainius deleted the pr-capture-template branch March 8, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants