I've been trying to deploy RouterOS CHR version 7.5 beta 8 using Terraform, and although the VM deploys, the overall deployment fails due to linux_customization.
To accomplish this, I installed RouterOS on my server as normal, and then simply created a template from the VM.
I then reference the RouterOS template inside the Terraform script.
When the Terraform script is executed, the VM gets deployed and powers on, but the interfaces are in a 'disconnected' state, and Terraform throws the following error:
Code: Select all
Virtual machine customization failed on "/xxx/xxx/xxx/R05A-RTR-Edge":
An error occurred while customizing VM R05A-RTR-Edge. For details reference the log file <No Log> in the guest OS.
The virtual machine has not been deleted to assist with troubleshooting. If
corrective steps are taken without modifying the "customize" block of the
resource configuration, the resource will need to be tainted before trying
again. For more information on how to do this, see the following page:
https://www.terraform.io/docs/commands/taint.html
Code: Select all
resource "vsphere_virtual_machine" "BS-CORE-RTR" {
name = "${var.RGE_PREFIX}-RTR-Edge"
folder = "${vsphere_folder.Networking.path}"
resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
datastore_id = "${data.vsphere_datastore.datastore.id}"
num_cpus = 1
memory = 1024
guest_id = "${data.vsphere_virtual_machine.MikrotikRouter.guest_id}"
scsi_type = "lsilogic"
firmware = "bios"
wait_for_guest_net_timeout = -1
network_interface {
network_id = "${data.vsphere_network.VLAN-3.id}"
adapter_type = "vmxnet3"
}
network_interface {
network_id = "${data.vsphere_network.VLAN-4.id}"
adapter_type = "vmxnet3"
}
disk {
label = "disk0"
size = "${data.vsphere_virtual_machine.MikrotikRouter.disks.0.size}"
eagerly_scrub = "${data.vsphere_virtual_machine.MikrotikRouter.disks.0.eagerly_scrub}"
thin_provisioned = "${data.vsphere_virtual_machine.MikrotikRouter.disks.0.thin_provisioned}"
}
clone {
template_uuid = "${data.vsphere_virtual_machine.MikrotikRouter.id}"
customize {
linux_options {
host_name = "r05a-rtr-edge"
domain = "local.net"
#time_zone = 85
}
network_interface {
ipv4_address = "172.16.1.1"
ipv4_netmask = 24
}
network_interface {
ipv4_address = "172.16.2.1"
ipv4_netmask = 24
}
ipv4_gateway = "172.16.1.1"
dns_server_list = ["16.0.0.21"]
}
}
}
Kelly