diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm index d2828876..251fe7ec 100644 --- a/PVE/QemuConfig.pm +++ b/PVE/QemuConfig.pm @@ -71,13 +71,16 @@ sub get_replicatable_volumes { my $test_volid = sub { my ($volid, $attr) = @_; + return if $attr->{cdrom}; + + return if !$cleanup && !$attr->{replicate}; + if ($volid =~ m|^/|) { return if !$attr->{replicate}; + return if $cleanup || $noerr; die "unable to replicate local file/device '$volid'\n"; } - return if $attr->{cdrom}; - my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, $noerr); return if !$storeid; @@ -87,9 +90,10 @@ sub get_replicatable_volumes { my ($path, $owner, $vtype) = PVE::Storage::path($storecfg, $volid); return if !$owner || ($owner != $vmid); - die "unable to replicate volume '$volid', type '$vtype'\n" if $vtype ne 'images'; - - return if !$cleanup && !$attr->{replicate}; + if ($vtype ne 'images') { + return if $cleanup || $noerr; + die "unable to replicate volume '$volid', type '$vtype'\n"; + } if (!PVE::Storage::volume_has_feature($storecfg, 'replicate', $volid)) { return if $cleanup || $noerr;