[pve-devel] [PATCH v3 container 1/3] migrate: only restart if conf was moved
Fabian Grünbichler
f.gruenbichler at proxmox.com
Tue Oct 17 13:25:22 CEST 2017
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
src/PVE/LXC/Migrate.pm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index df85ef7..9e8027c 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -359,16 +359,17 @@ sub final_cleanup {
}
} else {
my $cmd = [ @{$self->{rem_ssh}}, 'pct', 'unlock', $vmid ];
- $self->cmd_logerr($cmd, errmsg => "failed to clear migrate lock");
+ $self->cmd_logerr($cmd, errmsg => "failed to clear migrate lock");
+
+ # in restart mode, we start the container on the target node
+ # after migration
+ if ($self->{opts}->{restart} && $self->{was_running}) {
+ $self->log('info', "start container on target node");
+ my $cmd = [ @{$self->{rem_ssh}}, 'pct', 'start', $vmid];
+ $self->cmd($cmd);
+ }
}
- # in restart mode, we start the container on the target node
- # after migration
- if ($self->{opts}->{restart} && $self->{was_running}) {
- $self->log('info', "start container on target node");
- my $cmd = [ @{$self->{rem_ssh}}, 'pct', 'start', $vmid];
- $self->cmd($cmd);
- }
}
1;
--
2.14.2
More information about the pve-devel
mailing list