LXD copy and ports

Hi,
In my comprehension when we use lxc copy to copy container on remote host, “LXD source server” contact “LXD destination host” (port 8443), then it’s “LXD destination host” which pull the container (on port 8443).

So on “LXD destination host” 8443 port must be open and so on “LXD source host” ?
How to do if I have multiple “LXD source host” behind one single IP ?
I must run LXD API of each “LXD source host” on a different port and create firewall and NAT rules accordingly ?

Thanks

In the default mode, the CLI tool tells the source to prepare for migration, then sends details of the source to destination which then connects to source. In this mode, you need the source server to listen on the network and have its address be reachable by the destination.

You can flip things around with --mode=push which then requires the destination to listen on the network, the client will tell the destination to prepare for receiving the transfer, then send the destination server details to the source which will begin the transfer. The destination server must be reachable by the source.

Lastly, you can use --mode=relay which will have the command line tool itself connect to both source and destination server and will relay the data itself. This will work in every case, but if you’re dealing with two remote servers, the client having to download and push all the data may not be too great.

1 Like

Tanks a lot, mode=push is perfect, I had read copy command help but I didn’t see mode flag :confused:

Sorry