[pve-devel] [PATCH 04/19] sync_disk: migrate all disk for externalcluster

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


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

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 8d1f9e8..71af817 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -293,6 +293,12 @@ sub sync_disks {
 	    my $targetsid = $self->{opts}->{targetstorage} ? $self->{opts}->{targetstorage} : $sid;
 	    # check if storage is available on both nodes
 	    my $scfg = PVE::Storage::storage_check_node($self->{storecfg}, $sid);
+	    #for external cluster, we migrate all volume, shared or non shared
+	    if($self->{opts}->{externalcluster}) {
+		push @{$self->{online_local_volumes}}, $volid if !defined($snapname);
+		return;
+	    }
+
 	    PVE::Storage::storage_check_node($self->{storecfg}, $sid, $self->{node});
 
 	    return if $scfg->{shared};
@@ -342,6 +348,7 @@ sub sync_disks {
 
 	    PVE::QemuServer::foreach_drive($conf->{snapshots}->{$snapname}, $test_drive, $snapname);
 	}
+
 	PVE::QemuServer::foreach_drive($conf, $test_drive);
 
 	foreach my $vol (sort keys %$local_volumes) {
@@ -368,6 +375,8 @@ sub sync_disks {
 	    $self->{opts}->{targetstorage} = 1; #use same sid for remote local
 	}
 
+	return if $self->{opts}->{externalcluster};
+
 	if ($abort) {
 	    die "can't migrate VM - check log\n";
 	}
-- 
2.1.4




More information about the pve-devel mailing list