Hi all,
I am trying to create a VM in vSphere using an existing VM template. The template was created by uploading a VMDK image, creating a VM using the VMDK and then cloning it into a template. This was done manually, as I understand the provider does not (yet) offer this functionality.
The VM is being created and starts, I can watch the console and everything looks good, until it hits the step where the linux_options
are being applied. At this point Terraform errors out and tells me that something has gone wrong.
If I omit the whole customize
block the VM boots up but never gets an IP address via DHCP, no matter what I put into the metadata file.
Any ideas how to debug this further (as I cannot login to the VM)?
Thanks in advance!
Kind Regards,
Johannes
P.S.: Here are the relevant snippets:
clone {
template_uuid = var.vsphere_vm_template_id
customize {
linux_options {
host_name = "my-hostname"
domain = "example.org"
}
network_interface {
# empty, to use DHCP
}
}
}
extra_config = {
"guestinfo.metadata" = var.metadata_base64encoded
"guestinfo.metadata.encoding" = "base64"
"guestinfo.userdata" = var.userdata_base64encoded
"guestinfo.userdata.encoding" = "base64"
}
metadata file for cloud-config:
instance-id: cloud-vm
network:
version: 2
ethernets:
nics:
match:
name: e*
dhcp4: true