Skip to main content

Documentation Index

Fetch the complete documentation index at: https://vastai-80aa3a82-feat-host-3113-dynamic-resize.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Update/recreate an instance from a new/updated template.

Signature

VastAI.update_instance(
    id: int,
    template_id: Optional[int] = None,
    template_hash_id: Optional[str] = None,
    image: Optional[str] = None,
    args: Optional[str] = None,
    env: Optional[str] = None,
    onstart: Optional[str] = None,
    disk: Optional[int] = None
) -> str

Parameters

id
int
required
id
template_id
Optional[int]
template_id
template_hash_id
Optional[str]
template_hash_id
image
Optional[str]
image
args
Optional[str]
args
env
Optional[str]
env
onstart
Optional[str]
onstart
disk
Optional[int]
New disk size for the instance, in GB. Disk can only be grown, not shrunk, and the new size must fit within the host machine’s available capacity.

Returns

str, Result from the API call.

Example

from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.update_instance(id=12345)
print(result)