migrate: pass --machine parameter to remote 'qm start' command

This commit is contained in:
Dietmar Maurer 2013-06-05 10:24:39 +02:00
parent 4b15803dee
commit 42668529e6

View File

@ -139,6 +139,7 @@ sub prepare {
if (my $pid = PVE::QemuServer::check_running($vmid)) { if (my $pid = PVE::QemuServer::check_running($vmid)) {
die "cant migrate running VM without --online\n" if !$online; die "cant migrate running VM without --online\n" if !$online;
$running = $pid; $running = $pid;
$self->{forcemachine} = PVE::QemuServer::get_current_qemu_machine($vmid);
} }
if (my $loc_res = PVE::QemuServer::check_local_resources($conf, 1)) { if (my $loc_res = PVE::QemuServer::check_local_resources($conf, 1)) {
@ -313,6 +314,10 @@ sub phase2 {
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'start', my $cmd = [@{$self->{rem_ssh}}, 'qm', 'start',
$vmid, '--stateuri', 'tcp', '--skiplock', '--migratedfrom', $nodename]; $vmid, '--stateuri', 'tcp', '--skiplock', '--migratedfrom', $nodename];
if ($self->{forcemachine}) {
push @$cmd, '--machine', $self->{forcemachine};
}
PVE::Tools::run_command($cmd, outfunc => sub { PVE::Tools::run_command($cmd, outfunc => sub {
my $line = shift; my $line = shift;