Create and manage a VM
Atlas chooses a host and stores the VM request. Metal applies that request on the host. Start with how one VM request works to learn which component owns each state.
Create a VM
Atlas chooses a host, saves a draft reservation, and asks Metal to create the VM. Metal accepts the request before the guest is ready. Follow the linked request guide for the full create flow and lost-response behavior.
Change a VM
Atlas sends power, restart, resource, network, key, and metadata changes to the assigned host. Metal reports the applied generation separately from request acceptance.
See guest metadata for the limits on custom metadata and other MMDS values.
A resize uses the current host if it has enough capacity. Otherwise, Atlas can reserve another host and use migration.
Set CPU burst
A burstable VM can use CPU above its baseline. Metal measures its average CPU use over its sliding window, as average CPU use over a window explains.
metald checks each running burstable VM every 10 seconds. When the average is above the baseline, metald limits the VM to its baseline with the CPU quota of its systemd unit. When the average falls to 90% of the baseline or lower, metald gives the VM its full cpu_millicores again. The gap stops a busy VM from switching at each check. The VM keeps the same number of vCPUs. Only its CPU time is limited.
metald logs limit VM CPU or release VM CPU with the average and the new limit. The quota of the unit is the limit state, so a metald restart needs no repair. A VM start sets the full CPU, and the next check limits the VM again when its average is still above the baseline. A VM that stops being burstable gets its full CPU at the next check.
| Field | Meaning | Default | Limits |
|---|---|---|---|
is_burstable | The VM can use CPU above its baseline. | false | |
baseline_cpu_millicores | The CPU that the VM can always use. | 20% of cpu_millicores | 1 to cpu_millicores |
sliding_window_minutes | How far back Metal measures average CPU use. | 60 | 1 to 1440 |
Set the fields in the create or resize API request, or with Actions → Resize VM in Desk. Atlas fills a default for a value that is unset or 0 on a burstable VM. When a VM stops being burstable, Atlas sets the baseline and the window to 0.
A CPU burst change applies to a running VM, like the idle sleep delay. A move to another host keeps the settings. Atlas rejects a resize that sets cpu_millicores below the baseline. Lower the baseline first.
Host capacity counts the baseline_cpu_millicores of a burstable VM that runs, and no CPU for a sleeping VM. Placement uses CPU only to rank hosts.
Use Actions → Reset CPU Burst in Desk to start the average again from now. Atlas calls POST /v1/vms/{id}/cpu-burst/reset in Metal, and metald stores the time as cpu_burst_reset_at on the VM record. The average then ignores the samples before that time, so that time counts as idle. The reset does not change the CPU limit. At the next check, the average is near 0, so metald gives a limited VM its full CPU again. Metal returns 409 not_burstable for a VM that is not burstable, and an older metald returns 404.
Read CPU burst status
The CPU Burst section of a burstable VM's Virtual Machine State form shows the current status. Atlas reads it from Metal when the form opens, not from host sync. If Metal does not answer, the form shows the error. The section does not show for a VM that is not burstable.
GET /v1/vms/{id}/cpu-burst in Metal returns the same status:
{
"cpu_millicores": 1000,
"baseline_cpu_millicores": 500,
"release_cpu_millicores": 450,
"sliding_window_minutes": 60,
"average_cpu_millicores": 512,
"cpu_limit_millicores": 500,
"is_limited": true,
"up_seconds": 3550,
"idle_seconds": 50,
"reset_at": "2026-11-16T04:30:00Z"
}| Field | Meaning |
|---|---|
release_cpu_millicores | A limited VM gets its full CPU again when its average falls to this value or lower. It is 90% of the baseline. |
average_cpu_millicores | The sliding window average. It is absent until metald has samples of the VM in memory. |
cpu_limit_millicores | The current CPU quota of the VM. It is absent when the VM is not running. |
up_seconds | The time of the sample pairs in the average. |
idle_seconds | The missing history and the down time that the average counts as idle. |
reset_at | The last CPU burst reset. It is absent when the VM was never reset. |
A VM that is not burstable gets 409 not_burstable. An older metald returns 404, and Atlas then shows no status.
Upgrade metald on a host before you make its VMs burstable. An older metald ignores the burst fields. Atlas then repairs the VM record from Metal at the next resize.
Read Metal's requested and applied generations for current progress. The Atlas VM list uses cached host reports.
Read VM metrics
Metal samples each VM every 10 seconds. It records CPU time, memory use, disk size and use, disk read and write rates, configured disk limits, and received and sent network traffic.
Sent traffic includes ICMP, UDP, TCP SYN, and TCP RST packet counters. Disk use is from the last reconcile pass, so it can be older than the sample time. A stopped VM has no current CPU, memory, or disk I/O use.
Memory use is the guest's own report through the Firecracker balloon device. A VM that booted without the balloon device, or that sends no valid report, shows the memory charged to its Firecracker cgroup. That value includes host page cache, so it can be larger than the VM memory.
A VM image with the atlas-guest-agent binary also reports its own view in guest: the load average, memory from /proc/meminfo, and the size and use of the root file system. Metal asks the guest over vsock, a host-to-guest socket that does not use the guest network, so a guest firewall cannot block it. Metal asks only a running VM. The vsock handshake waits at most 50 ms, and the report waits at most 1 second. After a guest does not answer the handshake, the next minute of samples skips it.
When Metal gets no report, guest.system_state is unreachable and the other guest values are zero. This occurs for an older image, a VM that has not cold-booted since the vsock device was added, and a VM that is not running.
Metal also asks the agent for these jobs. Without an agent, each job works as before:
| Job | With the agent | Without the agent |
|---|---|---|
| Snapshot of a running VM | The guest freezes its file systems, so the image is clean. | The image is crash-consistent. |
| Sleep or live migration of a running VM | The guest freezes before Metal saves its memory. A cold boot after a failed restore then finds a clean disk. The restore resets the vsock connections, so the guest thaws when it resumes. | A cold boot after a failed restore replays the file system journal. |
| Disk resize of a running VM | The guest grows the root file system at once. | The guest grows it at the next boot. |
| Stop | The guest reboots cleanly, also when it ignores Ctrl-Alt-Del. | Metal sends Ctrl-Alt-Del. |
Disk rates come from the VM systemd cgroup's io.stat counters for the root disk device. Metal stores whole read and write bytes per second and milli-IOPS, where 1,000 milli-IOPS is one operation per second.
The first sample after Metal starts, and the first sample after a counter reset, stores zero rates. Configured throughput and IOPS limits are zero when unlimited.
The VM unit template enables IOAccounting=yes. Before the template takes effect on an existing running VM, enable accounting on that unit with systemctl set-property --runtime metal-vm@<vm-id>.service IOAccounting=yes. If io.stat is absent, Metal logs a VM sampling error.
Metal keeps seven days of samples in daily files under machines/<vm-id>/metrics/ on the VM's current host. An hourly cleanup removes complete expired files, so disk cleanup can lag by less than one day. Deleting or migrating a VM removes its local history. The metrics worker does not collect host usage.
Each JSONL line and metrics API sample stores its timestamp as UTC Unix seconds.
Read samples with GET /api/atlas/virtual-machines/<vm-id>/metrics. The caller must own the VM. Optional start and end timestamps select a range within the last seven days. The default range is the last 24 hours. Atlas reads the host only when this endpoint is called.
Optional max_samples sets the most samples to return, from 10 to 2000. The default is 300. Metal splits the range into clock-aligned buckets of 10s, 20s, 30s, 1m, 2m, 5m, 10m, 15m, 30m, 1h, 3h, 6h, 12h, or 24h. It uses the smallest bucket that keeps the result within max_samples. For example, the default 24-hour range returns 5-minute buckets.
Each sample is the latest sample in its bucket, with disk I/O rates averaged across the bucket. sample_interval_seconds is the bucket length. Network and CPU values are cumulative counters; divide the difference between adjacent samples by their elapsed seconds to calculate an average rate.
Network counters count unicast IPv4 and IPv6 packets at the VM TAP. The protocol counters read direct transport headers; IPv6 extension headers and later IPv4 fragments still increase the total packet count but not the protocol count. A Metal restart or TAP reattachment resets network counters, so discard a negative counter difference when calculating rates.
Average CPU use over a window
metald averages the CPU use of a burstable VM over its sliding_window_minutes. The CPU limiter and the CPU burst status use this average. The result is in milli-CPUs, where 1,000 milli-CPUs is one CPU busy for the full time.
metald keeps one window of samples for each burstable VM in memory, so a call does not read the disk. After the metrics sampler stores a sample, it gives the sample to the VM manager. A sample that the store rejects does not go into memory. One window holds one sample for each 10 seconds, plus one. A 60-minute window holds 361 samples and uses about 14 KB.
The first sweep after metald starts reads the stored samples of each burstable VM one time. A VM that becomes burstable, or that gets a new window, reads them at its next sweep. Until that sweep, the previous window applies for up to 10 seconds. A sweep that runs out of time logs keep VM CPU samples and tries again at the next sweep.
metald removes the samples of a VM when the VM stops being burstable, is destroyed, or moves to another host.
Metal adds the CPU time and the elapsed time of each pair of adjacent samples in the window. It divides the CPU time by the elapsed time. It skips a pair when both samples have the same second. When the VM was down at either sample, the pair counts as idle, with no CPU use. Thus a VM that wakes from sleep, or starts after a stop, can burst.
When the samples start after the window start, Metal counts the time before the oldest sample as idle, with no CPU use. For example, a VM with 10 minutes of samples in a 60-minute window gets 50 idle minutes. Samples before a CPU burst reset count as missing too. Thus a new VM can burst. With a baseline of 500 millicores on a 1,000 millicore VM and a 60-minute window, it can use its full CPU for about 30 minutes.
When metald fills the window from the store, it reads one sample interval before the window start, so a refill adds no missing time.
When the CPU counter falls, a restart made a new cgroup that counts from 0. Metal counts the new counter value as the CPU time of that pair. The CPU time that the old cgroup used after the previous sample is lost.
metald has no average when it has no samples of the VM in memory yet, for example before the first sweep after metald starts. The CPU limiter then keeps the current limit of the VM, and the status has no average_cpu_millicores. When the window has no usable time, the average is 0.
The value includes the Firecracker process threads, so it can be a little more than the vCPU count multiplied by 1,000. A paused VM counts as up with almost no CPU use. If a restart occurs inside one 10-second interval and the new counter is already more than the old counter, that pair shows less CPU time than the VM used.
Terminate a VM
- Atlas requests destruction and marks its record as terminating.
- Metal removes runtime, network, and disk resources through saved cleanup checkpoints.
- Atlas removes its record after Metal confirms absence.
Public-address allocation has a separate retry path.
Failure and recovery
Keep uncertain drafts and terminating records when Metal does not answer. Find a problem starts with the assigned host, Metal progress, and Atlas jobs. For guest access, use the console.
Details: Atlas VM records, Metal reconciliation, Atlas API, and Metal API.
Source code and tests
- Atlas VM service owns draft creation and host calls.
- Placement context reserves host capacity.
- Atlas reconciliation settles uncertain drafts and terminations.
- Metal manager stores the create request and checks retries.
- Metal reconciliation applies and removes host resources.
- Atlas VM tests and Metal manager tests check the two commit points.