mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 20:48:29 +00:00
migrate: pass --machine parameter to remote 'qm start' command
This commit is contained in:
parent
4b15803dee
commit
42668529e6
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user