modify when you want to change an existing sandbox without recreating it.
Create time
Most settings are chosen when you create the sandbox. If the sandbox may need more CPU or memory later, setmax_cpus and max_memory above the starting size so it has live resize headroom:
cpus and memory are the sandbox’s live size. max_cpus and max_memory are the ceilings it can grow to while running. They default to the starting size, so a sandbox created without them has no growth headroom.
Reserving headroom is cheap: spare vCPUs stay parked, and spare memory is only backed once the guest uses it.
Change model
Usemodify to plan or apply a patch to an existing sandbox. Every requested change is classified, and apply is all-or-nothing: if one change cannot be applied under the chosen policy, nothing changes.
live, next start, requires restart, or unsupported.
| Change | Effect | Notes |
|---|---|---|
cpus, memory | Live within the max_* ceilings | The guest may take a moment to converge |
max_cpus, max_memory | Restart or next start | These are boot-time ceilings |
labels | Live | Host-side metadata; no guest process changes |
env, workdir | Future execs | Running processes keep what they already have |
secrets | Live for rotation | Placeholder changes need a restart |
| Storage | Create or mount time | Size rootfs, volumes, tmpfs, and disk images outside modify |
Dry runs
Use a dry run to see what would happen before applying the patch:Policies
By default,modify only applies changes that do not require a restart. Use --next-start to save restart-backed changes for the next boot, or --restart to restart the sandbox and make them active now.
CPU and memory
Raise or lower CPUs and memory on the fly, up to the ceilings reserved at create time:max_cpus or max_memory takes a restart. A live resize does not always take hold at once, since the guest applies it in the background. The result reports per-resource progress so you can tell when it has settled.
Use msb ps to see a sandbox’s allocation as effective / max, and msb metrics to see live usage before deciding how to resize.
Labels
Labels can be added, changed, or removed through the same configuration path:Env and workdir
Environment and workdir changes affect future commands only. Existing guest processes keep the environment and working directory they already have.Secrets
Secrets can be added, rotated, or removed without recreating the sandbox. Guest code keeps using the same placeholder; only the value injected at the network boundary changes.Storage
Storage capacity is not part ofmodify today. Choose it where the storage is defined:
- OCI writable layer size on the image source
- named volume size or quota on the volume
- tmpfs size on the mount
- disk image size in the disk image itself
Reference
For exact flags and return fields, seemsb modify and the SDK sandbox references.