terra-farm / terraform-provider-virtualbox

VirtualBox provider for Terraform
https://terra-farm.github.io/provider-virtualbox/
MIT License
323 stars 134 forks source link

virtualbox_vm.node: exit status 1 #2

Closed ChristianKniep closed 8 years ago

ChristianKniep commented 8 years ago

Hey there,

I use Terraform v0.6.7 installed via brew and the latest provider on El Capitan. My terraform looks like this:

$ cat virtualbox.tf
resource "virtualbox_vm" "node" {
    count = 1
    name = "${format("node-%02d", count.index+1)}"

    image = "/Users/kniepbert/Downloads/ubuntu-15.04.tar.xz"
    cpus = 1
    memory = "512mib"

    network_adapter {
        type = "nat"
    }

    #network_adapter {
    #    type = "bridged"
    #    host_interface = "en0"
    #}
}

#output "IPAddr" {
#    # Get the IPv4 address of the bridged adapter (the 2nd one) on 'node-02'
#    value = "${element(virtualbox_vm.node.*.network_adapter.1.ipv4_address, 1)}"
#}

I got this error:

$ terraform apply
virtualbox_vm.node: Creating...
  cpus:                                     "" => "1"
  image:                                    "" => "/Users/kniepbert/Downloads/ubuntu-15.04.tar.xz"
  memory:                                   "" => "512mib"
  name:                                     "" => "node-01"
  network_adapter.#:                        "" => "1"
  network_adapter.0.device:                 "" => "IntelPro1000MTServer"
  network_adapter.0.ipv4_address:           "" => "<computed>"
  network_adapter.0.ipv4_address_available: "" => "<computed>"
  network_adapter.0.mac_address:            "" => "<computed>"
  network_adapter.0.status:                 "" => "<computed>"
  network_adapter.0.type:                   "" => "nat"
  status:                                   "" => "running"
Error applying plan:

1 error(s) occurred:

* virtualbox_vm.node: exit status 1

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Any idea?

ccll commented 8 years ago

@ChristianKniep Please run TF_LOG=1 terraform apply to print full error log.

ChristianKniep commented 8 years ago

My VBoxManage seems to lack an option. :/

2015/12/19 11:12:56 [DEBUG] terraform-provider-virtualbox: VBoxManage: error: Unknown option: --synthcpu
2015/12/19 11:12:56 [DEBUG] terraform-provider-virtualbox: pid-17250-resource_vm.go:215: [ERROR] Setup VM properties: exit status 1

I just updated to the latest version:

$ VBoxManage --version
5.0.12r104815
ccll commented 8 years ago

@ChristianKniep A little googling shows that 'synthcpu' option is not available in VBox 5.0 any more, and I was testing on 4.3.x, so this is the problem. github.com/ccll/go-virtualbox is the package to interact with VBox, you can make some quick hack to it, should be easy, and the patch is welcomed. :)