[pbs-devel] [PATCH proxmox-backup 3/4] file-restore: use less memory for VM and reboot on panic
Stefan Reiter
s.reiter at proxmox.com
Mon Apr 26 15:04:16 CEST 2021
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 at proxmox.com>
---
Depends on proxmox-backup-restore-image patch, otherwise this will lead to
crashes during downloads.
Note that when debugging with this patch, you need to enable release builds, as
the debug build of proxmox-file-restore-daemon is too big to fit in 128 MiB of
memory (via the initramfs).
src/bin/proxmox_file_restore/qemu_helper.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/proxmox_file_restore/qemu_helper.rs b/src/bin/proxmox_file_restore/qemu_helper.rs
index 0f3a7feb..46fa011b 100644
--- a/src/bin/proxmox_file_restore/qemu_helper.rs
+++ b/src/bin/proxmox_file_restore/qemu_helper.rs
@@ -168,13 +168,13 @@ pub async fn start_vm(
"none",
"-enable-kvm",
"-m",
- "512",
+ "128",
"-kernel",
buildcfg::PROXMOX_BACKUP_KERNEL_FN,
"-initrd",
&ramfs_path,
"-append",
- "quiet",
+ "quiet panic=1",
"-daemonize",
"-pidfile",
&format!("/dev/fd/{}", pid_fd.as_raw_fd()),
--
2.20.1
More information about the pbs-devel
mailing list