Instance Lifecycle
What does “Lifetime” mean on my instance?
Every offer has a maximum rental duration. When you rent an instance, the offer end date at the time of rental becomes your rental end date — the date your instance will run until. This rental end date is locked when you rent and cannot be changed by the host. When the rental end date is reached, the rental contract expires and the instance is stopped. The host can extend the rental contract by moving the offer end date forward, but this is at their discretion and only applies if they choose to do so. Important: Always assume your instance will be lost once the lifetime expires and copy out any important data before then.How can I restart programs when my instance restarts?
For custom command instances: Your command runs automatically on startup. For SSH instances: Place startup commands in/root/onstart.sh. This script runs automatically on container startup.
Environment Configuration
How do I set environment variables?
Use the-e Docker syntax in the docker create/run options:
/etc/environment:
How do I get the instance ID from within the container?
Use theVAST_CONTAINERLABEL environment variable:
How can I find OPEN_BUTTON_TOKEN?
SSH into your instance or open Jupyter terminal and run:Controlling Instances
How do I stop an instance from within itself?
A special instance API key is pre-installed. Install the CLI and use it:$CONTAINER_ID is not defined, check your environment variables with env.
Can I run Docker within my instance?
No, Vast.ai does not support Docker-in-Docker due to security constraints. Each Docker container must run on a separate instance.Data and Storage
Can I change disk size after creating an instance?
No. Disk size is permanent and cannot be changed after instance creation. If you run out of space, you’ll need to create a new instance with a larger disk. Tip: Always allocate more space than you think you need to avoid interruptions.What happens to my data when an instance stops?
- Stopped instances: Data persists, storage charges continue
- Destroyed instances: All data is permanently deleted
- Lifetime expired: Instance stops, data remains until destroyed