When you migrate an openVZ container the files are deleted from the source node, so when you migrate back the CT you have to copy again all the files, you do not sync them, because the old copy was deleted, so it can be slow.
If you have enought space you can keep a copy of the CT for each node by modifying some files.
Warning : it will be active for all the CT, so you have to have enought space to maintain a copy of the CT on each node.
So on each node modify the following files :
/usr/share/perl5/PVE/AbstractMigrate.pm
@ line 111 replace
by
/usr/share/perl5/PVE/OpenVZMigrate.pm
comment line 300 to 305
then restart the node.
You have to do these manipulations on each node of your proxmox cluster.
If you want to test it before restart you can do a migration from the shell :
then check the private repository you will see that the files of CT are still present.
I tested this on three nodes with no problem, but not in production yet.
If you have enought space you can keep a copy of the CT for each node by modifying some files.
Warning : it will be active for all the CT, so you have to have enought space to maintain a copy of the CT on each node.
So on each node modify the following files :
/usr/share/perl5/PVE/AbstractMigrate.pm
@ line 111 replace
Code:
my @rsync_opts = ('-aH', '--delete', '--numeric-ids');
Code:
my @rsync_opts = ('-aH', '--numeric-ids');
/usr/share/perl5/PVE/OpenVZMigrate.pm
comment line 300 to 305
Code:
#if (!$self->{shared}){
# #destroy local container data
# $self->log('info',"removing container files on local node");
# my $cmd = [ 'rm', '-rf', $self->{privatedir} ];
# $self->cmd_logerr($cmd);
#}
You have to do these manipulations on each node of your proxmox cluster.
If you want to test it before restart you can do a migration from the shell :
Code:
pvectl migrate CTID PROXMOXNODE
I tested this on three nodes with no problem, but not in production yet.