[pve-devel] [PATCH qemu-server 09/10] migrate: keep track of replication

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Aug 4 12:23:21 CEST 2017


On 08/04/2017 10:55 AM, Fabian Gr├╝nbichler wrote:
> and only transfer state and switch direction if there
> actually are any replicated volumes.
> 
> once we add support for live-migration with replicated
> volumes, adding a set-replication-state command to the
> tunnel and using that probably makes sense.
> 
> Signed-off-by: Fabian Gr├╝nbichler <f.gruenbichler at proxmox.com>
> ---
>   PVE/QemuMigrate.pm | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 5a21b06..cfb4e2f 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -439,6 +439,7 @@ sub sync_disks {
>   	    my $logfunc = sub { my ($msg) = @_;  $self->log('info', $msg); };
>   	    $rep_volumes = PVE::Replication::run_replication(
>   	       'PVE::QemuConfig', $jobcfg, $start_time, $start_time, $logfunc);
> +	    $self->{replicated_volumes} = $rep_volumes;
>   	}
>   
>   	foreach my $volid (keys %$local_volumes) {
> @@ -913,7 +914,7 @@ sub phase3_cleanup {
>       }
>   
>       # transfer replication state before move config
> -    $self->transfer_replication_state();
> +    $self->transfer_replication_state() if $self->{replicated_volumes};
>   
>       # move config to remote node
>       my $conffile = PVE::QemuConfig->config_file($vmid);
> @@ -922,7 +923,7 @@ sub phase3_cleanup {
>       die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
>           if !rename($conffile, $newconffile);
>   
> -    $self->switch_replication_job_target();
> +    $self->switch_replication_job_target() if $self->{replicated_volumes};;

double ;;

>   
>       if ($self->{livemigration}) {
>   	if ($self->{storage_migration}) {
> 





More information about the pve-devel mailing list