+ } elsif ($opt eq "replica") {
+ die "Not all volumes are syncable, please check your config\n"
+ if !PVE::ReplicationTools::check_guest_volumes_syncable($conf, 'qemu');
+ die "replica_target is required\n"
+ if !$conf->{replica_target} && !$param->{replica_target};
+ my $value = $param->{$opt};
+ if ($value) {
+ PVE::ReplicationTools::job_enable($vmid);
+ } else {
+ PVE::ReplicationTools::job_disable($vmid);
+ }
+ $conf->{$opt} = $param->{$opt};
+ } elsif ($opt eq "replica_interval" || $opt eq "replica_rate_limit") {
+ $conf->{$opt} = $param->{$opt};
+ PVE::ReplicationTools::update_conf($vmid, $opt, $param->{$opt});
+ } elsif ($opt eq "replica_target" ) {
+ die "Node: $param->{$opt} does not exists in Cluster.\n"
+ if !PVE::Cluster::check_node_exists($param->{$opt});
+ PVE::ReplicationTools::update_conf($vmid, $opt, $param->{$opt})
+ if defined($conf->{$opt});
+ $conf->{$opt} = $param->{$opt};