migrate: cleanup replica volume skip condition

This commit is contained in:
Wolfgang Bumiller 2017-04-28 10:34:46 +02:00
parent 1849c59288
commit 6e8044dcea

View File

@ -861,10 +861,11 @@ sub phase3 {
# destroy local copies
foreach my $volid (@$volids) {
# do not destroy if new target is local_host
if (!($self->{vmconf}->{replica} && defined($synced_volumes->{$volid})
&& $self->{vmconf}->{replica_target} eq $self->{opts}->{node}) ) {
next if $self->{vmconf}->{replica} &&
defined($synced_volumes->{$volid}) &&
$self->{vmconf}->{replica_target} eq $self->{opts}->{node};
eval { PVE::Storage::vdisk_free($self->{storecfg}, $volid); };
if (my $err = $@) {
$self->log('err', "removing local copy of '$volid' failed - $err");
@ -872,7 +873,6 @@ sub phase3 {
last if $err =~ /^interrupted by signal$/;
}
}
}
}
sub phase3_cleanup {