mirror of
git://git.proxmox.com/git/pve-guest-common.git
synced 2025-01-12 09:17:50 +03:00
Swap source and target in replication config, if VM was stolen.
This commit is contained in:
parent
286a9ab991
commit
7bbb0cd6a9
@ -254,8 +254,17 @@ sub job_status {
|
||||
|
||||
my $target = $jobcfg->{target};
|
||||
if (!$jobcfg->{remove_job}) {
|
||||
# never sync to local node
|
||||
next if $target eq $local_node;
|
||||
# check if vm was stolen (swapped source target)
|
||||
if ($target eq $local_node) {
|
||||
my $source = $jobcfg->{source};
|
||||
if (defined($source) && $source ne $target) {
|
||||
$jobcfg = PVE::ReplicationConfig::swap_source_target_nolock($jobid);
|
||||
$cfg->{ids}->{$jobid} = $jobcfg;
|
||||
} else {
|
||||
# never sync to local node
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
next if !$get_disabled && $jobcfg->{disable};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user