避免 microVM 镜像复制占满 LXC page cache
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user