Hibernation Behavior
Configure VM root filesystem size and ready signals.
Root Filesystem Size
Control the size of the VM's root filesystem (default: 16 GB):
import { VmSpec } from "freestyle";
const spec = new VmSpec().rootfsSizeGb(32);
const { vm } = await freestyle.vms.create(spec);Resizing After Creation
The filesystem can be resized after creation:
await vm.resize({ rootfsSizeGb: 64 }); // Resize to 64 GBNote: You can only increase the size, not decrease it.
Ready Signals
Control when the VM creation API call returns by waiting for the VM to be fully ready:
const { vm } = await freestyle.vms.create({
waitForReadySignal: true,
readySignalTimeoutSeconds: 120, // Default: 120 seconds
});By default (waitForReadySignal: false), the API returns as soon as the serial console shows the login prompt. This typically takes 1-2 seconds.
When waitForReadySignal: true, the API waits for the VM to be fully booted and ready to accept commands before returning.
Note: In the future, this will be configurable to wait for custom readiness conditions like systemd service health checks or application-specific signals.