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

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 1ca445d..13952cb 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -594,6 +594,25 @@ sub phase2 {
 
     die "unable to detect remote migration address\n" if !$raddr;
 
+    if ($self->{opts}->{externalcluster}) {
+
+       my $conf = PVE::QemuConfig->load_config($vmid);
+
+       foreach my $target_drive (keys %{$self->{target_drive}}) {
+           my $drive = PVE::QemuServer::parse_drive($target_drive, 
$self->{target_drive}->{$target_drive}->{volid});
+           $conf->{$target_drive} = PVE::QemuServer::print_drive($vmid, 
$drive);
+       }
+
+       my $configout = "";
+       foreach my $opt (keys %$conf) {
+           next if $opt eq 'snapshots';
+           next if $opt eq 'pending';
+           $configout .= "$opt: $conf->{$opt}\n";
+       }
+       my $cmdwrite = [@{$self->{rem_ssh}}," /bin/echo -e \"$configout\" > 
/etc/pve/qemu-server/$targetvmid.conf"];
+       PVE::Tools::run_command($cmdwrite);
+    }
+
     if ($migration_type eq 'secure') {
        $self->log('info', "start remote tunnel");
 
-- 
2.1.4

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to