Terraform v0.13.3
VMware ESXi, 6.5.0, 9298722
##### Provider
provider "vsphere" {
user = var.provider_vsphere_user
password = var.provider_vsphere_password
vsphere_server = var.provider_vsphere_host
# if you have a self-signed cert
allow_unverified_ssl = true
}
##### Data sources
data "vsphere_datacenter" "target_dc" {
name = var.deploy_vsphere_datacenter
}
data "vsphere_datastore" "target_datastore" {
name = var.deploy_vsphere_datastore
datacenter_id = data.vsphere_datacenter.target_dc.id
}
data "vsphere_compute_cluster" "target_cluster" {
name = var.deploy_vsphere_cluster
datacenter_id = data.vsphere_datacenter.target_dc.id
}
data "vsphere_network" "target_network" {
name = var.deploy_vsphere_network
datacenter_id = data.vsphere_datacenter.target_dc.id
}
#data "vsphere_virtual_machine" "source_template" {
#name = var.guest_template
#datacenter_id = data.vsphere_datacenter.target_dc.id
#}
data "vsphere_content_library" "library" {
name = "RGI_IDCWTO_ContentLibrary"
}
data "vsphere_content_library_item" "item" {
name = "T_Linux_OL_7.8_LVM"
library_id = data.vsphere_content_library.library.id
}
##### Resources
# Clones a single Linux VM from a template
resource "vsphere_virtual_machine" "kubernetes_master" {
name = "dwtox-test01"
resource_pool_id = data.vsphere_compute_cluster.target_cluster.resource_pool_id
datastore_id = data.vsphere_datastore.target_datastore.id
folder = var.deploy_vsphere_folder
num_cpus = var.guest_vcpu
memory = var.guest_memory
network_interface {
network_id = data.vsphere_network.target_network.id
}
disk {
label = "disk1"
size = "24"
}
clone {
template_uuid = data.vsphere_content_library_item.item.id
customize {
linux_options {
host_name = "dwtox-test01"
domain = var.guest_domain
}
network_interface {
ipv4_address = "10.73.28.6"
ipv4_netmask = var.guest_ipv4_netmask
}
ipv4_gateway = var.guest_ipv4_gateway
dns_server_list = [var.guest_dns_servers]
dns_suffix_list = [var.guest_dns_suffix]
}
}
}
see the attachment crash.log
It should create a VM starting from a template present in the content Library
When run terraform apply crash.
I have attached the generated log
Hi @WoodooTek - based on the crash log, the panic is happening in the vsphere provider, not in Terraform core:
2020-09-30T15:50:03.545+0200 [DEBUG] plugin.terraform-provider-vsphere_v1.24.0_x4: panic: interface conversion: interface {} is nil, not string
In that error message, you can see the error is coming from the terraform-provider-vsphere_v1.24.0_x4 binary, which is the vsphere provider. This GitHub repository is for Terraform Core, and you will need to open an issue for this with the vSphere provider at https://github.com/hashicorp/terraform-provider-vsphere/issues instead. I'm going to close this, because this repository is only for issues with Terraform Core itself. Thank you for reporting this, and I hope you bring this to the vSphere provider so they can work on it.
Hi @danieldreier ,
thanks for the quick response. I proceed to open the issue in the correct way.
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.