Hi,
I try to move a container from one pool to another pool.
lxc move container-guacamole container-guacamole-temp -s=secondpool
Error: Migration operation failure: Failed creating instance record: Failed initialising instance: Failed to add device “eth0”: MAC address “00:16:3e:a2:c7:f2” already defined on another NIC
Has anyone an idea how to handle this issue?
Best regards,
Olli
stgraber
(Stéphane Graber)
August 3, 2021, 9:10pm
2
Hmm, what LXD version is that?
I thought cross-pool moves were done server-side these days, if that’s the case, then we absolutely should bypass this check.
@tomp
Hi,
I have installed LXD version 4.16
BR
tomp
(Thomas Parrott)
August 4, 2021, 1:07pm
5
This should fix the issue:
lxc:master
← tomponline:tp-instance-storage-pool-move-checks
opened 09:21AM - 04 Aug 21 UTC
Fixes https://discuss.linuxcontainers.org/t/move-migration-operation-failure/117… 81
- Populates instance `volatile.uuid` config key on creation (so it always exists).
- Uses a consistent temporary instance name (derived from the source instance's `volatile.uuid` config key) when creating a temporary copy of an instance during a migration or storage pool move (before the original is removed and the copy rename to the original name).
- Adds a helper function for use when validating if a resource belongs to the same logical instance (either the original instance or the temporary copy of the original instance).
- Update tests to check for this scenario.
We probably should add a check for `volatile.uuid` being unique in the future, which would then break this fix, however having the `IsSameLocgicalInstance` function means we only need to update the logic in there (however we decide to detect that the copied instance is in fact the same as the source for resource validation purposes).
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>