Migrated VM to ProxMox: How To Use New Network Interface?

I have migrated a Home Assistant OS virtual machine from VMware to Proxmox. When I boot the migrated VM, the old network interface name enp2s1 has now changed to enp0s18 and Home Assistant has no network connection.

I have tried setting the new interface name using nmcli but when I run nmcli conn up Supervisor\ enp0s18 i get an error stating no suitable device found for this connection

How can I fix this?

Hi, I have not used this myself, but I recall reading about the CLI.
So if you open the VM console in proxmox, and enter:
ha network --help
and se if there is something usefull

I appreciate the advice but I don’t think that’s going to work, because the underlying Supervisor doesn’t have a network to work with. I need to somehow attach the new interface to the existing network config. I read a bunch and found several examples of using nmcli but none of them really show how to do this.

What i did to solve the ineevitable connection issue after migrating vm:
open console and use

login

to leave homeassistant cli you are root now and can use

nmcli con show

this lists all connections you will find one without a device (the one from the old VM Host) delete it with :

nmcli connection delete CONNECTION_NAME

If CONNECTION_NAME contains a SPACE put it in Quotes like "Supervisor enp6s23"
This however wont make Homesassistant use the remaining one for that you need it to be active for me setting ipv4.method to auto and ipv6.method to disabled did the tirck.
Do

nmcli connection modify CONNECTION_NAME ipv4.method auto
nmcli connection modify CONNECTION_NAME ipv4.method disabled

Check if your changes where successfull

nmcli connection show CONNECTION_NAME