Removing or moving a host
Take a host out of the market, remove it, uninstall the agent, or move it to another organization.
Remove a host
On the host's page, press Stop new rentals. Rentals already running continue.
Wait until no rentals are active on it. Until then, removing it fails with
409 host_.has_ active_ rentals Press Remove host and confirm.
The host leaves the market and your host list, and its agent's certificate is revoked. Show removed in Hosts brings it back into view. To add the machine again, create a new install command.
Renters' files on the host
A stopped or failed rental keeps its files on the host for up to 72 hours, so its renter can start it again or take a backup. A host honours the files it holds: while any are left, Remove host shows them (rental, state, size and when they are deleted) and asks you to choose. Both choices are always shown:
Remove when empty (selected by default). The host leaves offers at once and its rentals can't start. Each renter is emailed that the host is leaving, with their delete-by time and a link to back their files up, which is their choice and at their cost. The host shows Removing when empty and is removed on its own once no rental has files left, within 72 hours at the latest. Files left at that point are deleted.
Delete renters' files and remove now. You type the host's name and say why. The host's agent deletes the files and confirms, and the host shows Removing: deleting renters' files until then, for at most an hour. Each renter is emailed that their files were deleted because the host was removed (
data_deleted_ reason host_). The removal and your reason are recorded against your host and organization, and Legion staff can see them.removed
While a host is Removing when empty you can still press Remove host to delete the files now. While it is deleting them there is nothing left to choose. A host that is already removing can't be listed again (409 host_).
A host with no files on it is removed at once, as before. Through the API, a removal that meets files is refused with 409 host_ until the request names stored_; getHostRemovalPreview lists the files first.
Uninstall the agent
Delete the host's rentals first. Then, on the machine:
sudo systemctl disable --now legion-agent
sudo rm -rf /usr/local/bin/legion-agent \
/etc/systemd/system/legion-agent.service \
/etc/systemd/system/legion-agent.service.d \
/etc/legion-agent \
/var/lib/legion-agentRemoval doesn't touch rental containers or their networks.
Move a host to another organization
Delete the host's rentals, and wait until they show Deleted.
Stop the agent:
sudo systemctl stop legion-agent.Remove its identity and configuration:
sudo rm -rf /.var/ lib/ legion-agent / etc/ legion-agent In the new organization, create an install command and run it.
The machine joins as a new host. The old host stays offline in the old organization.