machines
All machines commands act in the current organization.
space machine is the same as space machines.
Commands that change a machine are asynchronous. Without --wait they print the machine’s state
right after the portal accepted the command and return
(dev: sleep accepted (state: stopping); use --wait to wait for sleeping). With --wait they poll until the
machine reaches the target state; see Scripting.
-w is short for --wait; --timeout <seconds> (default 600, only with --wait)
limits the wait.
space machines list
space machines list
space ls
space machine lsName, state, vCPUs, memory, disk, base checkpoint and creation time of every machine in the organization.
space machines create
space machines create <name> [--vcpus <n>] [--mem <MiB>] [--disk <GiB>] [--from <checkpoint>] [--asleep] [--wait [--timeout <seconds>]]| Option | Meaning |
|---|---|
--vcpus <n> | Number of virtual CPUs: 1 to 8, default 2. |
--mem <MiB> | Memory in MiB: 256 to 16384, default 2048. |
--disk <GiB> | Disk size in GiB: 1 to 1024, default 10. With --from, at least the source machine’s disk size. |
--from <checkpoint> | Start from this checkpoint’s disk instead of a fresh one (Checkpoints): its name, a tag only one checkpoint has, or <machine>:<tag>. |
--asleep | Create it suspended: its disk is made, it isn’t started. It counts against the running quota only once resumed. |
--wait | Wait until the machine is running (sleeping with --asleep). |
The name must be unique in the organization: 1 to 63 lowercase letters, digits and -,
starting with a letter or digit. The organization’s quota can lower the maximums (see
space orgs show); a request over a limit is refused with exit code 5.
When the organization’s running machines already use its running quota (vCPUs or memory of
running machines), the machine can’t start and the create is refused with exit code 7, with a hint.
--asleep creates it anyway, suspended: space machines wake starts it for the first time once
there is room, for example after space machines sleep of another machine. Its time zone is set then.
space machines show
space machines show <machine>All fields of the machine: name, id, state, vCPUs, memory, disk, base checkpoint, error (for a
failed machine), ingress, creation and update time, and its SSH host keys. Memory is what a
running machine reserves beside what it uses
(reserved and in use):
8G reserved, 2.1G in use (3.4G at most today), or 8G, asleep. A machine behind a
web portal also shows its url: the portal’s address,
https://<name>.agent-app.eu (on region lab: https://<name>.polder-vm.eu). With -q it prints
only the state.
It also says how idle suspend sees the machine. A running machine shows
why it is in use (awake: ssh (1 open), cpu (37% of one vCPU)), or since when it is idle
and when it is suspended if nothing happens, and its idle timeout. A suspended one shows since
when, and why: (idle) when it was suspended on its own, (on request) after
space machines sleep. space machines list marks a machine that was suspended on its own as sleeping (idle).
A suspended machine whose memory was kept (hot suspend, where your operator turned it on) adds
wakes: in about a second; its state is sleeping like any other. One whose disk was moved
to object storage after a day (cold suspend, likewise) adds
wakes: in a few seconds (cold: its disk comes back from object storage).
A machine that stopped on its own, for example because it ran out of memory, shows as
crashed, with when and what its host saw (crashed: <time> (killed: out of memory)).
It is suspended with its disk intact: space machines wake or an SSH connection boots it again.
If it crashed because its host failed and its disk was kept on that host
(where its disk is kept), it starts on another host
with its disk as of its last save, and says so: now: sleeping; its host failed: ... disk as of <time>, its last save, and once it runs again restarted: after its host failed, with its disk as of <time>.
With --json, the fields are idle_timeout_secs, sleep_reason (idle, requested,
crashed, or resize for a machine resized while it ran that couldn’t resume at its new size; state stays sleeping), sleep_detail (for a crashed machine, what its host saw),
sleep_tier (for a suspended machine: hot when its memory was kept, cold when its disk
is in object storage, else warm; null
while it runs), slept_at, disk_as_of (its host failed: the time of the save of its disk it
restarts or restarted from; null otherwise, and again once it is next suspended) and, for a running machine, awake (idle_since, sleeps_at,
last_call, reasons). mem_mib is its size; mem_in_use_mib what it uses (null unless
it runs and was read in the last few minutes) and mem_in_use_peak_mib the most in the
last 24 hours (null while it is suspended).
space machines sleep
space machines sleep <machine> [--wait [--timeout <seconds>]]Suspends the machine: stops it and frees its host resources, keeping its disk. Memory and running processes
are not kept, unless your operator turned on hot suspend for your organization: then the machine’s
memory is kept too while it can be, and space machines show says wakes: in about a second.
--wait until sleeping.
space machines wake
space machines wake <machine> [--wait [--timeout <seconds>]]Resumes a suspended machine: boots it from its disk, or, when its memory was kept (wakes: in about a second in space machines show), carries on where it stopped. --wait until running.
Connecting over SSH resumes a machine as well.
space machines resize
space machines resize <machine> [--vcpus <n>] [--mem <MiB>] [--disk <GiB>] [-y|--yes] [--wait [--timeout <seconds>]]Changes the machine’s size; what you leave out stays. The ranges are those of create, and
the disk only grows: --disk is at least its current size. A suspended machine takes the new
size when it next resumes. A running one restarts into it, which takes a few seconds and stops
whatever runs in it (its disk is kept): on a terminal it asks first, --yes skips that and is
required when not on a terminal. While it restarts, its state is waking. --wait until it
is back in the state it was in. The organization’s quota counts the new size: a resize over a
limit is refused with exit code 7, and so is a size no host of the region can take right now,
after which the machine is suspended at its new size until you resume it or resize it back. A size
out of range or a smaller disk is refused with exit code 5.
space machines restore
space machines restore <machine> <checkpoint> [--wait [--timeout <seconds>]]Rolls the machine’s disk back to a checkpoint taken from this machine: its name, or a tag only one
of the machine’s checkpoints has. --wait until running.
space machines delete
space machines delete <machine> [-y|--yes] [--wait [--timeout <seconds>]]Deletes the machine. Asks for confirmation on a terminal; --yes skips it, and is
required when not on a terminal. --wait until the machine is gone.
Machine states
| State | Meaning |
|---|---|
creating | Being created. |
running | Running and reachable. |
stopping | Being suspended. |
sleeping | Suspended: stopped, disk kept. Resumes on space machines wake or an SSH connection. A machine nobody uses is suspended on its own after its idle timeout (10 minutes by default). With hot suspend its memory is kept as well and it resumes in about a second; the state is the same, --json has "sleep_tier": "hot". With cold suspend, after a day its disk moves to object storage and it resumes in a few seconds ("sleep_tier": "cold"). |
crashed | Shown for a machine that stopped on its own (e.g. out of memory). It is sleeping with its disk kept, and resumes like a suspended machine; --json has "state": "sleeping", "sleep_reason": "crashed". When its host failed, it resumes on another host with its disk as of its last save ("disk_as_of"). |
waking | Resuming. |
checkpointing | A checkpoint is being taken. |
restoring | A checkpoint is being restored. |
deleting | Being deleted. |
deleted | Gone. |
failed | Something went wrong; space machines show gives the error. |