file-restore: use less memory for VM and reboot on panic

With the vsock-pkt-buffer fix in proxmox-backup-restore-image, we can
use way less memory for the VM without risking any crashes. 128 MiB
seems to be the lowest it will go and still be fully reliable.

While at it, add the "panic=1" argument to the kernel command line, so
in case the kernel *does* run out of memory, it will at least restart
automatically.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter 2021-04-26 15:04:16 +02:00 committed by Thomas Lamprecht
parent ddbd63ed5f
commit a862835be2
1 changed files with 2 additions and 2 deletions

View File

@ -168,13 +168,13 @@ pub async fn start_vm(
"none", "none",
"-enable-kvm", "-enable-kvm",
"-m", "-m",
"512", "128",
"-kernel", "-kernel",
buildcfg::PROXMOX_BACKUP_KERNEL_FN, buildcfg::PROXMOX_BACKUP_KERNEL_FN,
"-initrd", "-initrd",
&ramfs_path, &ramfs_path,
"-append", "-append",
"quiet", "quiet panic=1",
"-daemonize", "-daemonize",
"-pidfile", "-pidfile",
&format!("/dev/fd/{}", pid_fd.as_raw_fd()), &format!("/dev/fd/{}", pid_fd.as_raw_fd()),