]> git.proxmox.com Git - pve-qemu.git/commit
savevm-async: keep more free space when entering final stage
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 26 Jan 2023 13:46:14 +0000 (14:46 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 Feb 2023 07:39:08 +0000 (08:39 +0100)
commiteee064d954a8383b88f35c5cd0101daa910efcd7
treeffebb041031fdeb7000234bb36aea32f46993ffe
parent8051a24b5f1e510156a20d332daf63c36b7d1767
savevm-async: keep more free space when entering final stage

In qemu-server, we already allocate 2 * $mem_size + 500 MiB for driver
state (which was 32 MiB long ago according to git history). It seems
likely that the 30 MiB cutoff in the savevm-async implementation was
chosen based on that.

In bug #4476 [0], another issue caused the iteration to not make any
progress and the state file filled up all the way to the 30 MiB +
pending_size cutoff. Since the guest is not stopped immediately after
the check, it can still dirty some RAM and the current cutoff is not
enough for a reproducer VM (was done while bug #4476 still was not
fixed), dirtying memory with
> stress-ng -B 2 --bigheap-growth 64.0M'
After entering the final stage, savevm actually filled up the state
file completely, leading to an I/O error. It's probably the same
scenario as reported in the bug report, the error message was fixed in
commit a020815 ("savevm-async: fix function name in error message")
after the bug report.

If not for the bug, the cutoff will only be reached by a VM that's
dirtying RAM faster than can be written to the storage, so increase
the cutoff to 100 MiB to have a bigger chance to finish successfully,
while still trying to not increase downtime too much for
non-hibernation snapshots.

[0]: https://bugzilla.proxmox.com/show_bug.cgi?id=4476

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
debian/patches/pve/0017-PVE-add-savevm-async-for-background-state-snapshots.patch
debian/patches/pve/0018-PVE-add-optional-buffer-size-to-QEMUFile.patch
debian/patches/pve/0049-PVE-savevm-async-register-yank-before-migration_inco.patch