-
Notifications
You must be signed in to change notification settings - Fork 454
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
Deploying OVF from content library results in HTTP error 500 #1345
Comments
So, after some more digging, we've narrowed down the cause for this problem. terraform-provider-vsphere/vsphere/internal/helper/contentlibrary/content_library_helper.go Lines 553 to 563 in 9d5570c
which the vCenter doesn't appreciate, with the resulting vapi log:
Once we know that, it's easy, just set ovf_mapping on the network_interface block: network_interface {
network_id = data.vsphere_network.network_bkp.id
adapter_type = "vmxnet3"
ovf_mapping = "nic0"
}
network_interface {
network_id = data.vsphere_network.network_adm.id
adapter_type = "vmxnet3"
ovf_mapping = "nic1"
} IMHO, at the very least, that needs to be documented much better. I'd even go as far as setting a default value if ovf_mapping is empty. It's even worse with storage: terraform-provider-vsphere/vsphere/internal/helper/contentlibrary/content_library_helper.go Lines 534 to 551 in 9d5570c
ovf_mapping is used for the key, but there is no such thing : terraform-provider-vsphere/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go Lines 77 to 235 in 9d5570c
How can we proceed? I'm open to writing a PR with the documentation change and sane defaults for network ovf_mapping, but i have no idea about storage mapping. |
I'm running into this same issue. I'm trying to deploy an OVF from a content library and when I have 1 NIC specified it deploys normally. When I add additional NICs it fails with the same 500 error response from vSphere. |
Did you specify We use it with the variable below:
It should work even if you're not using a dynamic for your NIC by just specifying eth0, eth1 anyway. |
Per the VMware vSphere product documentation, which compares the use of VM Templates vs OVF Templates in Content Library:
Reference: The VM Template as a Content Library Item Hardware guest customization for OVF templates would need to be supported in vSphere to enable this capability. Regards, Similar to #1441 cc @appilon and @iBrandyJackson for review and closure. |
Closing as per @tenthirtyam recommendation |
@appilon @tenthirtyam I don't see the link between hardware customisation and the fact that it's pretty non-obvious how to deploy an OVF template because terraform has optional parameters that are in fact required by VMware ( and rather useless i might say). Having that clearer in the docs and/or having defaults on the terraform side would make for an easier UX. |
So i checked the linked issue and it's an unrelated problem :) Manually mapping nics and disks fixes the 500 from this one. @appilon could you please reopen this one? |
I'll re-open and have it close once we at least provide a documentation update |
Setting ovf_mapping for network_interface is not fixing whole issue, as ovf_mapping parameter is set to force new resource creation, so if i need to add another interface after server was created, it just tries to destroy whole resource and recreate vm again |
Terraform Version
0.14.6
vSphere Provider Version
1.24.3
Affected Resource(s)
vsphere_virtual_machine
Terraform Configuration Files
Debug Output
https://gist.github.com/sofixa/4cd7740a8628d5a43ec4db5fb75a5594
Note: this is with a custom build of the provider with extra logs and most notably the deployment spec of the template.
Expected Behavior
The content library OVF template should have been successfully deployed since there's nothing weird or special about it. The exact same template, with almost the same options gets deployed just fine with PowerCLI or govc, so it's something in terraform ( the differences are in the number of network interfaces and disks since we can't tell PowerCLI or govc to make multiple of them). The gist contains the specs generated by govc and terraform.
Actual Behavior
As per usual, a completely useless error from VMware. After going through the logs, there doesn't seem to be anything suspicious.
Steps to Reproduce
Try deploying a content library OVF template??? Not really sure what's causing the issue
How can we proceed about debugging this further? I found this issue in govmomi which seemed like a potential cause, but it was fixed in ~0.23, and when i rebuilt the provider with govmomi v0.24.0 the problem is still there, and govc 0.21 doesn't have any issues, so it's not that.
Community Note
The text was updated successfully, but these errors were encountered: