terraform-provider-virtualbox icon indicating copy to clipboard operation
terraform-provider-virtualbox copied to clipboard

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

Open mohang6770 opened this issue 1 year ago • 14 comments

Terraform Version

<MISSING>

Virtualbox Provider version

<MISSING>

Operating System

<MISSING>

Describe the Bug

<MISSING>

To Reproduce

Steps to reproduce the behavior:

  1. <MISSING>

Expected Behaviour

<MISSING>

Configuration

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.sh")
  
  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)
}

Log Output

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

mohang6770 avatar Aug 29 '22 18:08 mohang6770

snap.

billyjsubs avatar Aug 30 '22 08:08 billyjsubs

Hi @mohang6770, thank you for submitting this issue. I took some liberty in applying the latest issue template to this bug report, I hope you don't mind. Can you please provide some of the missing fields? Thank you.

VoyTechnology avatar Sep 04 '22 22:09 VoyTechnology

I think the issues #138 and #134 report the same problem. Maybe a maintainer could close them as duplicates. I have the same issue using the following configuration:

Terraform version

v1.2.2

Virtualbox provider version

v0.2.2-alpha.1

Operating system

Debian 11

Describe the bug

This is my terraform configuration I'm trying to apply.

terraform {
  required_providers {
    virtualbox = {
      source = "terra-farm/virtualbox"
      version = "0.2.2-alpha.1"
    }
  }
}

# There are currently no configuration options for the provider itself.

resource "virtualbox_vm" "node" {
  count     = 2
  name      = format("node-%02d", count.index + 1)
  image     = "virtualbox_windows-10.box"
  network_adapter {
    type           = "hostonly"
    host_interface = "vboxnet0"
  }
}

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)
}

When I apply the configuration file two virtual machines are created and one of them is running, the other is powered off. Then I run into the following error message:

╷
│ Error: [ERROR] Wait VM until ready: waiting for VM (node-02) to become ready: [ERROR] can't convert vbox network to terraform data: No match with get guestproperty output
│
│   with virtualbox_vm.node[1],
│   on main.tf line 12, in resource "virtualbox_vm" "node":
│   12: resource "virtualbox_vm" "node" {
│
╵
╷
│ Error: [ERROR] Clone *.vdi and *.vmdk to VM folder: exit status 1
│
│   with virtualbox_vm.node[0],
│   on main.tf line 12, in resource "virtualbox_vm" "node":
│   12: resource "virtualbox_vm" "node" {
│
╵

To Reproduce

Just use the provided terraform file with a windows box.

Expected behaviour

I would just expect the build to finish. The network used in the configuration exists.

nikstuckenbrock avatar Oct 24 '22 13:10 nikstuckenbrock

I think I found the bug in the terra-form/go-virtualbox repository and have created a pull request for it. You can find further details on the bug in the PR.

nikstuckenbrock avatar Oct 25 '22 06:10 nikstuckenbrock

Thanks

On Tue, 25 Oct 2022, 07:25 Nik Stuckenbrock, @.***> wrote:

I think I found the bug in the terra-form/go-virtualbox repository and have created a pull request https://github.com/terra-farm/go-virtualbox/pull/43 for it.

— Reply to this email directly, view it on GitHub https://github.com/terra-farm/terraform-provider-virtualbox/issues/149#issuecomment-1290045036, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALUP4V2AZXBCHFJCQTBAYL3WE54NNANCNFSM576YC3WA . You are receiving this because you were mentioned.Message ID: @.*** com>

mohang6770 avatar Oct 25 '22 19:10 mohang6770

Hey @nikstuckenbrock, now that your change is merged, do you want to create another PR to this repository to bump the go-virtualbox dependency version?

VoyTechnology avatar Oct 26 '22 13:10 VoyTechnology

Hey @VoyTechnology, thanks for reaching out. I've provided a new PR #155 to bump the version.

nikstuckenbrock avatar Oct 27 '22 05:10 nikstuckenbrock

Merged. Can you validate that the problem has been fixed? If so, I will tag a new release.

VoyTechnology avatar Oct 27 '22 17:10 VoyTechnology

Hey @VoyTechnology , build proceeds now and resolves in another error. So reading out the guestproperty works now. You could flag a new release or wait until I have investigated the new error message if you want.

Update: It seems like it's not really an error. The time waiting for the VM to become available is set to 30 seconds which seems to be to short for my use case. I would be a nice feature though.

nikstuckenbrock avatar Oct 28 '22 08:10 nikstuckenbrock

Error: [ERROR] Setup VM properties: exit status 1 │ │ with module.kmaster-1.virtualbox_vm.node, │ on .terraform/modules/kmaster-1/main.tf line 10, in resource "virtualbox_vm" "node": │ 10: resource "virtualbox_vm" "node" {

code: terraform { required_providers { virtualbox = { source = "terra-farm/virtualbox" version = "0.2.2-alpha.1" } } }

resource "virtualbox_vm" "node" { name = var.vm_name image = var.image cpus = var.cpu memory = var.memory

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) }

On Fri, Oct 28, 2022 at 9:32 AM Nik Stuckenbrock @.***> wrote:

Hey @VoyTechnology https://github.com/VoyTechnology, build proceeds now and resolves in another error. So reading out the guestproperty works now. You could flag a new release or wait until I have investigated the new error message if you want.

— Reply to this email directly, view it on GitHub https://github.com/terra-farm/terraform-provider-virtualbox/issues/149#issuecomment-1294696352, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALUP4VY7USCT2GE4ZYRSNY3WFOFSZANCNFSM576YC3WA . You are receiving this because you were mentioned.Message ID: @.*** com>

mohang6770 avatar Oct 28 '22 09:10 mohang6770

Hey @mohang6770 , a little bit more communication would be helpful. It looks like you're not using the source version, instead you use the same version as before? Furthermore you're reporting a completely different error message than before. Could you provide more details?

nikstuckenbrock avatar Oct 28 '22 09:10 nikstuckenbrock