-
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
ovf_deploy fails in Terraform on Windows 10 #2166
Comments
Hello, sshirata2! 🖐 Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle. If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests. |
@tenthirtyam @vasilsatanasov |
I think this should be changed to the following, esp since it's not actually a filepath but rather an inventory path in vSphere. import "path"
// ...
if ovfHelper.Folder != nil && len(ovfHelper.Folder.InventoryPath) > 0 {
searchPath = path.Join(ovfHelper.Folder.InventoryPath, searchPath)
} Assigning to myself. |
Updates `searchPath` to use `path` instead of `filepath` since this is a vSphere inventory path (e.g., `\Datacenter\vm\<vm_name>`), not a directory path. Ref: #2166 Signed-off-by: Ryan Johnson <[email protected]>
This functionality has been released in v2.8.2 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Community Guidelines
Terraform
v1.7.5
Terraform Provider
vsphere v2.7.0 on windows_amd64
VMware vSphere
8.0.2
Description
When executing "ovf_deploy" on "vsphere_virtual_machine" under Windows 10 platform, the following error message appears.
Checking with vSphere Client, OVF has been successfully deployed, but the VM is not powered on.
But, when the same code is executed on the Ubuntu 22.04 platform, no error is output, the OVF is deployed successfully and the VM powers on.
I think perhaps Pull request # 2118 is related to this issue.
When using the filepath library of the go language, /(slash) is used as the directory separator in the Linux platform, but (backslash) is used in the Windows platform.
This appears to be the cause of the "vm not found" returned from the virtualmachine.FromPath function.
When I replaced filepath to path and built, the problem did not occur.
Affected Resources or Data Sources
resource/vsphere_virtual_machine
Terraform Configuration
Debug Output
https://gist.github.com/sshirata2/8ae04479866db6f8363c0d2e02fdddd2
Panic Output
No response
Expected Behavior
Ovf is deployed and the virtual machine is powered on.
Actual Behavior
Error was output and Apply failed.
Steps to Reproduce
terraform apply
Environment Details
Windwos 10 22H2
Screenshots
No response
References
#2118
The text was updated successfully, but these errors were encountered: