hashicorp / packer-plugin-vsphere

Packer plugin for VMware vSphere Builder
https://www.packer.io/docs/builders/vsphere
Mozilla Public License 2.0
97 stars 94 forks source link

`vsphere-clone`: Add support to clone a VM from a template in a content library #43

Open ghost opened 3 years ago

ghost commented 3 years ago

This issue was originally opened by @graham1228 as hashicorp/packer#10318. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

As a user of the vsphere-clone builder I would like the ability to create a vm from an existing vm template in a content library.

Use Case(s)

We use the content library to store our base OS OVF images and need to be able to utilize these templates to layer on solution specific software leveraging the vsphere-clone builder.

Potential configuration

Utilizing the same configuration item, additionally search in all content libraries for the template name

template (string) - Name of source VM. Path is optional.

Potential References

ghost commented 3 years ago

Hi community, Any expected ETA on this item? Would be a great addition to our realm at the moment.

RP-TSB commented 3 years ago

Hello Team, at least an initial response would be nice to know that you are having this issue under your radar. I recently changed our pipeline to import our resulting templates as OVF into the Content Library and realizing it later can't be used for a subsequent stage was highly disappointing. Many thanks in advance.

outhex commented 2 years ago

Hi, any ETA on this?

fbecker commented 2 years ago

Any news on this? We desperately need this feature...

teadur commented 2 years ago

Would be nice addition to my setup aswell. @hmalphettes are you working on it ?

hmalphettes commented 2 years ago

@teadur I am not working on this feature at the moment. I think github picked up a reference to my fork when I ran a rebase. Sorry to leave you hanging here.

teadur commented 2 years ago

@teadur I am not working on this feature at the moment. I think github picked up a reference to my fork when I ran a rebase. Sorry to leave you hanging here.

no worries, I hope you get back to it at one point.

fbecker commented 2 years ago

Just wanted to let you folks know that I'm currently working on this. I have an implementation ready that uses the existing vsphere-clone builder but I'm wondering if it would be more convenient to split this functionality into a new builder, as there are quite a few features (OVF network mappings, OVF properties etc.) that do no apply to regular vm cloning. Also, if there is a need for deploying from local OVF/OVA files, this might be easier to account for.

Any thoughts on this would be greatly appreciated!

freimer commented 2 years ago

We need this also. As far as a new builder, I'm not sure. Documentation on the existing builder says you can include vapp properties, which should cover any properties in the OVF/OVA. Is the implementation you have ready available in a pre-release or branch we can pull and test?

psmola commented 1 year ago

I tested functionality for type vsphere-clone and I tried clone from existing Content library object but I received error: The provided source virtual machine ID vm-9083 is from a virtual machine template, which is not supported.

As I understand - know it's not possible to clone from existing CL template?

tenthirtyam commented 1 year ago

As I understand - know it's not possible to clone from existing CL template?

@psmola - correct, this is tracked as an enhancement per the attached issue labels.

teadur commented 1 year ago

+1 for the new Builder

Just wanted to let you folks know that I'm currently working on this. I have an implementation ready that uses the existing vsphere-clone builder but I'm wondering if it would be more convenient to split this functionality into a new builder, as there are quite a few features (OVF network mappings, OVF properties etc.) that do no apply to regular vm cloning. Also, if there is a need for deploying from local OVF/OVA files, this might be easier to account for.

Any thoughts on this would be greatly appreciated!

@fbecker How are you doing, can we help you with the testing somehow ?

RDG88 commented 1 year ago

Would love this feature!

cybops35 commented 11 months ago

+1 for this feature 🙏

sich97 commented 11 months ago

Just wanted to let you folks know that I'm currently working on this. I have an implementation ready that uses the existing vsphere-clone builder but I'm wondering if it would be more convenient to split this functionality into a new builder, as there are quite a few features (OVF network mappings, OVF properties etc.) that do no apply to regular vm cloning. Also, if there is a need for deploying from local OVF/OVA files, this might be easier to account for.

Any thoughts on this would be greatly appreciated!

@fbecker Hi. Any way I could help out? This feature would be very useful indeed

rnsc commented 1 month ago

If I'm understanding this correctly, until this is implemented, we'd have to create a VM template from template library with a different tool prior to running Packer.

Are there any automation friendly tool that can help with that?

tenthirtyam commented 1 month ago

Are there any automation friendly tool that can help with that?

You could use PowerCLI or GOVC to clone the library items to a template before running a build using the vsphere-clone builder.