public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 3/4] file-restore: use less memory for VM and reboot on panic
Date: Mon, 26 Apr 2021 15:04:16 +0200	[thread overview]
Message-ID: <20210426130417.20979-3-s.reiter@proxmox.com> (raw)
In-Reply-To: <20210426130417.20979-1-s.reiter@proxmox.com>

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>
---

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





  parent reply	other threads:[~2021-04-26 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 13:04 [pbs-devel] [PATCH proxmox-backup 1/4] file-restore: add size to image files and components Stefan Reiter
2021-04-26 13:04 ` [pbs-devel] [PATCH proxmox-backup 2/4] file-restore: exit with code 1 in case streaming fails Stefan Reiter
2021-04-26 13:04 ` Stefan Reiter [this message]
2021-04-26 13:04 ` [pbs-devel] [PATCH proxmox-backup-restore-image 4/4] add workaround kernel patch for vsock panics Stefan Reiter
2021-04-27  6:35 ` [pbs-devel] applied-series: [PATCH proxmox-backup 1/4] file-restore: add size to image files and components Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210426130417.20979-3-s.reiter@proxmox.com \
    --to=s.reiter@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal