Power and resize

Stop, suspend and start a Space, and change a local VM's CPU, memory or disk while keeping its files.

Spaces.stop, suspend and start answer a SpacePowerReport. 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

SpacePowerReport record#

What Spaces.stop or Spaces.start did.

Returned by Spaces.start, Spaces.stop, Spaces.suspend.

FieldTypeDefaultDescription
spaceStringThe Space.
stateStringrunning, suspended or stopped: the state it is in now.
powerStringHow it was turned off: suspend (its memory is kept, and still in use) or stop (its disk is kept; its memory is freed).
messageStringWhat happened, for people.

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.