Skip to content

Commit 7609f43

Browse files
authored
docs(known-issues): clarify clone/restore --cpu/--memory cannot grow (#26)
Previous entry implied --cpu changes vCPU count but disk num_queues follows. Empirical verification (E2E run) shows neither vCPU count nor memory size actually grow on the guest side: cocoon patches config.json correctly but CH's vm.restore reconstructs from binary state at snapshot's original size. Update the entry with a clear table and the corrected consequence.
1 parent 099cf9f commit 7609f43

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

KNOWN_ISSUES.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,20 @@ This is by design: clone restores the VM's exact state including all account set
5858

5959
Race window: `cocoon vm run X && cocoon vm exec X -- cmd` may fail with `read CONNECT reply: EOF` if the in-guest agent hasn't started yet. The error includes the hint `(cocoon-agent may still be starting; retry shortly)`. Wait ~5–10s after `vm run` returns.
6060

61-
## Clone/restore disk queue count is immutable
61+
## Clone/restore CPU and memory cannot grow
6262

63-
When cloning or restoring a VM with a different `--cpu` value, the disk `num_queues` (one queue per vCPU) retains the snapshot's original value. This is because `num_queues` is part of the virtio-blk device state baked into the binary snapshot — changing it in `config.json` causes Cloud Hypervisor to crash on `vm.restore`.
63+
`--cpu` and `--memory` on `cocoon vm clone` / `cocoon vm restore` are written into the new VM's `config.json` (cocoon's `patchCHConfig` does its job), but **the guest still sees the snapshot's original vCPU count and memory size**. Cloud Hypervisor's `vm.restore` reconstructs the guest from the binary memory file and saved CPU state — both sized at snapshot time — so a higher value in `config.json` is silently ignored.
6464

65-
`--disk-queue-size` (ring depth per queue) **is** correctly patched on clone/restore, since it is a software-layer configuration that CH re-reads from `config.json` during restore.
65+
| What you set | What `config.json` shows | What the guest sees |
66+
| --- | --- | --- |
67+
| `--cpu 4` (snapshot was 2-vCPU) | `boot_vcpus: 4` | `nproc` → 2 |
68+
| `--memory 2G` (snapshot was 1G) | `memory.size: 2147483648` | `MemTotal`~1 GiB |
6669

67-
**Consequence**: a VM cloned with `--cpu 8` from a 2-vCPU snapshot still runs disks with 2 queues (not 8). Disk I/O is functional but does not scale to the new vCPU count.
70+
The disk `num_queues` follows vCPU count and is part of the virtio-blk device state, so it stays at the snapshot's value too. `--disk-queue-size` (ring depth) is software-only and **is** correctly patched on clone/restore.
6871

69-
**Workaround**: none — this is a CH architectural limitation. Create a fresh VM with the desired CPU count instead of cloning if disk multi-queue scaling is critical.
72+
**Consequence**: clone/restore with grown `--cpu`/`--memory` boots successfully but the new resource ceiling is invisible to the guest kernel. Workloads sized for the requested target will not get the headroom they expect.
73+
74+
**Workaround**: none — this is a CH architectural limitation (no hot-add of vCPU or memory at restore time). Create a fresh VM (`vm run` / `vm create`) with the desired CPU/memory if scaling beyond the snapshot's size is required.
7075

7176
## Cloud image UEFI boot compatibility
7277

0 commit comments

Comments
 (0)