I have a base template that is created with packer in vsphere. Terraform clones this template vm, however the resulting VM has two network interfaces, I suspect this is due to the MAC address changing. This can cause issues and I have to manually log into the server to delete the second interface.
I would like for terraform to allow me to set the interface name, for example ‘ens192’ and then if there is an existing ens192 interface, it can be updated instead of duplicated.
I actually expected it to just work. I thought that terraform would be smart enough to know that it could reuse the existing interface configuration without any change to the configuration.
It looks something like this every time I create a VM from the template using terraform:
nmcli conn show
NAME UUID TYPE DEVICE
ens192 03da7500-2101-c722-2438-d0d006c28c73 ethernet ens192
lo 11868def-50eb-434b-ba41-052660e0c0e7 loopback lo
ens192 9c2aea27-b499-45f8-8c44-20bf9a6f6e01 ethernet --
The second ens192 shown above is the one that existed in the packer template.
Any ideas?