OpenNebula / terraform-provider-opennebula

Terraform provider for OpenNebula
https://www.terraform.io/docs/providers/opennebula/
Mozilla Public License 2.0
61 stars 53 forks source link

Impossible to update context of Virtual Router instances #537

Closed sk4zuzu closed 1 month ago

sk4zuzu commented 3 months ago

Description

After Virtual Router's instance(s) are created, any attempt of CONTEXT vector update causes panic.

panic: interface conversion: interface {} is nil, not []interface {}

This is particularly annoying because you can deploy fully working VR, but you can't reconfigure it, at the same time VR supports many features that can be dynamically enabled/disabled and reconfigured.

Terraform and Provider version

Terraform v1.7.5
on linux_amd64
+ provider registry.terraform.io/opennebula/opennebula v1.4.0

Affected resources and data sources

opennebula_virtual_router_instance

Terraform configuration

resource "opennebula_virtual_router_instance" "test" {
  name = "test"
  context = {
    ONEAPP_VNF_DNS_ENABLED = "NO"
  }
  virtual_router_id = opennebula_virtual_router.test.id
}

Expected behavior

When I change ONEAPP_VNF_DNS_ENABLED from "NO" to "YES" and run terraform apply I want the VM re-contexted + no errors.

Actual behavior

panic: interface conversion: interface {} is nil, not []interface {}

Steps to Reproduce

  1. Define the usual opennebula_virtual_router, opennebula_virtual_router_instance_template, and opennebula_virtual_router_instance, then apply.
  2. Change any context variable of the opennebula_virtual_router_instance, then apply.

Debug output

No response

Panic output

No response

Important factoids

The resourceOpennebulaVirtualMachineRead method seems to be throwing errors.

References

No response