Resize a Space

Change a local VM's CPU, memory or disk while keeping its files.

Spaces.resize boots a stopped local VM from its own disk after changing its shape. The disk can grow; its files stay in place.

Resize#

Methods of Spaces.

Spaces.resize#

Gives a local VM Space another shape: cpus vCPUs, memory_mb MiB of memory, a disk grown to disk_gb GiB (each None keeps it). It shuts down and boots again from its own disk (a stopped one boots), so its files stay and its memory and processes do not. Returns once it is ready again.

async def resize(self, space: str, cpus: Optional[int], memory_mb: Optional[int], disk_gb: Optional[int]) -> SpaceResizeReport
ParameterTypeDefault
spaceStringrequired
cpusOption<u32>required
memory_mbOption<u64>required
disk_gbOption<u32>required

Returns SpaceResizeReport · Async · Raises CuaError

SpaceResizeReport record#

What Spaces.resize did: the shape the Space has now.

Returned by Spaces.resize.

FieldTypeDefaultDescription
spaceStringThe Space.
cpusOption<u32>vCPUs (when changed).
memory_mb / memoryMbOption<u64>Memory in MiB (when changed).
disk_gb / diskGbOption<u32>Disk in GiB (when grown).
messageStringWhat happened, for people.