You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The import doesn't work if convert_to_template is set to true
Expected Behavior
When convert_to_template is set to true, content_library_destination block should be removed.
Actual Behavior
Packer returns an error when trying to push VM template to content library.
Steps to Reproduce
Set convert_to_template is set to true
Log Fragments and Files
=> vsphere-iso.linux-ubuntu-server: Importing VM template linux-ubuntu-server-20-04-lts1632170716 to Content Library...
==> vsphere-iso.linux-ubuntu-server: Failed to import template linux-ubuntu-server-20-04-lts1632170716: 400 Bad Request: {"type":"com.vmware.vapi.std.errors.invalid_argument","value":{"error_type":"INVALID_ARGUMENT","messages":[{"args":["vm-15548"],"default_message":"The provided source virtual machine ID vm-15548 is from a virtual machine template, which is not supported.","id":"com.vmware.vdcs.vmtx-main.invalid_source_vm_template_not_supported"}]}}
==> vsphere-iso.linux-ubuntu-server: 400 Bad Request: {"type":"com.vmware.vapi.std.errors.invalid_argument","value":{"error_type":"INVALID_ARGUMENT","messages":[{"args":["vm-15548"],"default_message":"The provided source virtual machine ID vm-15548 is from a virtual machine template, which is not supported.","id":"com.vmware.vdcs.vmtx-main.invalid_source_vm_template_not_supported"}]}}
==> vsphere-iso.linux-ubuntu-server: Step "StepImportToContentLibrary" failed
==> vsphere-iso.linux-ubuntu-server: [c] Clean up and exit, [a] abort without cleanup, or [r] retry step (build may fail even if retry succeeds)?
Cancelling build after receiving interrupt
==> vsphere-iso.linux-ubuntu-server: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vsphere-iso.linux-ubuntu-server: Power off VM...
==> vsphere-iso.linux-ubuntu-server: Destroying VM...
==> vsphere-iso.linux-ubuntu-server: Deleting cd_files image from remote datastore ...
Build 'vsphere-iso.linux-ubuntu-server' errored after 10 minutes 35 seconds: 400 Bad Request: {"type":"com.vmware.vapi.std.errors.invalid_argument","value":{"error_type":"INVALID_ARGUMENT","messages":[{"args":["vm-15548"],"default_message":"The provided source virtual machine ID vm-15548 is from a virtual machine template, which is not supported.","id":"com.vmware.vdcs.vmtx-main.invalid_source_vm_template_not_supported"}]}}
Screenshots
No response
Additional Context
I suggest (and I can create PR for) to update code as follow
Set common_content_library_name default to null
Create dynamic block for content_library_destination
@sestegra - yes, that's correct per the Packer docs.
That's a great idea - as it might also allow the image to be pushed to >1 publishing content library but that would require a change to the variable definition.
Please feel free to refactor, test, and submit a PR for enhancement and I'll review it for the next update.
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.
Code of Conduct
VMware vSphere
Any
HashiCorp Packer
1.7.5
HashiCorp Packer Plugin for VMware vSphere
1.0.1
Guest Operating System
macOS Big Sur 11.6 (Intel)
Environment Details
My current Terraform workflow is using VM template stored in VM folder tree.
So, I need to convert to VM without storing it to content library.
Description
In Packer documentation (see https://www.packer.io/docs/builders/vsphere/vsphere-iso#convert_to_template)
Expected Behavior
When
convert_to_template
is set totrue
,content_library_destination
block should be removed.Actual Behavior
Packer returns an error when trying to push VM template to content library.
Steps to Reproduce
Set
convert_to_template
is set totrue
Log Fragments and Files
Screenshots
No response
Additional Context
I suggest (and I can create PR for) to update code as follow
common_content_library_name
default tonull
content_library_destination
The text was updated successfully, but these errors were encountered: