Scenario: vsphere post-processor should generate a template
In order to produce a usable artifact
A packer user
wants to generate a vsphere template
Given I have the vsphere post-processor enabled
When and I run packer build
Then I should see and template generated
And I should not see a virtual machine generated
Not to rain on the parade, but you can only generate templates from running VMs in vsphere.
At the very least you'd need to:
Provide a example of doing this with OVF tool, and why it's not possible to achive with options.
I'm currently use the govc cli tools for this in the shell-local post-processor (mark the vm as a template).
For the records I'm also using it to modify the VMX before the conversion as template (for compliance with IT security guys rules). Theses modification must be done on the imported VM before converting it to template. That's why the modification from the PR wouldn't fit my need.
Before sawing this PR, I wanted to try to create a post-processor for this two actions with the options:
vmx_data = Array of string to modify/add value to the VMX (could be empty)
mark_as_template= Boolean
I suppose that would cover most of the needs, the more specifics ones could always be accessible in the same way I currently use(shell-local with govc tool).
For this reason, it must be a different post-processor than the vsphere (that do the ovftool) or, I would prefer, by the addition of a boolean to the vsphere post-processor: import_artifact (that must be true by default for compatibility reasons) to allow several calls of the post-processor without re-importing the VM.
I believe this should have been solved by the introduction of the vsphere-template post-processor, so I am going to close this.
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I believe this should have been solved by the introduction of the vsphere-template post-processor, so I am going to close this.