[pve-devel] [PATCH 05/19] phase2 : create a new vm on external node

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


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

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 71af817..a2fa17a 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -471,6 +471,21 @@ sub phase2 {
 
     my $conf = $self->{vmconf};
 
+    if ($self->{opts}->{externalcluster}) {
+	$self->log('info', "Creating a new VM on remote external node '$self->{node}'");
+	## start on remote node
+	my $cmdcreate = [@{$self->{rem_ssh}}];
+	push @$cmdcreate , 'qm', 'create';
+	
+	PVE::Tools::run_command($cmdcreate, outfunc => sub {
+            my $line = shift;
+
+            if ($line =~ m/^vm (\d+) created$/) {
+                $vmid = $1;
+            }
+	});
+    }
+
     $self->log('info', "starting VM $vmid on remote node '$self->{node}'");
 
     my $raddr;
-- 
2.1.4




More information about the pve-devel mailing list