terra-farm/terraform-provider-virtualbox

Can't get VM IP Address NAT

alby97 opened this issue · 1 comments

Hi, I'm trying to deploy my Virtualbox OVA image and actually I did it but my problem is that when Terraform finishes the "apply" didn't give me back the IP Address of the VM. This is my file:

`resource "virtualbox_vm" "node" {
count = 1
name = "VM_1"
image = "/path/to/my/image.ova"
cpus = 1
memory = "512 mib"

network_adapter {
type           = "nat"
host_interface = "vboxnet0"

}
}

output "IPAddr" {
value = element(virtualbox_vm.node.*.network_adapter.0.ipv4_address, 1)
}
`
There is also the log (I put the last lines):

`virtualbox_vm.node[0]: Creation complete after 53s [id=4a3e4fe2-c20e-4d6f-a1a0-fa31188e68d9]
2021/01/18 23:18:21 [TRACE] [walkApply] Exiting eval tree: virtualbox_vm.node[0]
2021/01/18 23:18:21 [TRACE] vertex "virtualbox_vm.node[0]": visit complete
2021/01/18 23:18:21 [TRACE] dag/walk: visiting "provider.virtualbox (close)"
2021/01/18 23:18:21 [TRACE] vertex "provider.virtualbox (close)": starting visit (*terraform.graphNodeCloseProvider)
2021/01/18 23:18:21 [TRACE] vertex "provider.virtualbox (close)": evaluating
2021/01/18 23:18:21 [TRACE] [walkApply] Entering eval tree: provider.virtualbox (close)
2021/01/18 23:18:21 [TRACE] : eval: *terraform.EvalCloseProvider
2021/01/18 23:18:21 [TRACE] GRPCProvider: Close
2021/01/18 23:18:21 [TRACE] dag/walk: visiting "output.IPAddr"
2021/01/18 23:18:21 [TRACE] vertex "output.IPAddr": starting visit (*terraform.NodeApplyableOutput)
2021/01/18 23:18:21 [TRACE] vertex "output.IPAddr": evaluating
2021/01/18 23:18:21 [TRACE] [walkApply] Entering eval tree: output.IPAddr
2021/01/18 23:18:21 [TRACE] : eval: *terraform.EvalSequence
2021/01/18 23:18:21 [TRACE] : eval: *terraform.EvalOpFilter
2021/01/18 23:18:21 [TRACE] : eval: *terraform.EvalWriteOutput
2021/01/18 23:18:21 [TRACE] EvalWriteOutput: Saving value for output.IPAddr in state
2021/01/18 23:18:21 [TRACE] EvalWriteOutput: Saving Create change for output.IPAddr in changeset
2021/01/18 23:18:21 [TRACE] [walkApply] Exiting eval tree: output.IPAddr
2021/01/18 23:18:21 [TRACE] vertex "output.IPAddr": visit complete
2021/01/18 23:18:21 [TRACE] dag/walk: visiting "meta.count-boundary (EachMode fixup)"
2021/01/18 23:18:21 [TRACE] vertex "meta.count-boundary (EachMode fixup)": starting visit (*terraform.NodeCountBoundary)
2021/01/18 23:18:21 [TRACE] vertex "meta.count-boundary (EachMode fixup)": evaluating
2021/01/18 23:18:21 [TRACE] [walkApply] Entering eval tree: meta.count-boundary (EachMode fixup)
2021/01/18 23:18:21 [TRACE] : eval: *terraform.EvalCountFixZeroOneBoundaryGlobal
2021/01/18 23:18:21 [TRACE] [walkApply] Exiting eval tree: meta.count-boundary (EachMode fixup)
2021/01/18 23:18:21 [TRACE] vertex "meta.count-boundary (EachMode fixup)": visit complete
2021-01-18T23:18:21.853+0100 [DEBUG] plugin: plugin process exited: path=/home/username/.terraform.d/plugins/linux_amd64/terraform-provider-virtualbox_v0.2.0 pid=55096
2021-01-18T23:18:21.854+0100 [DEBUG] plugin: plugin exited
2021/01/18 23:18:21 [TRACE] [walkApply] Exiting eval tree: provider.virtualbox (close)
2021/01/18 23:18:21 [TRACE] vertex "provider.virtualbox (close)": visit complete
2021/01/18 23:18:21 [TRACE] dag/walk: visiting "root"
2021/01/18 23:18:21 [TRACE] vertex "root": starting visit (terraform.graphNodeRoot)
2021/01/18 23:18:21 [TRACE] vertex "root": visit complete
2021/01/18 23:18:21 [TRACE] statemgr.Filesystem: have already backed up original terraform.tfstate to terraform.tfstate.backup on a previous write
2021/01/18 23:18:21 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 23
2021/01/18 23:18:21 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
2021/01/18 23:18:21 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2021/01/18 23:18:21 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock

Outputs:

IPAddr =`

Thanks for the attention.

Does someone mantain this repository? No one can reply to me? I don't understand why it didn't give me any output.