# Rental lifecycle

> Every rental state, what it costs, and how stop, start and delete work.

Source: https://legion.ambient.xyz/docs/renting/rental-lifecycle

## States

"Billed" is shown for an on-demand rental, and for an interruptible one where it differs.

| State | What's happening | Billed (on-demand) | Billed (interruptible) |
| --- | --- | --- | --- |
| **Starting** | The host downloads your image and starts it. | No | No |
| **Running** | The rental is reachable through Legion's SSH gateway. | GPUs, by the second | GPUs, by the second, at the auction price. Through a preemption notice too, until the stop |
| **Restarting** | Your container stopped on its own, and the host is restarting it. | No | No |
| **Host offline** | The host stopped reporting. Your rental resumes when it's back. | No | No |
| **Stopping** | The host is stopping the container. | No | GPUs until the stop, when it's a preemption or an outbid |
| **Stopped** | The GPUs are released. Your files stay on the host for at least 24 and at most 72 hours. | Storage only, while the files are there | Storage only, if it keeps its data |
| **Deleting** | The host is removing the container and its workspace. | No | No |
| **Deleted** | The container and its workspace are gone. The page says when and why. | No | No |
| **Failed** | The rental couldn't start or keep running. The reason is on its page. | No | No |

A rental becomes **Running** once you can reach it through the gateway. If that doesn't happen within 10 minutes, it fails and you aren't billed.

### Watching a rental start

While a rental starts, its page lists each step under **What happens next**: reserving the GPU, preparing the image (when Legion copies it in first), downloading the container image, starting the container, and for a model downloading the model weights, loading the model onto the GPU, warming up, a check that it answers, and Ready. Each step says what is happening or what came of it, for example "Downloading model weights: 4.2 of 8.0 GB (52%), 210 MB/s, about 18 s left" or "Model weights already on this host", when it started and how long it took. If a step fails, it says where it stopped and why. **Details** under the steps lists every figure the host reported and the time each step took.

A rental that serves a model says **Ready** only once the model answered a health check the way a client would ask it. Until then its badge says which step it's on, for example "Starting: downloading model weights, 53%", even while its container already runs and is billed. A service shows the same steps on its Overview while it starts, and each replica's steps on its Replicas tab.

## Stop

**Stop rental** ends GPU billing and releases the GPUs right away, so other renters can rent them. Your files stay on the host **for at least 24 hours and at most 72 hours**, then are deleted. After the first 24 hours, they can be deleted earlier if another renter needs the disk. While they're there, **a stopped rental is billed for storage**: $0.20 per GiB per 730-hour month by default, on the disk it uses (at most its share), while your organization has credit.

The stop dialog offers **Back up and stop**, which keeps a copy of `/workspace` for 7 or 30 days. See [Stopping, backups and how long your data is kept](https://legion.ambient.xyz/docs/renting/stopping-and-backups).

## Start again

**Start rental** runs a stopped rental again on the same host, in the same tier, while its files are still on the host. It needs the host's GPUs and the rental's whole disk share to be free. If another rental took them, starting fails with `gpus_unavailable` or `host_disk_full`. Try again later, or rent elsewhere. An interruptible rental starts on free GPUs only, at the host's current auction price and never above its max.

## Back up or download the workspace

On a stopped or failed rental, **Back up** copies `/workspace` into one `.tar` file that Ambient keeps for 7 or 30 days, apart from the host. A backup has a price, shown before you confirm, and includes one download. On a stopped rental, **Download workspace** makes the same kind of file, kept for 24 hours; making it is free and each download link is charged by size. You can't start or delete the rental while either is being made. See [Workspace download or backup?](https://legion.ambient.xyz/docs/renting/stopping-and-backups#workspace-download-or-backup).

## The host your rental runs on

Every rental names its host. The **Rentals** list shows the host's name and its [Legion score](https://legion.ambient.xyz/docs/renting/legion-score), and a rental's **Host** tab shows what the market shows about that host (its GPUs, driver, country, uptime by day, score breakdown and latest benchmarks) and, while the rental runs, the live figures of your own GPUs: utilization, memory, power and temperature, as the host's agent reported them in the last 2 minutes. The figures are read again every 15 seconds.

You see only your own GPUs, and only from when your rental was given them. Nothing on the tab names the provider, an address of the host, or anyone else renting it. The API is [getRentalHost](https://legion.ambient.xyz/docs/api/rentals/get-rental-host); `host_name` and `host_score` are on every rental.

## Planned maintenance

A provider can schedule maintenance on a host. If your rental is on it, you are told ahead of time and nothing is lost:

- **You are told.** You get an email when the window is scheduled, moved or cancelled, a reminder 24 hours and 1 hour before it starts, and an email when it ends. If you have rentals on several hosts, one email lists them all. The rental's page shows a banner with when the window starts, when it is planned to end and why, and the rentals list marks it.
- **At the start, your rental stops.** In the last 5 minutes you get the same countdown, notice file and SIGTERM an interruptible rental gets before a preemption, whatever type your rental is. For a maintenance stop the notice file's reason reads `preempted`. The rental's stop is not a preemption: **your files are always kept**, even if you chose **Delete it** for preemptions.
- **You aren't charged.** There is no GPU charge while the rental is stopped, and no storage charge while the host is in maintenance. The clock that deletes a stopped rental's files waits too, and starts again when the window ends.
- **It starts again by itself** on the same host when the window ends, unless you turn **Start again when maintenance ends** off on the rental's page, you have no credit, or the host is under review. If it can't start yet, Legion keeps trying every minute and never deletes it for that. The end-of-maintenance email says which rentals started and why any didn't. If you turn it back on for a rental a finished window left stopped, it starts again right away, not after a later window.
- **Until the last 5 minutes** you can still start a stopped rental of yours on that host. While the window runs, no rental can start there: you get `host_maintenance`.
- **Rent elsewhere.** **Rent an equivalent machine elsewhere** on the banner lists the cheapest machines with the same GPUs on hosts with no maintenance planned soon, and **See all in the Market** opens the Market with the same GPUs, type and **Available until** requirement.
- **Back up first.** Once the rental is stopped, **Back up now** on the banner makes a backup of its files, the same one the Backups tab offers, at the price shown before you confirm.
- **If the host is late,** the rental stays stopped and uncharged until the host is back.

Offers on a host with a window show **Available until** its start. Within 72 hours of the start the host takes no new on-demand rentals, and within 1 hour of it no new interruptible ones.

## Preempted and outbid rentals

An [interruptible rental](https://legion.ambient.xyz/docs/renting/interruptible-rentals) is stopped when an on-demand renter needs its GPUs or a higher bid wins them, after a 5-minute notice. What happens next was chosen when you rented:

- **Keep my data:** the rental ends **Stopped** and is billed for storage, with the same 24 to 72 hours as any stopped rental. It starts again by itself if its host's GPUs free up within 72 hours of the stop (after that its files are deleted), unless you turn **auto-resume** off (the price is kept after an on-demand preemption, and can change, between the floor and your max, after a won clearing), and you can start it yourself or back it up.
- **Delete it:** the workspace is deleted when the container stops. **Deleting**, then **Deleted**, with no storage charge.

## Delete

**Delete rental** removes the container and its workspace for good. **Back up, then delete** makes a backup first and deletes the rental once it's ready. **Delete now** deletes at once: you type the rental's short ID to confirm, and the files can't be recovered. See [Deleting a rental](https://legion.ambient.xyz/docs/renting/stopping-and-backups#deleting-a-rental).

## Automatic deletion

Legion deletes a rental's files by itself:

- a **Stopped** rental, 72 hours after it stopped, after an email 12 hours before, or earlier, from 24 hours, if another renter needs the disk;
- a rental that **Failed**, 72 hours after it failed, after an email 24 hours before.

Every deletion is recorded with its date and reason, shown on the rental's page and emailed to your organization. See [Why was my data deleted?](https://legion.ambient.xyz/docs/renting/stopping-and-backups#why-was-my-data-deleted).

## Backups are yours to ask for

Legion backs up a rental only when you ask. Keep copies of anything you need, in a [backup](https://legion.ambient.xyz/docs/renting/stopping-and-backups#backups) or elsewhere. See [Security and trust](https://legion.ambient.xyz/docs/account/security).
