Migrate container to another LXD host


(Tom) #1

Hi All,

A simple question about LXD clustering.

Default LXD network is 192.168.1.x:
vlan40@enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 44:8a:52:33:33:0f brd ff:ff:ff:ff:ff:ff
inet 192.168.1.3/24 brd 192.168.100.255 scope global vlan40
valid_lft forever preferred_lft forever
inet6 fe80::468a:5bff:fe5d:cf0f/64 scope link
valid_lft forever preferred_lft forever

Public IP on the same node:
enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 44:83:53:5d:cf:0f brd ff:ff:ff:ff:ff:ff
inet 56.x.x.x/32 scope global enp0s31f6

How can I migrate a container to a public ip (server) from an internal (vlan) network?
Error: Failed container creation: Error transferring container data: Unable to connect to: 192.168.1.3:8443

Remote Server: 46.x.x.x (public ip)
Local server: 192.168.1.3 (private ip for LXD)

LXD is trying to use the internal VLAN (DMZ) to migrate the container to external locations.
How can I solve this and define another adapter for the copy / migration?

lxc copy lxd-local:SourceCT lxd-remote:clone

Thanks!


(St├ęphane Graber) #2

You likely want to use --mode=push in this case so that the private server pushes to the public one rather than having the public server pull from the private one.