]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/LXC/Migrate.pm
Fix #1547: on migration abort, the CT starts again
[pve-container.git] / src / PVE / LXC / Migrate.pm
index ee78a5f43a57f103e61b58ae1f0c968a073eab4d..1364b8d480c0ce108b0c67f410b2577ab5732ada 100644 (file)
@@ -354,6 +354,13 @@ sub final_cleanup {
        if (my $err = $@) {
            $self->log('err', $err);
        }
+       # in restart mode, we start the container on the source node
+       # on migration error
+       if ($self->{opts}->{restart} && $self->{was_running}) {
+           $self->log('info', "start container on source node");
+           my $skiplock = 1;
+           PVE::LXC::vm_start($vmid, $self->{vmconf}, $skiplock);
+       }
     } else {
        my $cmd = [ @{$self->{rem_ssh}}, 'pct', 'unlock', $vmid ];
        $self->cmd_logerr($cmd, errmsg => "failed to clear migrate lock");