Terraform and OpenNebula, did anyone use the blackberry provider?


#1

Hi there,

I was playing with the opennebula provider created by blackberry:

i managed to clone and create new images but i am having an issue trying to create a new vnet.

this is the error:

* opennebula_vnet.reservation: [VirtualNetworkAllocate] Parse error: syntax error, unexpected VARIABLE, expecting EQUAL or EQUAL_EMPTY at line 3, columns 16:22

I think the syntax is fine:

resource "opennebula_vnet" "create_vnet" {
  name = "vm"
  description = "vm"
  permissions = "600"
  bridge = "br0"
  ip_start = "10.10.10.10"
  ip_size = "${var.vm_count}"
}

Anyone managed to use it properly? Thanks


(Jean-Philippe FOURES) #2

Hello,

I asked the same in another topic about the original provider from Runtastic (https://github.com/runtastic/terraform-provider-opennebula)
During the OpenNebula conf in November in Amsterdam, and more precisely during this presentation: https://www.slideshare.net/opennebula/opennebulaconf2018-hybrid-clouds-dancing-with-automated-virtual-machines-xavier-peralta-csuc
Xavier explained he is using the provider for his deployment.

I want to add that I am working on this provider to use the official Go bindings “Goca”, I will share my work once I have something ready (hopefully in few weeks).

About your issue, it seems the issue is in the “description” part. Actually, the description part is used to provide VM information as an XML Template.
If you remove the description line to test, you might not have error during vnet creation.

Hope this helps


#3

I tried to remove every field including description but i got the same error every time

Thanks


(Jean-Philippe FOURES) #4

Hello,

It seems the type of vnet is missing.

Moreover, the error is returned by opennebula. So it means the XML sent to Opennebula contains a syntax error.
Can you check, via a tcpdump, or any other way to get he XML sent to Opennebula where is the syntax issue ?
It should be easy to detect and to understand where is the issue in the tf file.

Regards

Jean-Philippe


#5

good idea, i will check soon and post it here

thanks!