lxc / terraform-provider-incus

Incus provider for Terraform/OpenTofu
https://linuxcontainers.org/incus
Mozilla Public License 2.0
35 stars 8 forks source link

How to define 'volatile.eth0.hwaddr' for an instance? #18

Closed huguenindo closed 6 months ago

huguenindo commented 6 months ago

I migrate my lxd infrastructure to incus. I use terraform to create network, profile and instance. Some instance have a defined MAC address. With lxd provider, I use to configure this MAC address like this:

resource "incus_instance" "machine" {
...
  config =  {
            "volatile.eth0.hwaddr" = "00:16:3e:73:dc:45"
  }
...
}

But with incus provider I get this message: Config key cannot have "volatile." or "image." prefix. Got: "volatile.eth0.hwaddr".

Is some body can tell me how can I define this option? thx

adamcstephens commented 6 months ago

Is there a reason you're not setting hwaddr on the network device for the instance? https://linuxcontainers.org/incus/docs/main/reference/devices_nic/

huguenindo commented 6 months ago

I am never think to setting hwaddr on the network device. I made the change in my module. It works the way I want it to. Thank you!