network_interface {
ipv4_address = "${var.ipv4_address}"
ipv4_netmask = "${var.ipv4_prefix_length}"
}
ipv4_gateway = "${var.ipv4_gateway}"
}
}
connection {
user = "${var.user_login}" # how terraform SSHs into the vm for remote-exec
password = "ubuntu"
}
provisioner "remote-exec" {
inline = ["echo 'running bootstrap'"]
}
}
--------- creation logs..
vsphere_virtual_machine.vm: Creating...
boot_retry_delay: "" => "10000"
change_version: "" => "<computed>"
clone.#: "" => "1"
clone.0.customize.#: "" => "1"
clone.0.customize.0.ipv4_gateway: "" => "10.98.10.1"
clone.0.customize.0.linux_options.#: "" => "1"
clone.0.customize.0.linux_options.0.domain: "" => "
foo.net"
clone.0.customize.0.linux_options.0.host_name: "" => "sb-test"
clone.0.customize.0.linux_options.0.hw_clock_utc: "" => "true"
clone.0.customize.0.network_interface.#: "" => "1"
clone.0.customize.0.network_interface.0.ipv4_address: "" => "10.98.10.12"
clone.0.customize.0.network_interface.0.ipv4_netmask: "" => "24"
clone.0.customize.0.timeout: "" => "10"
clone.0.template_uuid: "" => "4209072e-4e67-0fe9-e6fe-bb42df581931"
clone.0.timeout: "" => "30"
cpu_limit: "" => "-1"
cpu_share_count: "" => "<computed>"
cpu_share_level: "" => "normal"
datastore_id: "" => "datastore-1697"
default_ip_address: "" => "<computed>"
disk.#: "" => "1"
disk.0.attach: "" => "false"
disk.0.device_address: "" => "<computed>"
disk.0.disk_mode: "" => "persistent"
disk.0.disk_sharing: "" => "sharingNone"
disk.0.eagerly_scrub: "" => "false"
disk.0.io_limit: "" => "-1"
disk.0.io_reservation: "" => "0"
disk.0.io_share_count: "" => "0"
disk.0.io_share_level: "" => "normal"
disk.0.keep_on_remove: "" => "false"
disk.0.key: "" => "0"
disk.0.name: "" => "sb-test.vmdk"
disk.0.size: "" => "16"
disk.0.thin_provisioned: "" => "false"
disk.0.unit_number: "" => "0"
disk.0.write_through: "" => "false"
ept_rvi_mode: "" => "automatic"
firmware: "" => "bios"
folder: "" => "terraform"
force_power_off: "" => "true"
guest_id: "" => "ubuntu64Guest"
guest_ip_addresses.#: "" => "<computed>"
host_system_id: "" => "<computed>"
hv_mode: "" => "hvAuto"
imported: "" => "<computed>"
memory: "" => "1024"
memory_limit: "" => "-1"
memory_share_count: "" => "<computed>"
memory_share_level: "" => "normal"
migrate_wait_timeout: "" => "30"
name: "" => "sb-test"
network_interface.#: "" => "1"
network_interface.0.adapter_type: "" => "e1000"
network_interface.0.bandwidth_limit: "" => "-1"
network_interface.0.bandwidth_reservation: "" => "0"
network_interface.0.bandwidth_share_count: "" => "<computed>"
network_interface.0.bandwidth_share_level: "" => "normal"
network_interface.0.device_address: "" => "<computed>"
network_interface.0.key: "" => "<computed>"
network_interface.0.mac_address: "" => "<computed>"
network_interface.0.network_id: "" => "dvportgroup-1245"
num_cores_per_socket: "" => "1"
num_cpus: "" => "1"
reboot_required: "" => "<computed>"
resource_pool_id: "" => "resgroup-3004"
run_tools_scripts_after_power_on: "" => "true"
run_tools_scripts_after_resume: "" => "true"
run_tools_scripts_before_guest_shutdown: "" => "true"
run_tools_scripts_before_guest_standby: "" => "true"
scsi_controller_count: "" => "1"
scsi_type: "" => "lsilogic"
shutdown_wait_timeout: "" => "3"
swap_placement_policy: "" => "inherit"
uuid: "" => "<computed>"
vmware_tools_status: "" => "<computed>"
vmx_path: "" => "<computed>"
wait_for_guest_net_timeout: "" => "5"
vsphere_virtual_machine.vm: Still creating... (10s elapsed)
....
2018-01-15T13:37:01.881+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:37:01 [DEBUG] Powering on virtual machine "/folder/sb-test"
2018-01-15T13:37:04.068+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:37:04 [DEBUG] vsphere_virtual_machine (ID = 4209e07e-65bd-7539-2417-ff623c9711c0): Waiting for VM customization to complete
2018-01-15T13:37:54.513+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:37:54 [DEBUG] Waiting for routeable address on VM "/folder/sb-test" (timeout = 5m)
...
2018-01-15T13:38:43.937+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:38:43 [DEBUG] Routeable address available for VM "/folder/sb-test"
...
2018-01-15T13:38:44.005+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:38:44 [DEBUG] Reading tags for object "vm-3349"
2018-01-15T13:38:44.342+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:38:44 [DEBUG] Tags for object "vm-3349":
2018-01-15T13:38:44.342+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:38:44 [DEBUG] vsphere_virtual_machine (ID = 4209e07e-65bd-7539-2417-ff623c9711c0): Checking guest networking state
2018-01-15T13:38:44.343+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:38:44 [DEBUG] vsphere_virtual_machine (ID = 4209e07e-65bd-7539-2417-ff623c9711c0): Primary IP address: 10.98.10.12
2018-01-15T13:38:44.343+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:38:44 [DEBUG] vsphere_virtual_machine (ID = 4209e07e-65bd-7539-2417-ff623c9711c0): All IP addresses: 10.98.10.12,fe80::250:56ff:fe89:fe8f
2018-01-15T13:38:44.343+0100 [DEBUG] plugin.terraform-provider-vsphere_v1.2.0_x4: 2018/01/15 13:38:44 [DEBUG] vsphere_virtual_machine (ID = 4209e07e-65bd-7539-2417-ff623c9711c0): Read complete
Error applying plan:
1 error(s) occurred:
* Resource 'vsphere_virtual_machine.vm' does not have attribute 'network_interface.0.ipv4_address' for variable 'vsphere_virtual_machine.vm.network_interface.0.ipv4_address'
It must be an error in my config - maybe someone else can the where the mistake is