Open alonkaliber opened 9 months ago
Hello, alonkaliber! 🖐
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.
I am getting this same issue or very similar.
I am trying to clone from a library item also.
data "vsphere_content_library" "library" {
name = "mylibary"
data "vsphere_content_library_item" "item" {
name = "template_name"
type = "vm_template"
library_id = data.vpshere_content_library.library.id
}
data "vsphere_virtual_machine" "template_machine" {
uuid = data.vsphere_content_library_item.item.id # Terraform complains of this UUID
}
# later in resource_virtual_machine:
clone {
template_uuid = data.vsphere_virtual_machine.template_machine.id
}
this brings the correct UUID from the template, still terraform complains UUID not found, but when visiting this item in the library in the VCENTER Website the UUID referred for each item in the library goes by this format:
UUID_from_template:UUID_from_vcenter
So perhaps this is the issue here? Falling sort for the correct UUID or how it has to be referred?
Question: If you separate this into different plans for the sake of testing to remove the depends / potential race condition, does the issue still persist?
For example, you could use this sample to test this scenario.
Community Guidelines
Terraform
v1.6.6
Terraform Provider
v1.6.6
VMware vSphere
v2.6.1
Description
Hey when trying to clone a VM from content_library_item which is an OVA it works, but when trying to customize, i get this error suddenly
This is my code
only when i try to customize i get that error, why does that happen ?
Affected Resources or Data Sources
resource/vsphere_virtual_machine
Terraform Configuration
Debug Output
https://gist.github.com/alonkaliber/43eb78e64bc11ae39dd752d93a2f7d8a
Panic Output
No response
Expected Behavior
Expect terraformto have the ability to customize the vm's
Actual Behavior
Got these errors Error: cannot locate virtual machine or template with UUID "": virtual machine with UUID "" not found │ │ with vsphere_virtual_machine.be_win_vms[2], │ on vSphere.tf line 136, in resource "vsphere_virtual_machine" "be_win_vms": │ 136: resource "vsphere_virtual_machine" "be_win_vms" { │ ╵ ╷ │ Error: cannot locate virtual machine or template with UUID "": virtual machine with UUID "" not found │ │ with vsphere_virtual_machine.be_win_vms[0], │ on vSphere.tf line 136, in resource "vsphere_virtual_machine" "be_win_vms": │ 136: resource "vsphere_virtual_machine" "be_win_vms" { │ ╵ ╷ │ Error: cannot locate virtual machine or template with UUID "": virtual machine with UUID "" not found │ │ with vsphere_virtual_machine.be_win_vms[1], │ on vSphere.tf line 136, in resource "vsphere_virtual_machine" "be_win_vms": │ 136: resource "vsphere_virtual_machine" "be_win_vms" {
Steps to Reproduce
Add an OVA to content library, try to clone a VM from with it windows_options included
Environment Details
No response
Screenshots
No response
References
No response