[pve-devel] [PATCH 2/2] remove migration lock from config.

Wolfgang Link w.link at proxmox.com
Thu Sep 3 08:58:19 CEST 2015


It is not really necessary to use the lock at migragtion.
And it makes problem to remove the lock, because the config is moved
and the cluster_vm list is not updated at this moment.
---
 src/PVE/LXC/Migrate.pm | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index bf6d701..04d49bc 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -74,8 +74,13 @@ sub phase1 {
     $self->log('info', "starting migration of CT $self->{vmid} to node '$self->{node}' ($self->{nodeip})");
 
     my $conf = $self->{vmconf};
-    $conf->{lock} = 'migrate';
-    PVE::LXC::write_config($vmid, $conf);
+
+    #It is not really necessary to use the lock
+    #And it makes problem to remove the lock, because the config is moved
+    #and the cluster_vm list is not updated at this moment.
+
+    #$conf->{lock} = 'migrate';
+    #PVE::LXC::write_config($vmid, $conf);
 
     if ($self->{running}) {
 	$self->log('info', "container is running - using online migration");
@@ -152,13 +157,15 @@ sub final_cleanup {
 
     $self->log('info', "start final cleanup");
 
-    my $conf = $self->{vmconf};
-    delete $conf->{lock};
+    #see note in phase1
 
-    eval { PVE::LXC::write_config($vmid, $conf); };
-    if (my $err = $@) {
-	$self->log('err', $err);
-    }
+    #my $conf = $self->{vmconf};
+    #delete $conf->{lock};
+
+    #eval { PVE::LXC::write_config($vmid, $conf); };
+    #if (my $err = $@) {
+	#$self->log('err', $err);
+    #}
 }
 
 1;
-- 
2.1.4





More information about the pve-devel mailing list