move config file in phase3, when live migration is finished

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2012-08-21 12:21:49 +02:00 committed by Dietmar Maurer
parent 7f4a5b5a6e
commit b8d208023b

View File

@ -267,12 +267,6 @@ sub phase1 {
sync_disks($self, $vmid);
# move config to remote node
my $conffile = PVE::QemuServer::config_file($vmid);
my $newconffile = PVE::QemuServer::config_file($vmid, $self->{node});
die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
if !rename($conffile, $newconffile);
};
sub phase1_cleanup {
@ -396,6 +390,13 @@ sub phase3_cleanup {
my $conf = $self->{vmconf};
# move config to remote node
my $conffile = PVE::QemuServer::config_file($vmid);
my $newconffile = PVE::QemuServer::config_file($vmid, $self->{node});
die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
if !rename($conffile, $newconffile);
# always stop local VM
eval { PVE::QemuServer::vm_stop($self->{storecfg}, $vmid, 1, 1); };
if (my $err = $@) {