Closed leodotcloud closed 2 years ago
Closing this issue as the PR has been merged. Fix available in release 0.2.2-alpha.1
.
### Error: [ERROR] Wait VM until ready: waiting for VM (node-01) to become ready: [ERROR] can't convert vbox network to terraform data: No match with get guestproperty output
terraform { required_providers { virtualbox = { source = "terra-farm/virtualbox" version = "0.2.2-alpha.1" } } }
resource "virtualbox_vm" "node" { count = 1 name = format("node-%02d", count.index + 1) image = "https://app.vagrantup.com/ubuntu/boxes/bionic64/versions/20210916.0.0/providers/virtualbox.box" cpus = 1 memory = "1024 mib" user_data = file("${path.module}/user_data")
network_adapter { type = "nat" } network_adapter { type = "bridged" host_interface = "eno1" }
network_adapter { type = "hostonly" host_interface = "vboxnet1" } }
output "IPAddr" { value = element(virtualbox_vm.node.*.network_adapter.0.ipv4_address, 1) }
output "IPAddr_2" { value = element(virtualbox_vm.node.*.network_adapter.0.ipv4_address, 2) }
As I see the latest version 0.2.2-alpha.1
is waiting about 30 seconds for initialization of network interfaces. It should be enough to get VM ready.
It's not mentioned as a requirement but you must have working DHCP in your physical local network or in your VirtualBox environment. And the first thing we need to check is how your VM is getting IP address from it. Does it take more than 30s?
its getting ip address from the router dhcp
is there a way to check the vm completely ready then check or can we have a wait time variable in terraform that we can specify
For some reason, the network adapter in my VM on my machine is taking longer time to start and that's causing failure in
terraform create
.OS Details:
Log:
Code: https://github.com/terra-farm/terraform-provider-virtualbox/blob/v0.2.1-alpha.1/virtualbox/resource_vm.go#L503
Looks like there is only a 3 second hardcoded timeout. Is it possible to make this configurable?