mirror of
git://git.proxmox.com/git/qemu-server.git
synced 2025-01-22 22:03:55 +03:00
migrate: keep track of replication
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@proxmox.com>
This commit is contained in:
parent
2e7fee87df
commit
4bdd20ab14
@ -442,6 +442,7 @@ sub sync_disks {
|
|||||||
my $logfunc = sub { my ($msg) = @_; $self->log('info', $msg); };
|
my $logfunc = sub { my ($msg) = @_; $self->log('info', $msg); };
|
||||||
$rep_volumes = PVE::Replication::run_replication(
|
$rep_volumes = PVE::Replication::run_replication(
|
||||||
'PVE::QemuConfig', $jobcfg, $start_time, $start_time, $logfunc);
|
'PVE::QemuConfig', $jobcfg, $start_time, $start_time, $logfunc);
|
||||||
|
$self->{replicated_volumes} = $rep_volumes;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $volid (keys %$local_volumes) {
|
foreach my $volid (keys %$local_volumes) {
|
||||||
@ -916,7 +917,7 @@ sub phase3_cleanup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# transfer replication state before move config
|
# transfer replication state before move config
|
||||||
$self->transfer_replication_state();
|
$self->transfer_replication_state() if $self->{replicated_volumes};
|
||||||
|
|
||||||
# move config to remote node
|
# move config to remote node
|
||||||
my $conffile = PVE::QemuConfig->config_file($vmid);
|
my $conffile = PVE::QemuConfig->config_file($vmid);
|
||||||
@ -925,7 +926,7 @@ sub phase3_cleanup {
|
|||||||
die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
|
die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
|
||||||
if !rename($conffile, $newconffile);
|
if !rename($conffile, $newconffile);
|
||||||
|
|
||||||
$self->switch_replication_job_target();
|
$self->switch_replication_job_target() if $self->{replicated_volumes};
|
||||||
|
|
||||||
if ($self->{livemigration}) {
|
if ($self->{livemigration}) {
|
||||||
if ($self->{storage_migration}) {
|
if ($self->{storage_migration}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user