# Adding or moving an inference node

> Add a machine with GPUs to a control plane, or move a machine that already is an inference node to another control plane, step by step, with the one fix for every refusal on the way.

## What this guide covers

Two jobs with one command. **Adding**: a machine with GPUs that never was an inference node joins a control plane. **Moving**: a machine that already is an inference node, of this control plane or of another, joins a different control plane.

The machine is yours in both. It keeps its GPUs, its software and its name; only what it holds for a control plane changes.

## Before you start

- **The join token in the command is valid for 15 minutes.** Copy the command fresh from the page and run it right away. A command that failed needs a fresh one from the same page.
- **You run the command as your own user.** It asks for your `sudo` password once, when it installs.
- **The command checks the control plane's address against the certificate in itself before it changes anything.** A refusal at that point changed nothing.

## Adding an inference node

1. On the control plane, open **Servers**, **Add Inference Node**, and copy the command.
2. On the machine, paste and run it. It downloads and checks the software, installs it, joins the control plane, starts the inference node and waits for the connection.
3. The **Servers** page shows the node and its GPUs. To put a model on it, see **Deploying models**.

## Moving an inference node to another control plane

Today the move erases what the node holds on the machine: its models with their containers, the model images and weights it downloaded, its database (the desired state, the audit log and the history), its error reports and console logs, and its identity. The installed software, the service definitions, the service account and the configuration file stay, and the machine and its GPUs stay. The weights download again when the new control plane deploys the models.

1. On the new control plane, open **Servers**, **Add Inference Node**, and copy the command fresh.
2. On the machine, join with `connect`, because the machine already has the software. Take the three values from the copied command:

   ```sh
   sudo onprem-ai-node connect \
     --control-plane-gateway-address <address> \
     --control-plane-root-certificate-sha256 <fingerprint> \
     --join-token <token> \
     --remove-data --reset-identity
   ```

3. It prints what it erases and asks you to type the machine's name. Type it.
4. It stops the node, tells the old control plane the node is leaving (it says so when that control plane cannot be reached), erases, joins, starts the node and waits up to a minute for the connection. `Connected:` means it is on the new control plane; `Joined:` with "still connecting" means it keeps retrying on its own, and `sudo onprem-ai-node doctor` shows its state.
5. On the old control plane, the node stays listed until you remove it there: **Servers**, the node's menu, **Remove**.

## When a command is refused

Every refusal names its one fix.

| The command says | The fix |
|---|---|
| The control plane "does not hold inference node ... as removed", so the machine cannot come back under that identity | You are moving the machine: run the `connect` command with `--remove-data --reset-identity`, as in the steps above. |
| "The join token expired (a join token is valid for 15 minutes)" | Copy a fresh command from **Servers**, **Add Inference Node**, and run the `connect` command again with its token and with `--remove-data --reset-identity --yes`. |
| The machine's database "names inference node ..., but the machine no longer holds that node's key and certificate" | A join that failed left an inference node id on the machine without its key. Run the `connect` command with `--remove-data --reset-identity --yes` and the token from the same command: it removes the leftover and joins in one run. Do not run `remove-data` first and the join after it: a failed command between the two writes a new leftover. |
| The **Servers** page lists a node that never connected | A join that failed after the control plane accepted it. Remove the node there, the node's menu, **Remove**, and join again. |

## Which command, when

- The machine has no inference node software on it: run the command from the page, the `curl` line.
- The machine has the software, joined or not: run `sudo onprem-ai-node connect` with the values from the copied command. When the machine served another control plane, or a join on it failed, add `--remove-data --reset-identity --yes`.
