public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] fix drive-mirror completion with cloudinit
@ 2021-01-15 11:49 Mira Limbeck
  2021-01-25 13:31 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Mira Limbeck @ 2021-01-15 11:49 UTC (permalink / raw)
  To: pve-devel

On clone_vm when cloning the disks while the VM is running, we use
drive-mirror. We skip completion until the last disk, but with a
cloudinit disk there's no drive-mirror and so no completion done. If it
is the last disk in the hash, we never complete the drive-mirror jobs
and no further cloning is possible as there are already active jobs
using the disks.

To fix it we have to call qemu_drive_mirror_monitor directly in the case
of cloudinit when completion is requested and there are jobs defined.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
 PVE/QemuServer.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 54278e5..ae9d6dd 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6965,6 +6965,12 @@ sub clone_disk {
 	PVE::Storage::activate_volumes($storecfg, [$newvolid]);
 
 	if (drive_is_cloudinit($drive)) {
+	    # when cloning multiple disks (e.g. during clone_vm) it might be the last disk
+	    # if this is the case, we have to complete any block-jobs still there from
+	    # previous drive-mirrors
+	    if (($completion eq 'complete') && (scalar(keys %$jobs) > 0)) {
+		qemu_drive_mirror_monitor($vmid, $newvmid, $jobs, $completion, $qga);
+	    }
 	    goto no_data_clone;
 	}
 
-- 
2.20.1





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

end of thread, other threads:[~2021-01-25 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 11:49 [pve-devel] [PATCH qemu-server] fix drive-mirror completion with cloudinit Mira Limbeck
2021-01-25 13:31 ` [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