[pve-devel] [PATCH 16/19] phase3_cleanup : don't free disk of source vm

Alexandre Derumier aderumier at odiso.com
Wed Feb 22 14:33:40 CET 2017


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuMigrate.pm | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 6c238b7..64f3565 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -1020,15 +1020,19 @@ sub phase3_cleanup {
     }
 
     if($self->{storage_migration}) {
-	# destroy local copies
-	my $volids = $self->{online_local_volumes};
-
-	foreach my $volid (@$volids) {
-	    eval { PVE::Storage::vdisk_free($self->{storecfg}, $volid); };
-	    if (my $err = $@) {
-		$self->log('err', "removing local copy of '$volid' failed - $err");
-		$self->{errors} = 1;
-		last if $err =~ /^interrupted by signal$/;
+
+	if (!$self->{opts}->{externalcluster}) {
+
+	    # destroy local copies
+	    my $volids = $self->{online_local_volumes};
+
+	    foreach my $volid (@$volids) {
+		eval { PVE::Storage::vdisk_free($self->{storecfg}, $volid); };
+		if (my $err = $@) {
+		    $self->log('err', "removing local copy of '$volid' failed - $err");
+		    $self->{errors} = 1;
+		    last if $err =~ /^interrupted by signal$/;
+		}
 	    }
 	}
 
-- 
2.1.4




More information about the pve-devel mailing list