Setting 'network_interface.addresses' in 'libvirt_domain' causes terraform to alway detect changes
seumasdunlop opened this issue · comments
Seting network_interface.addresses
always causes terraform to detect that there have been changes in the VM because inevitably the OS sets some IPv6 addresses so there is a difference between the plan and the current state. I've also seen the node local dns address get published back. By removing network_interface.addresses
the terraform plan matches the current state perfectly in my setup which makes reviewing any changes easier.
I don't understand why there is an option in the terraform library to set network_interface.addresses
since the actual IP address is set within the host (e.g. by the netplan config in kubitect). It looks like it inserts it into the ip/dhcp/host section of the libvirt network so is it a way of defining a static reservation in a virtual network (which will be assigned by the built-in DHCP server)??? All my testing has been with static addresses on bridged networks so I'm not familiar with how this works.
I just noticed that there is a remove_dhcp_lease
section of vm.tv
which looks like it removes the dhcp entry that would be added by network_interface.addresses
. I haven't tested this and could be missing something but if it is a static dhcp reservation, is there any advantage in setting it when a static IP is assigned in the OS?