Closed TGM closed 1 year ago
Thanks for reporting this
I'm able to reproduce a problem.
It seems I'm able to reproduce a problem with template_section
.
I added this to the VM description:
template_section {
name= "RAW"
elements = {
"data" = "<memtune><hard_limit unit='MB'>256</hard_limit></memtune>"
"type" = "kvm"
}
}
At creation the section RAW
is applied, but then the provider is not able to read this section (so it see it as not applied) and the provider shows a diff.
In fact template_section
works depending on the name
you define. If it's an OpenNebula specific key (like RAW
), OpenNebula will add the section in the TEMPLATE
. If it's a custom key that OpenNebula doesn't know, it will add the section to the USER_TEMPLATE
section of the VM.
The problem is: the reading code of template_section
only read sections from USER_TEMPLATE
, and ignore section added in TEMPLATE
.
There is several ways to fix this, for instance we could add an issue to add a configurable raw
section, I'll provide a PR ASAP
I just realized: for now it's possible to define a RAW section via the opennebula_template
ressource then instantiate the template.
It also a little note to myself: there's some existing code if we want to add a raw
section to the opennebula_virtual_machine
resource
Description
template_section does not update after VM creation
Terraform and Provider version
Terraform v1.3.6 Provider v1.2.2 OpenNebula v6.4.0.1
Affected resources and data sources
template_section
Terraform configuration
Expected behavior
Actual behavior
template_section { name = "RAW" elements = { data = "${var.memory 1024 2} "
type = "kvm"
}
}
Steps to Reproduce
Debug output
No response
Panic output
No response
Important factoids
No response
References
No response