[pve-devel] [PATCH qemu-server 2/2] fix #2774: add early check for non-managed volumes

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Jun 2 10:46:27 CEST 2020


when checking whether a to-be-added drive's and the VM's replication
status are matching. otherwise, we end up in a failing generic
'parse_volume_id' with no mention of the actual reason.

adding 'replicate=0' to the new drive string fixes the underlying issue
with and without this patch, so this is just a cosmetic/usability
improvement.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/API2/Qemu.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 5e6fd42..974ee3b 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1095,6 +1095,9 @@ my $update_vm_api  = sub {
 	return if PVE::QemuServer::drive_is_cdrom($drive);
 
 	my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
+	die "cannot add non-managed/pass-through volume to a replicated VM\n"
+	    if !defined($storeid);
+
 	return if defined($volname) && $volname eq 'cloudinit';
 
 	my $format;
-- 
2.20.1





More information about the pve-devel mailing list