Terraform: vsphere_file - error datacenter '' not found

Created on 6 Oct 2016  ยท  4Comments  ยท  Source: hashicorp/terraform

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

Terraform Version

0.7.4

Affected Resource(s)

vsphere_file

Terraform Configuration Files

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"
}

Debug Output

* vsphere_file.windows-iso: error datacenter '' not found
bug providevsphere

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.

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"
}

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

franklinwise picture franklinwise  ยท  3Comments

ketzacoatl picture ketzacoatl  ยท  3Comments

thebenwaters picture thebenwaters  ยท  3Comments

shanmugakarna picture shanmugakarna  ยท  3Comments

sprokopiak picture sprokopiak  ยท  3Comments