Lifecycle
A machine moves through four main lifecycle operations: create, sleep, wake, and delete. For most workloads, you can set autosleep and let Dedalus manage idle sleep and wake transitions. Use the manual lifecycle operations when you want more control over how your machine behaves.
Create
Create provisions a persistent Linux machine with the CPU, memory, storage, and autosleep policy
you choose. The response includes a machine_id as soon as Dedalus accepts the request. If your
application needs to wait until the machine is running, watch it
instead of polling.
dedalus machines create \
--vcpu 1 \
--memory-mib 4096 \
--storage-gib 10 \
--autosleep 15m
machine = client.machines.create(
vcpu=1,
memory_mib=4096,
storage_gib=10,
autosleep="15m",
)
const machine = await client.machines.create({
vcpu: 1,
memory_mib: 4096,
storage_gib: 10,
autosleep: "15m",
});
machine, _ := client.Machines.New(ctx, dedalus.MachineNewParams{
CreateParams: dedalus.CreateParams{
VCPU: 1, MemoryMiB: 4096, StorageGiB: 10,
Autosleep: dedalus.String("15m"),
},
})
Machines sleep after five minutes of inactivity by default. Set autosleep to a different duration,
or use 0 or never to disable autosleep explicitly.
Parameters
vcpu · number
CPU allocated to the machine, measured in virtual CPUs.
memory_mib · integer
Memory allocated to the machine, measured in mebibytes (MiB).
storage_gib · integer
Persistent storage allocated to the machine, measured in gibibytes (GiB).
autosleep · string · default: 5m
Idle time before the machine sleeps. Accepts durations such as 30s, 15m, 2h, raw seconds,
or never to disable autosleep.
Sleep
Sleep stops the machine's running processes and releases its active compute. Billing stops while the machine is asleep, but storage persists at no cost and remains available for the next wake.
Use manual sleep when you want more explicit control over when the machine should be idle. Otherwise, you can let autosleep handle it.
An explicit sleep request closes SSH and terminal sessions and cancels active executions before sleeping. New access waits for sleep to finish, then wakes the machine. Auto-sleep waits until all activity is idle.
dedalus machines sleep --machine-id <machine_id>
client.machines.sleep(machine_id="<machine_id>")
await client.machines.sleep({ machine_id: "<machine_id>" });
client.Machines.Sleep(ctx, dedalus.MachineSleepParams{
MachineID: machineID,
})
Parameters
machine_id · string · required
The machine to sleep.
Wake
Wake starts a sleeping machine. The machine keeps the same ID and files, but processes that stopped during sleep do not resume. Start those processes again after the machine is running.
If autosleep is enabled, you normally do not need to call wake yourself. Operations that need the machine, such as an execution or SSH session, wake it as part of the request. Call wake directly when you need the machine running before you submit work.
dedalus machines wake --machine-id <machine_id>
client.machines.wake(machine_id="<machine_id>")
await client.machines.wake({ machine_id: "<machine_id>" });
client.Machines.Wake(ctx, dedalus.MachineWakeParams{
MachineID: machineID,
})
Parameters
machine_id · string · required
The machine to wake.
Delete
Delete the machine. Active SSH sessions close before runtime teardown. A destroyed machine cannot be used and its filesystem is discarded.
dedalus machines delete --machine-id <machine_id>
client.machines.delete(machine_id="<machine_id>")
await client.machines.delete({ machine_id: "<machine_id>" });
client.Machines.Delete(ctx, dedalus.MachineDeleteParams{
MachineID: machineID,
})
Parameters
machine_id · string · required
The machine to delete.
Delete removes the machine from normal use immediately. Storage may be retained for up to 30 days. Contact support for recovery.
Autosleep
Machines sleep after five minutes of inactivity by default. Set autosleep to a different idle
duration when you want Dedalus to stop compute sooner or later. For most intermittent workloads,
this means you do not need to call sleep or wake yourself. Use the manual
lifecycle operations only when your application needs to control the transition
at a specific time.
Activity includes executions, terminal and SSH traffic, port traffic, and CPU work from processes
inside the machine. The idle window accepts durations such as 30s, 15m, 2h, or 1w3d, raw
seconds such as 1800, or never to disable autosleep.
dedalus machines update --machine-id <machine_id> --autosleep 15m
client.machines.update(machine_id="<machine_id>", autosleep="15m")
await client.machines.update({ machine_id: "<machine_id>", autosleep: "15m" });
client.Machines.Update(ctx, dedalus.MachineUpdateParams{
MachineID: machineID,
UpdateParams: dedalus.UpdateParams{
Autosleep: dedalus.String("15m"),
},
})
Parameters
machine_id · string · required
The machine whose autosleep setting you want to change.
autosleep · string · required · default: 5m
Idle time before the machine sleeps. Accepts durations such as 30s, 15m, 2h, raw seconds,
or never to disable autosleep.
Persistent File System
Your machine's root filesystem is persistent across sleep and wake cycles.
What persists
- Files on the root filesystem, including
/etc,/home,/root,/usr/local, and/var. - Installed packages, source code, build caches, and configuration stored in those paths.
What resets on wake
- Memory and CPU execution state start fresh.
- Processes that were running before sleep remain stopped. Restart the processes you still need.
- Network addresses and open connections, including SSH sessions and port forwards.
- Runtime filesystems such as
/proc,/sys,/dev,/run, and/dev/shm. - Files in
/tmp. Store temporary files that must survive sleep in/var/tmpinstead.
