避免 microVM 镜像复制占满 LXC page cache
test / python (pull_request) Successful in 9s
test / shell (pull_request) Failing after 18s

This commit is contained in:
2026-09-16 17:15:08 +00:00
parent 8578bee895
commit b25b1fbf62
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -45,8 +45,9 @@ test -r "$base_image"
test -r "$firmware"
install -d -m 0700 "$state_root/instances" "$vm_dir"
# Cloud Hypervisor cannot open qcow2 backing chains. Keep each disposable
# root disk flat; reflink-capable storage still makes this copy cheap.
cp --reflink=auto --sparse=always "$base_image" "$overlay"
# root disk flat and bypass the LXC page cache: caching both a 5 GiB copy and
# guest RAM can otherwise trigger the container memory limit.
qemu-img convert -q -T none -t none -f qcow2 -O qcow2 "$base_image" "$overlay"
cat >"$vm_dir/meta-data" <<EOF
instance-id: $instance_id