This section in documentation seems to be misleading/incomplete. It's actually possible to override the METHOD, GATEWAY, DNS arguments, like so:
NIC = [ DNS = "1.1.1.1", GATEWAY = "10.11.12.13, NETWORK_ID = "0" ]
There is a workaround, the template_section can be used like this:
resource "opennebula_virtual_machine" "vm2" {
name = "vm2"
template_id = opennebula_template.vm.id
template_section {
name = "NIC"
elements = {
NETWORK_ID = data.opennebula_virtual_network.vnets[local.instances.vm.vm2.network].id
GATEWAY = local.instances.vm.vm2.gateway
}
}
}
But it would be great to have those things supported natively (so people could learn about them). We'll review and try to update the OpenNebula documentation as well. :slightly_smiling_face:
New or affected resources and data sources
opennebula_template
opennebula_virtual_machine
Potential terraform configuration
resource "opennebula_virtual_machine" "vm2" {
name = "vm2"
template_id = opennebula_template.vm.id
nic {
network_id = "0"
method = "dhcp"
gateway = "10.11.12.13"
dns = "1.1.1.1"
}
}
Description
This section in documentation seems to be misleading/incomplete. It's actually possible to override the METHOD, GATEWAY, DNS arguments, like so:
There is a workaround, the
template_section
can be used like this:But it would be great to have those things supported natively (so people could learn about them). We'll review and try to update the OpenNebula documentation as well. :slightly_smiling_face:
New or affected resources and data sources
opennebula_template
opennebula_virtual_machine
Potential terraform configuration
References
https://docs.opennebula.io/6.8/management_and_operations/references/template.html