Hi there,
I have a problem with the vsphere_file resource. it would seem that datacenter is not an optional property? or is there a requirement for the ESX server to be joinned to vCenter?
I'm attempting to upload a file to an esx server that is not a member of a vcenter, if that a requirement then fine.
Thanks
Gary
0.7.4
vsphere_file
resource "vsphere_file" "windows-iso" {
datastore = "local"
source_file = "C:/iso/SW_DVD9_Windows_Svr_Std_and_DataCtr_2012_R2_64Bit_English_-4_MLF_X19-82891.ISO"
destination_file = "/iso/SW_DVD9_Windows_Svr_Std_and_DataCtr_2012_R2_64Bit_English_-4_MLF_X19-82891.ISO"
}
* vsphere_file.windows-iso: error datacenter '' not found
I've seen this as well , it seems that datacenter is not optional when copying from the terraform host to vCenter, once I added the datacenter it was being placed it was fixed.
Thanks for confirming. In this case I was just using a standalone esx host.
I've found that on a standalone ESXi host (v6) I can specify datacenter = "ha-datacenter" and it copies the file from the machine running terraform to the ESXi host correctly.
resource "vsphere_file" "vmdk-01" {
datacenter = "ha-datacenter"
datastore = "host-04-lds-01"
create_directories = "true"
source_file = "c:\\temp\\vmx\\vmware-vcsa-disk1.vmdk"
destination_file = "/${var.vm_name}/vmware-disk1.vmdk"
}
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've found that on a standalone ESXi host (v6) I can specify datacenter = "ha-datacenter" and it copies the file from the machine running terraform to the ESXi host correctly.