Concepts
Auto-stop
Stop machines automatically a fixed time after they start, so forgotten machines don't keep billing.
Auto-stop stops a machine a set time after it starts running. New machines stop after 1 hour unless you choose another duration or turn auto-stop off. The deadline counts from when the machine becomes running; activity inside the machine does not extend it. To stop a machine once it has done nothing for a while instead, turn on idle sleep; with both on, whichever comes first stops it.
Settings
| Field | Meaning |
|---|---|
auto_stop_after_seconds | 60 to 2,592,000 seconds (1 minute to 30 days). null means never. Creates default to 3600. |
never_auto_stop | true turns auto-stop off. It can't be combined with auto_stop_after_seconds. |
auto_stop_at | The current deadline (UTC, RFC 3339), present only while the machine is meant to run with a deadline. |
Set it when you create a machine
vy new --name dev --auto-stop 2 # hours; also 30m, 1d, or neverChange it later
PATCH /v1/machines/{id} changes the setting and returns the updated machine right away. Changing auto-stop on a running machine restarts its deadline from now; renaming alone leaves the deadline as it is.
vy autostop dev 30m
vy autostop dev neverHow the stop happens
VMYard checks deadlines every second. When one passes, it requests an ordinary stop operation for that machine, exactly once per deadline, even if you change the setting or stop the machine at the same moment. The stop emits machine.stopped like any other stop, and its operation has stop_reason: "auto_stop".
A start or restart sets a new deadline. A stop or delete clears it.