I have a container where i set manually ip address with the following commands:
lxc network attach lxdbr0 vaultwarden eth0 eth0
lxc config device set vaultwarden eth0 ipv4.address 192.168.45.45
Container was exported to a .zst file.
On another server, i did
lxc import and it failed with the following error:
[me@hp]$ lxc import vaultwarden_backup_2022-03-22.zst Error: Failed importing backup: Failed creating instance record: Failed initialising instance: Invalid devices: Device validation failed for "eth0": Device IP address "192.168.45.45" not within network "lxdbr0" subnet
There are two options which are not the best, but possible:
- change the original image, remove eth0 device, rexport the container and then import the new image without fixed ip
- change the network subnet for lxdbr0 on a new server, import container, remove device from the new container, then set the subnet on lxdbr0 to what it needs to be
Is there a way to overcome this problem just by using `lxc import?