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| Parameter | Type | Default |
|---|---|---|
space | String | required |
cpus | Option<u32> | required |
memory_mb | Option<u64> | required |
disk_gb | Option<u32> | required |
Returns SpaceResizeReport · Async · Raises CuaError
SpacePowerReport record#
What Spaces.stop or Spaces.start did.
Returned by Spaces.start, Spaces.stop, Spaces.suspend.
| Field | Type | Default | Description |
|---|---|---|---|
space | String | The Space. | |
state | String | running, suspended or stopped: the state it is in now. | |
power | String | How it was turned off: suspend (its memory is kept, and still in use) or stop (its disk is kept; its memory is freed). | |
message | String | What happened, for people. |
SpaceResizeReport record#
What Spaces.resize did: the shape the Space has now.
Returned by Spaces.resize.
| Field | Type | Default | Description |
|---|---|---|---|
space | String | The Space. | |
cpus | Option<u32> | vCPUs (when changed). | |
memory_mb / memoryMb | Option<u64> | Memory in MiB (when changed). | |
disk_gb / diskGb | Option<u32> | Disk in GiB (when grown). | |
message | String | What happened, for people. |