Automatic restarts aren’t available for Serverless AI endpoints.
Configuring automatic restarts
To turn automatic restarts on or off for a job, set the--restart-policy parameter when you create the job:
--restart-policy on-failure reacts to your container exiting with an error while the job is running. This is useful for workloads that can fail transiently and succeed on a retry, for example, a training step that occasionally crashes and can resume from a checkpoint.
When jobs aren’t restarted
--restart-policy responds only to the container’s own exit code. It does not recover from:
- No available capacity at start: if the requested compute can’t be allocated when the job starts.
- Preemption: if you run on preemptible compute and Nebius AI Cloud reclaims (preempts) the underlying virtual machine (VM).
- The underlying VM stopping unexpectedly.
- Startup failures and timeouts.
ERROR status and isn’t retried by --restart-policy. To run it again, create a new job or use nebius ai job restart.