Change Nic Parent Name


is there a way to change the parent of the containers nic? I moved a container from one host to another with

lxc move …

Both systems use macvlan nics, but the nic name from the source-host is named “ens32” and in the target host the name of the nic is “enp3s0”.

After moving I get an

error: Missing parent ‘ens32’ for nic ‘default’

I think I must change the parent of the containers nic after moving, but I don’t find the right command.

(ubuntu 17.04 with lxd 2.12)



I found the answer:
Edit the config from the container on the new host

lxc config edit

change parent to enp3s0

Then the container starts well.

Wouldn’t it be helpfull if a container move would change these settings automatically after moving?



It would be nice if things would magically happen on move indeed, but it’s also not really doable as machines can have multiple network interfaces and you don’t want to accidentally bind the container to a different, possibly more privileged network interface after moving it.

In general my recommendation for people who need to move containers between hosts is to use bridges rather than macvlan. That way you can keep a consistent naming and configuration on your different hosts and can abstract away hardware differences.