Local container copy with same MAC address causes validation error on start of one

I like copy --refresh since you can use it for smart and fast standby repliacation. If a node or a storage fails you could just start the copy having the exact same instance config which makes sure you also get the same IP.

Now I try to make local copies from running containers on a separat storage. When I try to (re-)start the original container I get:

Error: Failed start validation for device "eth0": MAC address "00:16:3e:37:87:b1" already defined on another NIC
Try `lxc info --show-log dc02` for more info

although the other one is not running.

As a work around I now remove the mac address from the copy afterwards

lxc config unset $c-backup volatile.eth0.hwaddr

Is there a way to disable that kind of mac parsing on container start?
Any other idea how to create exact diff copies on the same host avoding the errors described above?

If you just copy the instance (doesn’t matter if it’s a different storage backend), both reside in the same network which is causing the message you see when trying to start any of those two.

You can declare another profile with an interface in another network that you apply when copying the instance:

lxc copy --refresh {source} {target} -p {non_default_profile}

The profile can look like this: lxc profile show test:

config: {}
description: ""
devices:
  eth0:
    name: eth0
    network: differentNetwork
    type: nic
  root:
    path: /
    pool: default
    type: disk
name: test