Problem
vk-cocoon still models lazy restore as CloneOptions.OnDemand and emits the removed cocoon vm clone --on-demand flag in buildCloneArgs. Current argv tests still require the old flag.
It is selected for every non-Windows Cloud Hypervisor clone path:
cocoon removed --on-demand in cocoon#127. Current cocoon accepts only --restore-mode copy|ondemand|mmap. This is a compatibility failure for current Linux/CH clone paths, not only a performance opportunity.
The mmap implementation in cloud-hypervisor#1 measured a 16-way, 512 MiB clone burst at 443–463 ms to 72–82 ms per-clone p50, with wall time falling from 456–478 ms to 87–108 ms.
Proposed scope
- Replace
CloneOptions.OnDemand bool with an explicit restore mode.
- Emit
--restore-mode <mode> for Cloud Hypervisor and no restore-mode flag for Firecracker.
- Keep the policy in one helper:
- Linux CH:
mmap when using the supported and pinned cocoonstack CH build.
- Windows CH:
copy until mmap is validated against Windows boot and DHCP behavior.
- Firecracker: omit the option.
- If unpinned third-party CH builds are supported, provide one deployment-level override and retain
copy as the compatibility default.
- Update stale argv tests and deployment documentation.
mmap requires the snapshot memory file to remain present and unchanged for the VM lifetime. Current cocoon direct clone hardlinks memory files into the VM run directory.
Acceptance criteria
- No vk-cocoon path emits
--on-demand.
- Table tests cover
copy, ondemand, and mmap on CH and verify that FC emits none of them.
- Normal clone, fork, from-dir clone, and hibernation restore work against current cocoon.
- The supported deployment pins or documents the CH build required for mmap.
- Linux smoke tests cover mmap clone and restore; Windows remains on copy and passes boot/DHCP readiness.
- A 1/8/16-way comparison records create-to-running p50/p95 and confirms mmap improves fan-out latency over copy on a compatible host.
Problem
vk-cocoon still models lazy restore as
CloneOptions.OnDemandand emits the removedcocoon vm clone --on-demandflag inbuildCloneArgs. Current argv tests still require the old flag.It is selected for every non-Windows Cloud Hypervisor clone path:
provider/cocoon/create.goprovider/cocoon/update.gouseOnDemandClonecocoon removed
--on-demandin cocoon#127. Current cocoon accepts only--restore-mode copy|ondemand|mmap. This is a compatibility failure for current Linux/CH clone paths, not only a performance opportunity.The mmap implementation in cloud-hypervisor#1 measured a 16-way, 512 MiB clone burst at 443–463 ms to 72–82 ms per-clone p50, with wall time falling from 456–478 ms to 87–108 ms.
Proposed scope
CloneOptions.OnDemand boolwith an explicit restore mode.--restore-mode <mode>for Cloud Hypervisor and no restore-mode flag for Firecracker.mmapwhen using the supported and pinned cocoonstack CH build.copyuntil mmap is validated against Windows boot and DHCP behavior.copyas the compatibility default.mmaprequires the snapshot memory file to remain present and unchanged for the VM lifetime. Current cocoon direct clone hardlinks memory files into the VM run directory.Acceptance criteria
--on-demand.copy,ondemand, andmmapon CH and verify that FC emits none of them.