all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] fix drive-mirror completion with cloudinit
Date: Fri, 15 Jan 2021 12:49:24 +0100	[thread overview]
Message-ID: <20210115114924.30795-1-m.limbeck@proxmox.com> (raw)

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





             reply	other threads:[~2021-01-15 11:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 11:49 Mira Limbeck [this message]
2021-01-25 13:31 ` [pve-devel] applied: " 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=20210115114924.30795-1-m.limbeck@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pve-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal