fix #2774: add early check for non-managed volumes

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@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2020-06-02 10:46:27 +02:00 committed by Thomas Lamprecht
parent e3d3194446
commit 35171ddb0d

View File

@ -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;