I currently try to setup incus copy between two incus servers using IncusOS. On the source server I create a token with incus config trust add sourcehost and now I want to add that to the target server via incus remote add sourcehost 2001:db8::1.
But here is my problem: as IncusOS has no shell, I need to do all the commands via my Notebook using Incus CLI and switching servers via incus remote switch <server>. But how can I execute the the incus remote add command on the remote IncusOS to add the source servers token to it? In a way “IncusOS source” to “IncusOS remote” trust and not to my Notebook.
The incus remote add commands are obviously not applied to the remote instance, but to my Notebook and thus fail, as my Notebook already has both remotes added. How do I execute the “remote add” commands to the remote IncusOS instance to get trust to my source IncusOS instance and not to my local Notebook?
Remotes are an entirely client side concept, there is no such thing as adding a remote to a server.
You can add your local and any number of remote Incus servers or image servers to your local CLI and then use that for any cross server operation you want.
The switch command lets you switch the default remote you’re working with but all commands also support directly passing in a remote name.
That’s what you do when you do:
incus launch images:debian/13 foo
In this scenario images is the source remote and the target remote is you current default one.
incus copy r1:foo r2:bar
Will instruct the CLI to have foo on remote r1 be moved to r2 as bar. r1 and r2 do not need to have any relationship for that to work, all that’s needed is that your CLI has sufficient access to both.
You are right, I totally misunderstood the concept. I thought the “trust” needs to be between the servers. Thanks for clarification.
Bonus question: If doing it like you described for IncusOS, does the traffic then also flow over my local cli?
Both servers are connected via 10 GbE, but the management CLI is remote via VPN. When doing it via ssh on non IncusOS servers I do the trust and copy directly on the remote and pull the data with full 10 GbE speed. How would I do that with two IncusOS instances? Incus CLI inside a container e.g. on the remote instead by VPN?
That’s controllable. By default the behavior is for the target server to connect directly to the source server (pull mode), but we can flip that around (push mode) or have the CLI act as a relay for when the source and target can’t see each other (relay mode).
You’ll find control over that as --mode on incus copy and incus move.