public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] qm cleanup: avoid problematic cleanup during rollback
@ 2025-11-28 12:52 Fiona Ebner
  2025-11-29 22:49 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2025-11-28 12:52 UTC (permalink / raw)
  To: pve-devel

During preparation for rollback, there already is a VM cleanup. The
rollback operation temporarily drops the file lock for the
configuration while doing rollback of the volumes on the storage
layer. If a shutdown operation or more precisely, the cleanup
thereafter happens concurrently, it can get the file lock and do the
cleanup (a second time) while rollback is running. If a badly timed
deactivate for the volume happens, this can cause issues as reported
in the community forum [0] and confirmed locally (but only managed to
reproduce with 'saferemove').

[0]: https://forum.proxmox.com/threads/174875/post-815273

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/CLI/qm.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/PVE/CLI/qm.pm b/src/PVE/CLI/qm.pm
index bfce860f..60fe318e 100755
--- a/src/PVE/CLI/qm.pm
+++ b/src/PVE/CLI/qm.pm
@@ -1111,6 +1111,12 @@ __PACKAGE__->register_method({
                 my $pid = PVE::QemuServer::check_running($vmid);
                 die "vm still running\n" if $pid;
 
+                # Rollback already does cleanup when preparing and afterwards temporarily drops the
+                # lock on the configuration file to rollback the volumes. Deactivating volumes here
+                # again while that is happening would be problematic.
+                die "skipping cleanup - 'rollback' lock is present\n"
+                    if $conf->{lock} && $conf->{lock} eq 'rollback';
+
                 if (!$clean) {
                     # we have to cleanup the tap devices after a crash
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH qemu-server] qm cleanup: avoid problematic cleanup during rollback
  2025-11-28 12:52 [pve-devel] [PATCH qemu-server] qm cleanup: avoid problematic cleanup during rollback Fiona Ebner
@ 2025-11-29 22:49 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-11-29 22:49 UTC (permalink / raw)
  To: pve-devel, Fiona Ebner

On Fri, 28 Nov 2025 13:52:09 +0100, Fiona Ebner wrote:
> During preparation for rollback, there already is a VM cleanup. The
> rollback operation temporarily drops the file lock for the
> configuration while doing rollback of the volumes on the storage
> layer. If a shutdown operation or more precisely, the cleanup
> thereafter happens concurrently, it can get the file lock and do the
> cleanup (a second time) while rollback is running. If a badly timed
> deactivate for the volume happens, this can cause issues as reported
> in the community forum [0] and confirmed locally (but only managed to
> reproduce with 'saferemove').
> 
> [...]

Applied, thanks!

[1/1] qm cleanup: avoid problematic cleanup during rollback
      commit: ffe8e2dae832641d95fda68aa198e38f60d3e2bd


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-29 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-28 12:52 [pve-devel] [PATCH qemu-server] qm cleanup: avoid problematic cleanup during rollback Fiona Ebner
2025-11-29 22:49 ` [pve-devel] applied: " Thomas Lamprecht

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